Add AlwaysRecordSampler#7877
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7877 +/- ##
=========================================
Coverage 90.15% 90.15%
- Complexity 7476 7481 +5
=========================================
Files 836 837 +1
Lines 22551 22567 +16
Branches 2224 2225 +1
=========================================
+ Hits 20330 20346 +16
Misses 1517 1517
Partials 704 704 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Ready for review! |
| // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package io.opentelemetry.sdk.trace.internal; |
There was a problem hiding this comment.
Is this the correct package? How are you planning for this to be consumed by users if it's internal?
There was a problem hiding this comment.
Experimental SDK components is the place we've been least consistent about in terms of packaging, since sometimes the concept needs to be bundled into the SDK internals to work (i.e. ExceptionAttributeResolver). But for components which are SDK extension plugin interfaces (span processor, sampler, etc), we've been keeping them in opentelemetry-sdk-extension-incubator. Here's the relevant package for samplers: https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/trace/samplers
There was a problem hiding this comment.
Moved the code to the incubator package
sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/AlwaysRecordSampler.java
Outdated
Show resolved
Hide resolved
...st/java/io/opentelemetry/sdk/extension/incubator/trace/samplers/AlwaysRecordSamplerTest.java
Show resolved
Hide resolved
sdk/trace/src/main/java/io/opentelemetry/sdk/trace/internal/AlwaysRecordSampler.java
Outdated
Show resolved
Hide resolved
sdk/trace/src/test/java/io/opentelemetry/sdk/trace/internal/AlwaysRecordSamplerTest.java
Outdated
Show resolved
Hide resolved
sdk/trace/src/test/java/io/opentelemetry/sdk/trace/internal/AlwaysRecordSamplerTest.java
Outdated
Show resolved
Hide resolved
jack-berg
left a comment
There was a problem hiding this comment.
Couple small things that need adjusting. Thanks for working on this!
|
bump @majanjua-amzn in case you can circle back to this now in the new year. 😉 Thanks again! |
7d9e351 to
3dd5a79
Compare
|
Ready for review again! Apologies for the delay, cc @jack-berg since you marked it as requested change, thanks in advance |
|
Thank you for your contribution @majanjua-amzn! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
Background
Spec issue: open-telemetry/opentelemetry-specification#4698
Spec PR: open-telemetry/opentelemetry-specification#4699
Adding built in access to the RECORD_ONLY flag for sampling to allow for users to process spans without exporting them.
Changes
Testing
Added unit tests,
./gradlew spotlessApply && ./gradlew build && ./gradlew checkas per CONTRIBUTING.md guide