Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dgnemo/opentelemetry-operations-java
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: GoogleCloudPlatform/opentelemetry-operations-java
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Jun 17, 2022

  1. Bump otel version and get ready for stable metrics release. (GoogleCl…

    …oudPlatform#154)
    
    * Bump to stable OTEL metrics version and start cleaning up javadoc/public API for stable metrics exporter release.
    
    * Remove -alpha qualifier from metrics exporter release.
    
    * Fix build breakage, need semconv for tests.
    
    * Update metric config to use endpoint instead of stub for alternative endpoints.
    
    * Expose endpoint config for trace exporter.
    
    * cleanups.
    
    * Spotless apply
    
    * Fix CI build failure.
    
    * Fix other test failure.
    
    * Fix code review comments.
    
    * Rename metric exporter to avoid name clash.
    
    * Fix e2e test docker file.
    
    * Run spotless.
    jsuereth authored Jun 17, 2022
    Copy the full SHA
    c27ed8f View commit details

Commits on Jul 21, 2022

  1. Increase cloud monitoring client timeout to 12 s (GoogleCloudPlatform…

    …#157)
    
    This matches the internal value in Cloud Monitoring and avoids
    DEADLINE_EXCEEDED RPC errors.
    punya authored Jul 21, 2022
    Copy the full SHA
    eeef0e3 View commit details

Commits on Jul 22, 2022

  1. Copy the full SHA
    2838ee6 View commit details

Commits on Oct 11, 2022

  1. Fixes ci test (GoogleCloudPlatform#165)

    * Adds newline at EOF
    
    * Updates image tag to older release
    
    Image tag 'latest' points to the head of the repository which has the
    cmd folder deleted. Changing the tag to v2-alpha since it has the
    required folder.
    psx95 authored Oct 11, 2022
    Copy the full SHA
    a3c1c4f View commit details
  2. Update README (GoogleCloudPlatform#160)

    Fixed typo for `Interval` in example code.
    AndooBomber authored Oct 11, 2022
    Copy the full SHA
    1b6ad5b View commit details

Commits on Oct 14, 2022

  1. Enable detect resource test (GoogleCloudPlatform#166)

    * Update e2e test runner image to latest
    
    Updating the test runner image to latest should enable the test runner
    calling for detectResource test scenario for exporters in opentelemetry-java-ops.
    
    * Fixes failing test due to name mismatch
    
    * Replaces 'latest' tag with the exact version number
    psx95 authored Oct 14, 2022
    Copy the full SHA
    908e9a1 View commit details

Commits on Oct 21, 2022

  1. Copy the full SHA
    41d6ee1 View commit details

Commits on Oct 24, 2022

  1. Pr/detect cloud run (GoogleCloudPlatform#167)

    * Adds CloudRun resource detector
    
    * Update the test runner image for cloudbuild
    
    * Fix CloudRun e2e test
    
    * Code refactor for better readability
    
    * Adds missing javadocs
    
    * Code refactor remove unused parameter
    
    * Removes debug print statements
    
    * Update Javadoc
    
    * Add resource mapping for cloud-run
    
    * Address code refatcor + style issues
    psx95 authored Oct 24, 2022
    Copy the full SHA
    075a5ec View commit details

Commits on Oct 26, 2022

  1. Upgrade Gradle from v6.x to v7.x (GoogleCloudPlatform#171)

    Change tested against gradle 7.5.1
    psx95 authored Oct 26, 2022
    Copy the full SHA
    c2b6024 View commit details
  2. Copy the full SHA
    ce4b115 View commit details

Commits on Oct 28, 2022

  1. Update gradle wrapper for gradle v7 (GoogleCloudPlatform#172)

    * Update gradle wrapper for gradle v7
    
    * Update Java version source & target compatibility
    
    * Fix gradle assemble task
    psx95 authored Oct 28, 2022
    Copy the full SHA
    e494d5b View commit details

Commits on Nov 8, 2022

  1. Enables test server to run in CloudFunctions (GoogleCloudPlatform#173)

    * Enables Cloud Function resource detection
    
    * Refactor: add utility class to extract common attributes
    
    * Add build steps for cloud build trigger
    
    * Fix cloudbuild yaml file name
    
    * Update test runner image
    
    * Add missing javadoc
    
    * Removes unnecessary rethrow for exception
    psx95 authored Nov 8, 2022
    Copy the full SHA
    ba11240 View commit details

Commits on Nov 15, 2022

  1. Support GAE by handling readiness & liveliness checks (GoogleCloudPla…

    …tform#175)
    
    GAE resource detection & automated test runs on GAE is not enabled through this PR.
    psx95 authored Nov 15, 2022
    Copy the full SHA
    5be4226 View commit details

Commits on Nov 17, 2022

  1. Pr/enable gae resource detection (GoogleCloudPlatform#176)

    * Fix typo
    
    * Enable resource detection for GAE
    
    * Rename method: addCloudRegionFromMetadata to addCloudRegionFromMetadataUsingZone
    
    * Fix region detection for GAE standard
    
    * Update test runner image to v0.15.0
    psx95 authored Nov 17, 2022
    Copy the full SHA
    16e2087 View commit details

Commits on Nov 23, 2022

  1. Copy the full SHA
    73c2bd8 View commit details

Commits on Nov 29, 2022

  1. Remove repo level allstar configs (GoogleCloudPlatform#182)

    These should be added through org level configurations
    psx95 authored Nov 29, 2022
    Copy the full SHA
    ba637f0 View commit details

Commits on Nov 30, 2022

  1. Combine GCP resource detectors (GoogleCloudPlatform#181)

    * Delete individual classes for each GCP resource type
    
    * Combine all GCP resource detectors in a single class
    
    * Add missing javadoc
    
    * Fix Cloud Function detection
    
    * Rename GCPComputeResource to GCPResource
    
    * Fix GKE cluster location detection
    
    GKE resource should either only have the zone or the region as their location.
    Updated the source from where the location attribute is extracted.
    
    * Avoid adding malformed location to attributes in GKE
    psx95 authored Nov 30, 2022
    Copy the full SHA
    60cf3d6 View commit details

Commits on Jan 26, 2023

  1. Add prefix option to metrics exporter (GoogleCloudPlatform#189)

    * add prefix option to metrics exporter
    dashpole authored Jan 26, 2023
    Copy the full SHA
    c4085c5 View commit details

Commits on Feb 7, 2023

  1. Update dependencies to remove OSS vulnerabilities (GoogleCloudPlatfor…

    …m#190)
    
    * Update dependencies to remove OSS vulnerabilities
    
    * Re-run cloud-build
    
    * Update the test runner image to 0.16.0 (latest)
    
    * Empty commit. Re-run the build image step
    
    * Fix failing tests
    
    Failing tests are due to an update in the gRPC version
    The updated version requires the build tool (gradle, in this case) to
    merge the service files.
    For more details look at grpc/grpc-java#5493.
    
    * Add missing attribute to GAE resource detector
    
    * Fix failing unit tests
    psx95 authored Feb 7, 2023
    Copy the full SHA
    d9ab659 View commit details

Commits on Feb 13, 2023

  1. Update README to add missing setup steps. (GoogleCloudPlatform#192)

    * Update README to add missing setup steps.
    
    fixes GoogleCloudPlatform#163
    
    * Update propagators/gcp/README.md
    
    Co-authored-by: Aaron Abbott <aaronabbott@google.com>
    
    ---------
    
    Co-authored-by: Aaron Abbott <aaronabbott@google.com>
    psx95 and aabmass authored Feb 13, 2023
    Copy the full SHA
    c5f9378 View commit details

Commits on Feb 16, 2023

  1. Replaced concrete type TraceExporter with interface type SpanExporter (

    …GoogleCloudPlatform#194)
    
    * Replaced concrete type TraceExporter with interface type SpanExporter (Breaking Change)
    psx95 authored Feb 16, 2023
    Copy the full SHA
    9bc4558 View commit details

Commits on Feb 21, 2023

  1. Fix header check (GoogleCloudPlatform#197)

    * Update copyright year in spoless license files
    
    * Run spotlessApply to update the copyright year to 2023
    psx95 authored Feb 21, 2023
    Copy the full SHA
    6cba43f View commit details

Commits on Feb 23, 2023

  1. Copy the full SHA
    e6b8b1e View commit details

Commits on Mar 1, 2023

  1. Fix trace exporter (GoogleCloudPlatform#193)

    * Add initial implementation for deferred trace exporter
    
    * Update the trace config to lazy initialize Project ID
    
    * Udpate return types to interface types
    
    * Refactor: Simplify user facing API
    
    * Fix IllegalStateException when calling getProjectId
    
    * Fix header check
    
    * Make 'export' method thread safe
    
    * Add unit tests for TraceExporter
    
    * Run spotlessApply to fix style issues
    
    * Update documentation for the deferred approach
    
    * Make the TraceExporter thread-safe
    
    * Change copyright year in file header
    
    * Refactor: create a separate class for no-op TraceExporter
    
    * Update documentation for TraceExporter
    
    * Add class documentation for InternalTraceExporter
    
    * fix style issues
    
    * Fix locally failing TraceConfiguration test
    
    * Remove opencensus failure test
    
    * Update license headers for 2023
    
    * Removes the use of ThrottlingLogger
    
    * Refactor: update deferred execution to prevent API changes
    
    * Fix locally failing tests
    
    * Fix unit tests via mocking
    
    * Add opencensus-shim as a test dependency to verify fix
    
    * Mock ServiceOptions for getDefaultProjectId
    
    * Fix missing credentials on non-GCP environment
    
    * Refactor: address comments
    
    * Fix syncronization logic and thread-safety
    
    * Simplify thread safe logic by moving to memoized Supplier
    
    * Unit test TraceExporter failure case
    
    * Update javadoc for Noop exporter
    
    * Update exception type for null or empty project ID
    
    * Rename tests and add additional context in logs
    
    * Make noop exporter return success code
    
    * Reduce scope of unit tests to TraceConfiguration only
    psx95 authored Mar 1, 2023
    Copy the full SHA
    70e3b08 View commit details
  2. Set metric labels to be of type String for non-custom descriptor types (

    GoogleCloudPlatform#203)
    
    * Refactor: Re-arrange methods based on access modifiers
    
    * Refactor: remove unused parameter
    
    * Add logic to handle custom descriptor type prefix
    
    * Remove shadow plugin from build.gradle
    psx95 authored Mar 1, 2023
    Copy the full SHA
    b809e9f View commit details

Commits on Mar 6, 2023

  1. Copy the full SHA
    10aab44 View commit details

Commits on Mar 7, 2023

  1. Fix exporter-trace example & add README (GoogleCloudPlatform#206)

    * Fix exporter-trace example & add README
    
    * Update instrumentation scope name
    psx95 authored Mar 7, 2023
    Copy the full SHA
    51a0d39 View commit details

Commits on Mar 9, 2023

  1. Fix metrics exporter integration (GoogleCloudPlatform#207)

    * Fix metrics exporter example
    
    * Add metrics-exporter example with OpenTelemetrySdk usage
    
    * Update GoogleCloudMetricExporter to return generic types
    
    * Implement deferred initialization of metrics exporter
    
    * Update examples to use the deferred exporters
    
    * Lazy loads default project ID initialization
    
    * Fix failing tests
    
    MetricConfigurationTest had a test that directly invoked a static
    method, the state of which is preserved b/w test classes, this lead to
    an intermittent failure in one of the tests run in
    GoogleCloudMetricConfigurationTest, which made some assumptions about
    the state affected by the invocation of the said method.
    
    * Update documentation
    
    * Add readme for metrics exporter example
    
    * Make NoopMetricExport return the same AggregationTemporality as GoogleCloudMetricExporter
    
    * Undo accidental dependency version downgrade
    
    * Fix documentation errors
    
    * Remove the additional example
    psx95 authored Mar 9, 2023
    Copy the full SHA
    a776d91 View commit details

Commits on Mar 10, 2023

  1. Copy the full SHA
    cf90595 View commit details

Commits on Mar 21, 2023

  1. Upgrade to Gradle 7.6 (GoogleCloudPlatform#209)

    To be compatible with Java 17
    punya authored Mar 21, 2023
    Copy the full SHA
    4b716ee View commit details

Commits on Mar 22, 2023

  1. Update gradle (GoogleCloudPlatform#211)

    * Update shadow-plugin API to be compatible with gradle v8
    
    * Update gradle wrapper to gradle 8.0.2
    
    * Update GoogleCloudBuild images to use gradle v8
    psx95 authored Mar 22, 2023
    Copy the full SHA
    ecb223d View commit details

Commits on Mar 23, 2023

  1. Replace 'shadowJar' with subproject specific task (GoogleCloudPlatfor…

    …m#213)
    
    This is to improve the build-times as 'shadowJar' generates shadowJars
    for all sub-projects which is expensive and not required here.
    psx95 authored Mar 23, 2023
    Copy the full SHA
    8ec593b View commit details

Commits on Mar 27, 2023

  1. Relocate dependencies in the generated shadowJar (GoogleCloudPlatform…

    …#212)
    
    * Add gradle task to relocate dependencies in shaded JAR
    
    * Prevent conscrypt shading
    
    * Prevent accidental shading for source classes
    
    For some reason shadow plugin shades the source classes as well, this
    should not be the case. In order to prevent this accidental shading of
    source classes, we relocate the source classes back the original package
    to exclude them from automatic relocation.
    psx95 authored Mar 27, 2023
    Copy the full SHA
    245a701 View commit details

Commits on Mar 29, 2023

  1. Make GCPResourceTest environment agnostic (GoogleCloudPlatform#217)

    The unit test to verify that empty attributes are returned in non GCP
    environment, assumed that the test environment would be non GCE. This
    led to failures when running on GCE VMs.
    psx95 authored Mar 29, 2023
    Copy the full SHA
    0729730 View commit details

Commits on Apr 8, 2023

  1. Update Google Cloud and OpenTelemetry dependencies (GoogleCloudPlatfo…

    …rm#219)
    
    * Bump google cloud library versions to latest
    
    * Update OTel dependencies
    
    * Remove duplicate dependency declaration
    
    * Add newline at EOF
    psx95 authored Apr 8, 2023
    Copy the full SHA
    5cb85b8 View commit details

Commits on Apr 12, 2023

  1. Fix autoconf example (GoogleCloudPlatform#223)

    The OTel autoconfigure module was missing configuration parameters and
    the GKE container was missing required environment variables to publish
    Cloud monitoring metrics.
    psx95 authored Apr 12, 2023
    Copy the full SHA
    40a2fa5 View commit details
  2. Copy the full SHA
    dfffb53 View commit details
  3. Add missing otlp exporter dependency (GoogleCloudPlatform#221)

    Autoconfigure SDK extension is used but has not been configured. In this case, the default otlp exporter must be present on the classpath.
    
    Co-authored-by: Punya Biswal <punya@google.com>
    psx95 and punya authored Apr 12, 2023
    Copy the full SHA
    d0370a6 View commit details
  4. Add required env variables for publishing metrics (GoogleCloudPlatfor…

    …m#224)
    
    * Add required env variables for publishing metrics
    
    The added environmnet variables are required for resource detection in
    GKE environment. The absence of these variables cause failure to publish
    metrics.
    
    * Move container env vars to deployment spec
    psx95 authored Apr 12, 2023
    Copy the full SHA
    7a8aedd View commit details
  5. Spotless yaml (GoogleCloudPlatform#227)

    * Update spotless to v6.18.0
    
    * Add spotless config to add license header to YAML
    
    * Cleanup: remove empty yaml file
    
    * Update license headers via spotlessApply
    psx95 authored Apr 12, 2023
    Copy the full SHA
    e4cf50f View commit details

Commits on Apr 13, 2023

  1. Copy the full SHA
    33a656b View commit details
  2. Adds spotless support for shell scripts (GoogleCloudPlatform#228)

    * Add license header config for shell scripts
    
    * Udpate license header via spotlessApply
    
    * Fix missing license header failing check
    psx95 authored Apr 13, 2023
    Copy the full SHA
    e7876f0 View commit details

Commits on Apr 18, 2023

  1. Fix duplicate metrics in timeseries (GoogleCloudPlatform#231)

    * Fixes export error due to multiple metric points in TimeSeries
    
    * Cleanup debug statements
    
    * Fix formatting
    
    * Refactor: removes duplicate code
    
    * Updates test with expected instrumentation labels
    
    * Refactor: extract label values to final constants
    psx95 authored Apr 18, 2023
    Copy the full SHA
    96beabd View commit details
  2. Copy the full SHA
    0c1d840 View commit details

Commits on May 4, 2023

  1. Configures auto-exporter to publish shaded and non-shaded variants (G…

    …oogleCloudPlatform#235)
    
    * Configures auto-exporter to publish shaded and non-shaded variants
    
    * Remove shadowed=true from gradle properties
    
    Since auto-exporter has to be published as both - shaded and unshaded
    variant, the only required changes is to remove the shadowed property
    from gradle which prevents publishing shaded variants.
    
    The gradle shadow plugin automatically publishes a shaded artifact when
    used with maven publish plugin. The sources and javadoc for shaded JAR
    are not published unless explicitly mentioned.
    psx95 authored May 4, 2023
    Copy the full SHA
    c3ac980 View commit details

Commits on May 5, 2023

  1. Adds dependency declarations to order tasks (GoogleCloudPlatform#237)

    The missing dependency declarations result in errors in the release
    tasks - pointing to possibility of incorrect result depending on order
    in which these tasks execute.
    The release tasks are skipped during normal :build jobs so build passes,
    but the artifacts snapshot generation for release fails.
    psx95 authored May 5, 2023
    Copy the full SHA
    cd65398 View commit details
  2. Declares explicit dependency for signMavenPublication (GoogleCloudPla…

    …tform#238)
    
    Adds missing dependency declaration for task `signMavenPublication` for shared-resourcemapping module. 
    
    
    #### Testing
     - Verified `./gradlew clean build`
     - Verified `./gradlew snapshot` - is now passing ✅
    psx95 authored May 5, 2023
    Copy the full SHA
    a64fdd0 View commit details
  3. Add script to run example in docker container (GoogleCloudPlatform#229)

    This just adds a convenience script that allows users to run auto-instrument example in a local docker container instead of running on GKE.
    psx95 authored May 5, 2023
    Copy the full SHA
    4cc2f4d View commit details

Commits on May 8, 2023

  1. Copy the full SHA
    c2a6c3f View commit details
  2. Revert "Adds explicit instruction for shaded release" (GoogleCloudPla…

    …tform#241)
    
    Reverts GoogleCloudPlatform#240
    
    We do not want shaded version in a different artifact - use classifiers instead.
    psx95 authored May 8, 2023
    Copy the full SHA
    fcedb2f View commit details
Showing with 11,868 additions and 2,201 deletions.
  1. +16 −0 .github/CODEOWNERS
  2. +4 −1 .github/header-checker-lint.yml
  3. 0 examples/metrics/k8s-metrics-example.yaml → .github/snippet-bot.yml
  4. +49 −0 .github/workflows/codeql-analysis.yml
  5. +50 −8 .github/workflows/pr-build.yml
  6. +13 −5 README.md
  7. +40 −12 RELEASING.md
  8. +14 −0 SECURITY.md
  9. +117 −56 build.gradle
  10. +13 −0 buildscripts/spotless.license.dockerfile
  11. +1 −1 buildscripts/spotless.license.gradle
  12. +1 −1 buildscripts/spotless.license.java
  13. +15 −0 buildscripts/spotless.license.shell
  14. +13 −0 buildscripts/spotless.license.yaml
  15. +48 −0 cloudbuild-e2e-cloud-functions-gen2.yaml
  16. +36 −0 cloudbuild-e2e-cloud-run.yaml
  17. +37 −0 cloudbuild-e2e-gae.yaml
  18. +3 −4 cloudbuild-e2e-gce.yaml
  19. +5 −5 cloudbuild-e2e-gke.yaml
  20. +7 −29 cloudbuild-e2e-image.yaml
  21. +9 −4 cloudbuild-e2e-local.yaml
  22. +14 −0 detectors/resources-support/README.md
  23. +30 −0 detectors/resources-support/build.gradle
  24. +1 −0 detectors/resources-support/gradle.properties
  25. +64 −0 ...ctors/resources-support/src/main/java/com/google/cloud/opentelemetry/detection/AttributeKeys.java
  26. +46 −0 ...rs/resources-support/src/main/java/com/google/cloud/opentelemetry/detection/DetectedPlatform.java
  27. +33 −0 ...esources-support/src/main/java/com/google/cloud/opentelemetry/detection/EnvironmentVariables.java
  28. +168 −0 ...s/resources-support/src/main/java/com/google/cloud/opentelemetry/detection/GCPMetadataConfig.java
  29. +115 −0 ...resources-support/src/main/java/com/google/cloud/opentelemetry/detection/GCPPlatformDetector.java
  30. +72 −0 ...ors/resources-support/src/main/java/com/google/cloud/opentelemetry/detection/GoogleAppEngine.java
  31. +27 −0 ...resources-support/src/main/java/com/google/cloud/opentelemetry/detection/GoogleCloudFunction.java
  32. +27 −0 ...tors/resources-support/src/main/java/com/google/cloud/opentelemetry/detection/GoogleCloudRun.java
  33. +58 −0 ...s/resources-support/src/main/java/com/google/cloud/opentelemetry/detection/GoogleCloudRunJob.java
  34. +63 −0 ...resources-support/src/main/java/com/google/cloud/opentelemetry/detection/GoogleComputeEngine.java
  35. +75 −0 ...ources-support/src/main/java/com/google/cloud/opentelemetry/detection/GoogleKubernetesEngine.java
  36. +57 −0 ...urces-support/src/main/java/com/google/cloud/opentelemetry/detection/GoogleServerlessCompute.java
  37. +39 −0 ...ors/resources-support/src/main/java/com/google/cloud/opentelemetry/detection/UnknownPlatform.java
  38. +3 −3 ...ctors → resources-support/src/test/java/com/google/cloud/opentelemetry/detection}/EnvVarMock.java
  39. +151 −0 ...sources-support/src/test/java/com/google/cloud/opentelemetry/detection/GCPMetadataConfigTest.java
  40. +413 −0 ...urces-support/src/test/java/com/google/cloud/opentelemetry/detection/GCPPlatformDetectorTest.java
  41. +31 −0 detectors/resources-support/src/test/java/com/google/cloud/opentelemetry/detection/TestUtils.java
  42. +8 −0 detectors/resources/README.md
  43. +13 −6 detectors/resources/build.gradle
  44. +1 −1 detectors/resources/gradle.properties
  45. +135 −0 ...ors/resources/src/main/java/com/google/cloud/opentelemetry/detectors/AttributesExtractorUtil.java
  46. +5 −1 detectors/resources/src/main/java/com/google/cloud/opentelemetry/detectors/EnvVars.java
  47. +0 −87 detectors/resources/src/main/java/com/google/cloud/opentelemetry/detectors/GCEResource.java
  48. +21 −1 detectors/resources/src/main/java/com/google/cloud/opentelemetry/detectors/GCPMetadataConfig.java
  49. +246 −0 detectors/resources/src/main/java/com/google/cloud/opentelemetry/detectors/GCPResource.java
  50. +0 −85 detectors/resources/src/main/java/com/google/cloud/opentelemetry/detectors/GKEResource.java
  51. +1 −2 ...rces/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider
  52. +0 −96 detectors/resources/src/test/java/com/google/cloud/opentelemetry/detectors/GCEResourceTest.java
  53. +392 −0 detectors/resources/src/test/java/com/google/cloud/opentelemetry/detectors/GCPResourceTest.java
  54. +0 −128 detectors/resources/src/test/java/com/google/cloud/opentelemetry/detectors/GKEResourceTest.java
  55. +4 −1 e2e-test-server/README.md
  56. +27 −11 e2e-test-server/build.gradle
  57. +66 −0 e2e-test-server/src/main/java/com/google/cloud/opentelemetry/endtoend/CloudFunctionHandler.java
  58. +10 −7 e2e-test-server/src/main/java/com/google/cloud/opentelemetry/endtoend/Constants.java
  59. +73 −0 e2e-test-server/src/main/java/com/google/cloud/opentelemetry/endtoend/PubSubMessageHandler.java
  60. +90 −0 e2e-test-server/src/main/java/com/google/cloud/opentelemetry/endtoend/PubSubPullServer.java
  61. +233 −0 e2e-test-server/src/main/java/com/google/cloud/opentelemetry/endtoend/PubSubPushServer.java
  62. +28 −0 e2e-test-server/src/main/java/com/google/cloud/opentelemetry/endtoend/PubSubServer.java
  63. +1 −1 e2e-test-server/src/main/java/com/google/cloud/opentelemetry/endtoend/Request.java
  64. +1 −1 e2e-test-server/src/main/java/com/google/cloud/opentelemetry/endtoend/Response.java
  65. +1 −1 e2e-test-server/src/main/java/com/google/cloud/opentelemetry/endtoend/ScenarioHandler.java
  66. +23 −17 e2e-test-server/src/main/java/com/google/cloud/opentelemetry/endtoend/ScenarioHandlerManager.java
  67. +62 −67 e2e-test-server/src/main/java/com/google/cloud/opentelemetry/endtoend/Server.java
  68. +9 −12 e2e-test-server/wait-for-image.sh
  69. +4 −5 e2e.Dockerfile
  70. +45 −3 examples/autoconf/README.md
  71. +14 −9 examples/autoconf/build.gradle
  72. +23 −0 examples/autoconf/job.yaml
  73. +27 −12 examples/autoconf/src/main/java/com/google/cloud/opentelemetry/example/autoconf/AutoconfExample.java
  74. +103 −6 examples/autoinstrument/README.md
  75. +22 −5 examples/autoinstrument/build.gradle
  76. +48 −0 examples/autoinstrument/deployment.yaml
  77. +52 −0 examples/autoinstrument/run_in_cloud-run.sh
  78. +39 −0 examples/autoinstrument/run_in_docker.sh
  79. +1 −1 examples/autoinstrument/src/main/java/com/google/example/CloudTraceLogAttacher.java
  80. +1 −1 examples/autoinstrument/src/main/java/com/google/example/GreetingClient.java
  81. +1 −1 examples/autoinstrument/src/main/java/com/google/example/TestMain.java
  82. +29 −0 examples/instrumentation-quickstart/.dockerignore
  83. +37 −0 examples/instrumentation-quickstart/.gitignore
  84. +34 −0 examples/instrumentation-quickstart/Dockerfile
  85. +87 −0 examples/instrumentation-quickstart/README.md
  86. +78 −0 examples/instrumentation-quickstart/build.gradle
  87. +27 −0 examples/instrumentation-quickstart/cloudbuild-integration.yaml
  88. +24 −0 examples/instrumentation-quickstart/docker-compose.cloudbuild.yaml
  89. +35 −0 examples/instrumentation-quickstart/docker-compose.creds.yaml
  90. +57 −0 examples/instrumentation-quickstart/docker-compose.yaml
  91. BIN examples/instrumentation-quickstart/gradle/wrapper/gradle-wrapper.jar
  92. +7 −0 examples/instrumentation-quickstart/gradle/wrapper/gradle-wrapper.properties
  93. +249 −0 examples/instrumentation-quickstart/gradlew
  94. +92 −0 examples/instrumentation-quickstart/gradlew.bat
  95. +197 −0 examples/instrumentation-quickstart/integrationtest/go.mod
  96. +686 −0 examples/instrumentation-quickstart/integrationtest/go.sum
  97. +30 −0 examples/instrumentation-quickstart/integrationtest/quickstart_test.go
  98. +132 −0 examples/instrumentation-quickstart/otel-collector-config.yaml
  99. +17 −0 examples/instrumentation-quickstart/settings.gradle
  100. +34 −0 examples/instrumentation-quickstart/src/main/java/com/example/demo/DemoApplication.java
  101. +57 −0 examples/instrumentation-quickstart/src/main/java/com/example/demo/MultiController.java
  102. +46 −0 examples/instrumentation-quickstart/src/main/java/com/example/demo/SingleController.java
  103. +58 −0 examples/instrumentation-quickstart/src/main/resources/log4j2.xml
  104. +32 −0 examples/instrumentation-quickstart/src/test/java/com/example/demo/DemoApplicationTests.java
  105. +31 −0 examples/instrumentation-quickstart/uninstrumented.Dockerfile
  106. +62 −0 examples/metrics/README.md
  107. +13 −6 examples/metrics/build.gradle
  108. +58 −0 examples/metrics/run_as_cloud-run-job.sh
  109. +96 −26 .../metrics/src/main/java/com/google/cloud/opentelemetry/example/metrics/MetricsExporterExample.java
  110. +104 −0 examples/otlp-spring/README.md
  111. +67 −0 examples/otlp-spring/build.gradle
  112. +53 −0 examples/otlp-spring/k8s/deployment.yaml
  113. +76 −0 ...pring/src/main/java/com/google/cloud/opentelemetry/examples/otlpspring/ApplicationController.java
  114. +31 −0 examples/otlp-spring/src/main/java/com/google/cloud/opentelemetry/examples/otlpspring/Main.java
  115. +38 −0 .../com/google/cloud/opentelemetry/examples/otlpspring/configuration/OpenTelemetryConfiguration.java
  116. +2 −0 examples/otlp-spring/src/main/resources/application.properties
  117. +105 −0 ...ples/otlp-spring/src/test/java/com/google/cloud/opentelemetry/examples/otlpspring/MainClient.java
  118. +33 −0 examples/otlpmetric/README.md
  119. +47 −0 examples/otlpmetric/build.gradle
  120. +120 −0 ...otlpmetric/src/main/java/com/google/cloud/opentelemetry/example/otlpmetric/OTLPMetricExample.java
  121. +105 −0 examples/otlpmetrics-function/README.md
  122. +89 −0 examples/otlpmetrics-function/build.gradle
  123. +17 −0 examples/otlpmetrics-function/collector-deployment/Dockerfile
  124. +43 −0 examples/otlpmetrics-function/collector-deployment/collector-config.yaml
  125. +55 −0 ...unction/src/main/java/com/google/cloud/opentelemetry/examples/otlpmetricsfunction/HelloWorld.java
  126. +76 −0 ...rc/main/java/com/google/cloud/opentelemetry/examples/otlpmetricsfunction/OpenTelemetryConfig.java
  127. +26 −0 examples/otlptrace/README.md
  128. +48 −0 examples/otlptrace/build.gradle
  129. +79 −0 ...es/otlptrace/src/main/java/com/google/cloud/opentelemetry/example/otlptrace/OTLPTraceExample.java
  130. +56 −4 examples/resource/README.md
  131. +21 −6 examples/resource/build.gradle
  132. +13 −0 examples/resource/job.yaml
  133. +26 −12 examples/resource/src/main/java/com/google/cloud/opentelemetry/example/resource/ResourceExample.java
  134. +127 −0 examples/spring-boot-starter/README.md
  135. +79 −0 examples/spring-boot-starter/build.gradle
  136. +36 −0 ...starter/src/main/java/com/google/cloud/opentelemetry/example/springbootstarter/AppController.java
  137. +27 −0 ...n/java/com/google/cloud/opentelemetry/example/springbootstarter/SpringBootStarterApplication.java
  138. +7 −0 examples/spring-boot-starter/src/main/resources/application.properties
  139. +44 −0 examples/spring-sleuth/README.md
  140. +60 −0 examples/spring-sleuth/build.gradle
  141. +2 −2 ...ing-sleuth/src/main/java/com/google/cloud/opentelemetry/example/springsleuth}/GreetingClient.java
  142. +53 −0 examples/spring-sleuth/src/main/java/com/google/cloud/opentelemetry/example/springsleuth/Main.java
  143. +4 −0 examples/spring-sleuth/src/main/resources/application.properties
  144. +75 −1 examples/spring/README.md
  145. +49 −19 examples/spring/build.gradle
  146. +47 −0 examples/spring/run_in_cloud-run.sh
  147. +68 −0 examples/spring/src/main/java/com/google/cloud/opentelemetry/example/spring/AppController.java
  148. +2 −29 examples/spring/src/main/java/com/google/cloud/opentelemetry/example/spring/Main.java
  149. +51 −0 ...pring/src/main/java/com/google/cloud/opentelemetry/example/spring/OpenTelemetryConfiguration.java
  150. +0 −2 examples/spring/src/main/resources/application.properties
  151. +30 −0 examples/trace/README.md
  152. +16 −6 examples/trace/build.gradle
  153. +36 −27 examples/trace/src/main/java/com/google/cloud/opentelemetry/example/trace/TraceExporterExample.java
  154. +69 −0 ...es/trace/src/test/java/com/google/cloud/opentelemetry/example/trace/TraceExporterExampleTest.java
  155. +32 −6 exporters/auto/README.md
  156. +26 −17 exporters/auto/build.gradle
  157. +0 −1 exporters/auto/gradle.properties
  158. +1 −1 exporters/auto/src/main/java/com/google/cloud/opentelemetry/auto/Constants.java
  159. +4 −8 ...ters/auto/src/main/java/com/google/cloud/opentelemetry/auto/GoogleCloudMetricExporterFactory.java
  160. +2 −7 exporters/auto/src/main/java/com/google/cloud/opentelemetry/auto/GoogleCloudSpanExporterFactory.java
  161. +21 −11 exporters/metrics/README.md
  162. +8 −3 exporters/metrics/build.gradle
  163. +0 −1 exporters/metrics/gradle.properties
  164. +131 −46 .../src/main/java/com/google/cloud/opentelemetry/metric/AggregateByLabelMetricTimeSeriesBuilder.java
  165. +25 −1 exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/CloudMetricClient.java
  166. +8 −2 exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/CloudMetricClientImpl.java
  167. +107 −0 exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/GoogleCloudMetricExporter.java
  168. +128 −98 ...in/java/com/google/cloud/opentelemetry/metric/{MetricExporter.java → InternalMetricExporter.java}
  169. +268 −23 exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/MetricConfiguration.java
  170. +8 −3 exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/MetricDescriptorStrategy.java
  171. +2 −2 exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/MetricTimeSeriesBuilder.java
  172. +91 −108 exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/MetricTranslator.java
  173. +47 −0 exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/MetricWithLabels.java
  174. +59 −0 ...ers/metrics/src/main/java/com/google/cloud/opentelemetry/metric/MonitoredResourceDescription.java
  175. +47 −0 exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/NoopMetricExporter.java
  176. +66 −2 exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/ResourceTranslator.java
  177. +26 −18 exporters/metrics/src/test/java/com/google/cloud/opentelemetry/metric/EndToEndTest.java
  178. +51 −2 exporters/metrics/src/test/java/com/google/cloud/opentelemetry/metric/FakeData.java
  179. +886 −0 ...rs/metrics/src/test/java/com/google/cloud/opentelemetry/metric/GoogleCloudMetricExporterTest.java
  180. +61 −10 exporters/metrics/src/test/java/com/google/cloud/opentelemetry/metric/MetricConfigurationTest.java
  181. +1 −1 ...ers/metrics/src/test/java/com/google/cloud/opentelemetry/metric/MetricDescriptorStrategyTest.java
  182. +0 −324 exporters/metrics/src/test/java/com/google/cloud/opentelemetry/metric/MetricExporterTest.java
  183. +71 −20 exporters/metrics/src/test/java/com/google/cloud/opentelemetry/metric/MetricTranslatorTest.java
  184. +0 −65 exporters/metrics/src/test/java/com/google/cloud/opentelemetry/metric/MockCloudMetricClient.java
  185. +1 −1 ...rters/metrics/src/test/java/com/google/cloud/opentelemetry/metric/MockServerStartupException.java
  186. +19 −8 exporters/trace/README.md
  187. +9 −3 exporters/trace/build.gradle
  188. +1 −1 exporters/trace/src/main/java/com/google/cloud/opentelemetry/trace/CloudTraceClient.java
  189. +1 −1 exporters/trace/src/main/java/com/google/cloud/opentelemetry/trace/CloudTraceClientImpl.java
  190. +149 −0 exporters/trace/src/main/java/com/google/cloud/opentelemetry/trace/InternalTraceExporter.java
  191. +61 −0 exporters/trace/src/main/java/com/google/cloud/opentelemetry/trace/NoopSpanExporter.java
  192. +60 −16 exporters/trace/src/main/java/com/google/cloud/opentelemetry/trace/TraceConfiguration.java
  193. +57 −97 exporters/trace/src/main/java/com/google/cloud/opentelemetry/trace/TraceExporter.java
  194. +2 −2 exporters/trace/src/main/java/com/google/cloud/opentelemetry/trace/TraceTranslator.java
  195. +2 −4 exporters/trace/src/main/java/com/google/cloud/opentelemetry/trace/TraceVersions.java
  196. +26 −27 exporters/trace/src/test/java/com/google/cloud/opentelemetry/trace/EndToEndTest.java
  197. +1 −1 exporters/trace/src/test/java/com/google/cloud/opentelemetry/trace/MockCloudTraceClient.java
  198. +1 −1 exporters/trace/src/test/java/com/google/cloud/opentelemetry/trace/MockServerStartupException.java
  199. +35 −17 exporters/trace/src/test/java/com/google/cloud/opentelemetry/trace/TraceConfigurationTest.java
  200. +114 −8 exporters/trace/src/test/java/com/google/cloud/opentelemetry/trace/TraceExporterTest.java
  201. +2 −2 exporters/trace/src/test/java/com/google/cloud/opentelemetry/trace/TraceTranslatorTest.java
  202. +1 −1 exporters/trace/src/test/java/com/google/cloud/opentelemetry/trace/TraceVersionsTest.java
  203. BIN gradle/wrapper/gradle-wrapper.jar
  204. +4 −3 gradle/wrapper/gradle-wrapper.properties
  205. +174 −108 gradlew
  206. +22 −33 gradlew.bat
  207. +6 −2 propagators/gcp/README.md
  208. +4 −3 propagators/gcp/build.gradle
  209. +1 −1 ...a/com/google/cloud/opentelemetry/propagators/OneWayXCloudTraceConfigurablePropagatorProvider.java
  210. +2 −2 ...in/java/com/google/cloud/opentelemetry/propagators/XCloudTraceConfigurablePropagatorProvider.java
  211. +8 −8 ...rs/gcp/src/main/java/com/google/cloud/opentelemetry/propagators/XCloudTraceContextPropagator.java
  212. +4 −3 propagators/gcp/src/test/java/com/google/cloud/opentelemetry/propagators/AutoConfigureTest.java
  213. +17 −1 propagators/gcp/src/test/java/com/google/cloud/opentelemetry/propagators/PropagatorTest.java
  214. +42 −7 settings.gradle
  215. +17 −4 shared/resourcemapping/build.gradle
  216. +1 −1 shared/resourcemapping/src/main/java/com/google/cloud/opentelemetry/resource/GcpResource.java
  217. +1 −1 shared/resourcemapping/src/main/java/com/google/cloud/opentelemetry/resource/ResourceLabels.java
  218. +120 −19 shared/resourcemapping/src/main/java/com/google/cloud/opentelemetry/resource/ResourceTranslator.java
  219. +401 −198 ...resourcemapping/src/test/java/com/google/cloud/opentelemetry/resource/ResourceTranslatorTest.java
16 changes: 16 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Global owners
* @GoogleCloudPlatform/opentelemetry-ops
5 changes: 4 additions & 1 deletion .github/header-checker-lint.yml
Original file line number Diff line number Diff line change
@@ -4,5 +4,8 @@ sourceFileExtensions:
- gradle
- java
- sh
- Dockerfile
allowedCopyrightHolders:
- Google
- Google LLC
ignoreFiles:
- buildscripts/*
File renamed without changes.
49 changes: 49 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "CodeQL Analysis"

on:
workflow_dispatch:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * *'
push:
branches: [ main ]
pull_request:

jobs:
CodeQL-Build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Java 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: java
# using "latest" helps to keep up with the latest Kotlin support
# see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433
tools: latest

- uses: gradle/gradle-build-action@v2
with:
# skipping build cache is needed so that all modules will be analyzed
arguments: assemble --no-build-cache

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
58 changes: 50 additions & 8 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -6,34 +6,76 @@ on:
- main
jobs:
test:
name: Test
strategy:
matrix:
java-version: [11]
build-root: [".", "examples/instrumentation-quickstart"]
include:
- build-root: .
name: root
name: Test (${{matrix.name || matrix.build-root}}, java-${{matrix.java-version}})
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: setup-java-11
name: Setup Java 11
- id: setup-java
name: Setup Java ${{matrix.java-version}}
uses: actions/setup-java@v1
with:
java-version: 11
java-version: ${{matrix.java-version}}
- uses: burrunan/gradle-cache-action@v1.6
with:
job-id: java-${{matrix.java-version}}
remote-build-cache-proxy-enabled: false
build-root-directory: ${{matrix.build-root}}
arguments: test
shadow:
strategy:
matrix:
java-version: [11]
name: Shadow Jar Build (Java ${{matrix.java-version}})
runs-on: ubuntu-latest
steps:
- id: checkout-repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- id: setup-java
name: Setup Java ${{matrix.java-version}}
uses: actions/setup-java@v1
with:
java-version: ${{matrix.java-version}}
- id: setup-gradle-cache
name: Run Gradle Build with ShadowJar
uses: burrunan/gradle-cache-action@v1.6
with:
job-id: gradle-shadow-java-${{matrix.java-version}}
remote-build-cache-proxy-enabled: false
build-root-directory: .
arguments: shadowJar
style:
name: Stylecheck
name: Stylecheck (${{matrix.name || matrix.build-root}})
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [11]
build-root: [".", "examples/instrumentation-quickstart"]
include:
- build-root: .
name: root
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: setup-java-11
name: Setup Java 11
- id: setup-java
name: Setup Java ${{matrix.java-version}}
uses: actions/setup-java@v1
with:
java-version: 11
java-version: ${{matrix.java-version}}
- uses: burrunan/gradle-cache-action@v1.6
with:
job-id: java-${{matrix.java-version}}
remote-build-cache-proxy-enabled: false
build-root-directory: ${{matrix.build-root}}
arguments: spotlessCheck
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -4,9 +4,19 @@

Provides OpenTelemetry Exporters for Google Cloud Operations.

To get started with instrumentation in Google Cloud, see [Generate traces and metrics with
Java](https://cloud.google.com/stackdriver/docs/instrumentation/setup/java).

To learn more about instrumentation and observability, including opinionated recommendations
for Google Cloud Observability, visit [Instrumentation and
observability](https://cloud.google.com/stackdriver/docs/instrumentation/overview).

## Building

This project requires a mock server for Google Cloud APIs. To build and test, do the following:
> [!IMPORTANT]
> This project requires Java 11 to build and test. All artifacts published from this project support Java 8 or higher, unless otherwise noted.
This project requires a mock server for Google Cloud APIs. To build and test, do the following:

```
$ ./gradlew test
@@ -36,8 +46,6 @@ See [Tracing Readme](exporters/trace/README.md) for installation and usage instr

## Google Cloud Monitoring Exporter

*Note: This is an alpha-release.*

See [Metrics Readme](exporters/metrics/README.md) for installation and usage instructions.

## Google Cloud Autoconfigure module
@@ -47,5 +55,5 @@ See [Metrics Readme](exporters/metrics/README.md) for installation and usage ins
See [Autoconfigure Readme](exporters/auto/README.md) for installation and usage instructions.


[maven-image]: https://maven-badges.herokuapp.com/maven-central/com.google.cloud.opentelemetry/exporter-trace/badge.svg
[maven-url]: https://maven-badges.herokuapp.com/maven-central/com.google.cloud.opentelemetry/exporter-trace
[maven-image]: https://img.shields.io/maven-central/v/com.google.cloud.opentelemetry/exporter-trace?color=dark-green
[maven-url]: https://central.sonatype.com/artifact/com.google.cloud.opentelemetry/exporter-trace
52 changes: 40 additions & 12 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# How to Create a Release of OpenTelemetry Operations Java (for Maintainers Only)

## Build Environments

The system used for build and deploy must be able to run the [mock
server](https://github.com/googleinterns/cloud-operations-api-mock).

## Prerequisites

### Setup OSSRH and Signing
@@ -43,20 +38,32 @@ your OSSRH (OSS Repository Hosting) account and signing keys.
checkstyle.ignoreFailures=false
```
> [!TIP]
> If your key-generation is failing, checkout the [help section](#help-timeout-during-key-generation-process) at the bottom of this document.
### Using GPG-Agent for artifact signing
> [!NOTE]
> These instructions are for modern linux where `gpg` refers to the 2.0 version.
If you're running in linux and would like to use the GPG agent to remember your PGP key passwords instead of keeping them in a plain-text file on your home directory,
you can configure the following in `<your-home-directory>/.gradle/gradle.properties`:
```text
ossrhUsername=<generated-token-user>
ossrhPassword=<generated-token-key>
signingUseGpgCmd=true
signing.gnupg.executable=gpg
signing.gnupg.keyName=<secret key id (large hash)>
signing.secretKeyRingFile=<your-home-directory>/.gnupg/pubring.kbx
```
Note: You can retrieve the list of previously created GPG keys on your machine by using `gpg --list-secret-keys`.
Note: these instructions are for modern linux where `gpg` refers to the 2.0 version.
> [!IMPORTANT]
> Starting June 2024, due to a change to the OSSRH authentication backend, the maven publish plugin now requires [a user token](https://central.sonatype.org/publish/generate-token/) instead of a typical username and password used in the Nexus UI.
> Follow the steps in the [link](https://central.sonatype.org/publish/generate-token/) to generate a user token, if not done already - this will provide you with a `tokenuser` and `tokenkey`. Replace `<generated-token-user>` and `<generated-token-key>` with the generated `tokenuser` and `tokenkey` in your `gradle.properties` file to successfully publish artifacts.
### Ensuring you can push tags to Github upstream
### Ensuring you can push tags to GitHub upstream
Before any push to the upstream repository you need to create a [personal access
token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/).
@@ -70,7 +77,7 @@ If you've followed the above steps, you can release snapshots for consumption us
$ ./gradlew snapshot
```

## Releasing a Candidate
## Releasing a Candidate (Optional)

After following the above steps, you can release candidates from `main` or `v<major>.<minor>.x` branches.

@@ -102,7 +109,10 @@ $ ./gradlew candidate -Prelease.version=0.14.0
$ git push origin v0.14.0
```

Next follow [Releasing on Maven Central](#releasing-on-maven-central) to close + publish the
*Note: If you do not have a CredentialsProvider registered for GitHub, the `candidate` task may fail to upload tags to the GitHub repository and the overall command may take a long time to report completion on the task. In this case, before moving forward - check if tags were pushed to GitHub. If not, manually push the tags before continuing.*\
*Next, check if the staging repository is created on the [nexus repository manager](https://oss.sonatype.org/#stagingRepositories). If the repository is already created, continue with the next steps.*

Follow [Releasing on Maven Central](#releasing-on-maven-central) to close + publish the
[repository on OSSRH](https://oss.sonatype.org/#stagingRepositories).

After this, follow the [Announcment](#Announcement) documentation to advertise the release and update README files.
@@ -132,14 +142,24 @@ site](http://central.sonatype.org/pages/releasing-the-deployment.html).

Note: This can/will be automated in the future.

### Things to check before 'closing' on Maven Central

Before closing the staging repository, it is important to verify that the contents of all the
published modules are looking good. Particularly, the version numbers should be what are expected,
and they include any custom release qualifiers (like 'alpha') which are set. Make sure that:
- The generated POM files for the individual module have the correct version number.
- The dependencies for an individual module in the POM file are the expected ones & they dependencies have the correct versions.
- The module content includes all the artifacts that are expected to be published - for instance, sourcesJar, javadocs, additional variants like a shaded JAR in some cases, etc.
- The file sizes for the published artifacts should seem reasonable.

## Announcement

Once deployment finishes, go to Github [release
Once deployment finishes, go to GitHub [release
page](https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/releases),
press `Draft a new release` to write release notes about the new release.

You can use `git log upstream/v$MAJOR.$((MINOR-1)).x..upstream/v$MAJOR.$MINOR.x
--graph --first-parent` or the Github [compare
--graph --first-parent` or the GitHub [compare
tool](https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/compare/)
to view a summary of all commits since last release as a reference.

@@ -155,3 +175,11 @@ command:
$ COMMIT=1224f0a # Set the right commit hash.
$ git cherry-pick -x $COMMIT
```

### Help: Timeout during key-generation process
If you see timeout errors when you run `gpg --gen-key` to generate your keys, it maybe because you are running the command on a server and do not have access to a UI.
A common example is - running this command on a remote machine over ssh.

The issue here is that this command opens up a UI dialog asking for you to set a passphrase, waiting for input for a fixed time.

The easiest way to fix this is to run it on a machine for which you have UI access.
14 changes: 14 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Security Policy

## Supported Versions

We support only the last minor version of each supported major release: bug fixes are released either as part of the next minor version or as an on-demand patch version. Independent of which version is next, all patch versions are cumulative, meaning that they represent the state of our main branch at the moment of the release. For instance, if the latest version is 0.10.0, bug fixes are released either as part of 0.11.0 or 0.10.1.

Major releases are supported for 12 months after a new major version is released: https://opensource.google/documentation/policies/library-breaking-change.

Security fixes are given priority and might be enough to cause a new version to be released.

## Reporting a Vulnerability

In order for the vulnerability reports to reach maintainers as soon as possible, please use the `Report a vulnerability` button on the `Security` tab in the respective GitHub repository. It creates a private communication channel between the reporter and the maintainers.

Loading