Skip to content
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

Merged

Conversation

thisthat
Copy link
Member

@thisthat thisthat commented May 4, 2020

This addresses #996

Copy link
Contributor

@jkwatson jkwatson left a 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?

.readSystemProperties() // Read configuration from system properties
.setExportIntervalMillis(100_000)
.setMetricExporter(metricExporter)
.setMetricProducers(Collections.singletonList(producers))
Copy link
Member

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

Copy link
Member

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.

Copy link
Contributor

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?

Copy link
Member

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)

Copy link
Contributor

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?

Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #1194 to not forget about the suggestion from @trask

@bogdandrutu
Copy link
Member

@thisthat Can you create an issue to clean up the javadoc-only override methods, and unify the documentation for each of the configurations?

@jkwatson are you referring to this #1181 ?

@jkwatson
Copy link
Contributor

jkwatson commented May 7, 2020

@thisthat Can you create an issue to clean up the javadoc-only override methods, and unify the documentation for each of the configurations?

@jkwatson are you referring to this #1181 ?

Yep. looks like that's the one.

@thisthat
Copy link
Member Author

thisthat commented May 8, 2020

@thisthat Can you create an issue to clean up the javadoc-only override methods, and unify the documentation for each of the configurations?

@jkwatson are you referring to this #1181 ?

Yep. looks like that's the one.

Sorry, I forgot to comment after I created it 😅

@codecov-io
Copy link

Codecov Report

Merging #1168 into master will decrease coverage by 0.47%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ Complexity Δ
...lemetry/exporters/otlp/OtlpGrpcMetricExporter.java 64.10% <0.00%> (-19.24%) 6.00 <0.00> (ø)
...telemetry/exporters/otlp/OtlpGrpcSpanExporter.java 61.53% <0.00%> (-18.47%) 5.00 <0.00> (ø)
...metry/sdk/metrics/export/IntervalMetricReader.java 75.92% <0.00%> (-15.19%) 3.00 <0.00> (ø)
...elemetry/sdk/trace/export/BatchSpansProcessor.java 94.03% <0.00%> (+1.32%) 9.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b323adf...436af1c. Read the comment docs.

@bogdandrutu bogdandrutu merged commit fc91123 into open-telemetry:master May 10, 2020
jkwatson pushed a commit to newrelic-forks/opentelemetry-java that referenced this pull request May 18, 2020
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants