-
Notifications
You must be signed in to change notification settings - Fork 850
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
Add system/env vars and properties configuration for Metric classes #1168
Add system/env vars and properties configuration for Metric classes #1168
Conversation
exporters/otlp/src/main/java/io/opentelemetry/exporters/otlp/OtlpGrpcMetricExporter.java
Outdated
Show resolved
Hide resolved
exporters/otlp/src/main/java/io/opentelemetry/exporters/otlp/OtlpGrpcMetricExporter.java
Show resolved
Hide resolved
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.
@thisthat Can you create an issue to clean up the javadoc-only override methods, and unify the documentation for each of the configurations?
exporters/otlp/src/main/java/io/opentelemetry/exporters/otlp/OtlpGrpcMetricExporter.java
Outdated
Show resolved
Hide resolved
.readSystemProperties() // Read configuration from system properties | ||
.setExportIntervalMillis(100_000) | ||
.setMetricExporter(metricExporter) | ||
.setMetricProducers(Collections.singletonList(producers)) |
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 expect that everything that is not possible to configure via eng/sysprop to be passed as an argument to a factory method create
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.
This is just a suggestion, please let me know if you think it is better.
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'm not clear on how the suggestion would work. Would the create
method take the builder as a parameter? Would the Builder have a create
method that took the non-env-configurable parameters, rather than having a build()
method?
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 was thinking that Config contains only things that can be configured via env or sysprop everything else is passed as argument to a factory method.
So in this case: create(Config, List<MetricProducer>, MetricExporter)
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.
What class exposes the create
method, though?
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.
Sure thing, @trask does that work for you in auto instrumentation?
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.
Yes, this is looking good @thisthat 👍. Thanks for including readProperties(Properties)
, we will probably use that for something like an opentelemetry-auto.properties
file (in addition to calling readEnvironment
and readSystemProperties
).
Only (very) minor thought is maybe rename readEnvironment
to readEnvironmentVariables
.
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.
Oh, I forgot, what about endpoint configuration for the otlp exporters? Are we waiting for open-telemetry/opentelemetry-specification#172 to be resolved before adding? Just curious. Thanks.
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 was waiting to resolve #996 and then report in open-telemetry/opentelemetry-specification#572 what the Java current implementation uses for the variable names. I don't think open-telemetry/opentelemetry-specification#172 is blocking us since it is a matter of renaming of few constants and updating the documentation in the worst case
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.
Codecov Report
@@ Coverage Diff @@
## master #1168 +/- ##
============================================
- Coverage 85.07% 84.59% -0.48%
Complexity 1166 1166
============================================
Files 147 147
Lines 4362 4389 +27
Branches 404 407 +3
============================================
+ Hits 3711 3713 +2
- Misses 492 518 +26
+ Partials 159 158 -1
Continue to review full report at Codecov.
|
…pen-telemetry#1168) * Add configuration to IntervalMetricReader * Add configuration to OTLP * Add documentation * Fix year copyright * Removing Jaeger from javadoc * 0.4.0 -> 0.5.0
This addresses #996