-
Notifications
You must be signed in to change notification settings - Fork 926
Update to opentelemetry-configuration 1.0.0-rc.3 #7861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7861 +/- ##
============================================
- Coverage 90.10% 90.08% -0.02%
- Complexity 7325 7393 +68
============================================
Files 825 829 +4
Lines 22051 22395 +344
Branches 2179 2228 +49
============================================
+ Hits 19868 20174 +306
- Misses 1504 1528 +24
- Partials 679 693 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I also want to add support for open-telemetry/opentelemetry-configuration#376 |
|
Thanks for the pointer @zeitlinger - this PR allows parsing them but doesn't update I'm not sure if we would first do that before updating configuration, or do it together, happy to go with any approach. |
it was deprecated because it had a different meaning
I think it's fine to the change together - happy to help out |
|
Thanks @zeitlinger - IIUC, there is currently no knob for the labels either If the knobs were already there, wiring them into declarative config would be simple, but if we need to add (or restore) new ones, I guess we should use a separate PR since they're for public API? |
correct
I think it doesn't matter if it's public API, because we would document it either way - but a separate PR is also fine |
.../main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/LogRecordExporterFactory.java
Outdated
Show resolved
Hide resolved
...ubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/SamplerFactory.java
Show resolved
Hide resolved
| resource = model.getOtlpHttp(); | ||
| } | ||
| if (model.getOtlpGrpc() != null) { | ||
| requireNullResource(resource, RESOURCE_NAME, model.getAdditionalProperties()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding strictness here to fail fast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was to reproduce the max-1 check from the previous map/compute approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understand the intent: if oitlp_http is present, make sure no other span exporters are set. But the implementation seems not quite right. requireNullResource produces an error message like Invalid configuration - multiple " + resourceName + "s set: " + additionalProperties.keySet().stream().collect(joining(",", "[", "]" based on additional properties, when its model.getOtlpHttp() which is causing the conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old implementation works because I was sort of cheating and moving all the well known exporter model definitions to additionalProperties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed bc11574 which sort of reverts this change but does it without polluting additionalProperties.
Thinking about this, I need to go apply this pattern to SamplerFactory, LgRecordProcessorFactory, SpanProcessorFactory, TextMapPropagatorFactory, AggregationFactory. In all these cases, exactly one key value pair is expected but the implementations tolerate multiple. Will do this in a followup PR.
jack-berg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, looks good! Can't merge it until opentelemetry-configuration cuts a release, but we can use this as a working branch.
.../main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/ComposableSamplerFactory.java
Outdated
Show resolved
Hide resolved
| import java.util.function.Predicate; | ||
| import javax.annotation.Nullable; | ||
|
|
||
| final class ComposableRuleBasedSamplerFactory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anuraaga went ahead and implemented the ExperimentalComposableRuleBasedSampler type.
One thing that caught me by surprise was that you can't say something like WHERE http.request.method = GET AND http.route = /users/:id, since the attribute conditions can only match against a single attribute key. Well, technically you could match against two attribute keys by setting both .attribute_values and .attribute_patterns. WDYT? Am I overestimating how common this type of thing will be?
| } | ||
| return new AttributeMatcher( | ||
| requireNonNull(attributeValuesModel.getKey(), "attribute_values key"), | ||
| IncludeExcludePredicate.createExactMatching(attributeValuesModel.getValues(), null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaning on this IncludeExcludePredicate utility even when attribute_values doesn't have an exclude list because its convenient and already has a toString() implemented, which we declarative config tests rely on.
…y-java into update-fileconfig
|
Anyone other @open-telemetry/java-approvers planning on looking at this? |
not I! |
anuraaga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jack-berg - can't approve my own PR but LGTM
| resource = model.getOtlpHttp(); | ||
| } | ||
| if (model.getOtlpGrpc() != null) { | ||
| requireNullResource(resource, RESOURCE_NAME, model.getAdditionalProperties()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was to reproduce the max-1 check from the previous map/compute approach
I was curious if I can update config to start implementing the composite samplers in file config and little did I realize what I was getting myself into ;) But having started, went ahead and chugged through it. Not sure what the right time for this is so will leave it in draft but let me know whenever we should go forward with it, or also feel free to do an initial review even while draft if desired. /cc @jack-berg