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

Enable zipkin endpoint configuration via environment variable #1924

Conversation

vishweshbankwar
Copy link
Member

@vishweshbankwar vishweshbankwar commented Mar 19, 2021

Fixes #.
#1453

Changes

Please provide a brief description of the changes here.
This PR partially covers #1453
Spec Details
For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Design discussion issue #
  • Changes in public API reviewed

@codecov
Copy link

codecov bot commented Mar 19, 2021

Codecov Report

Merging #1924 (bc32815) into main (4df5121) will increase coverage by 4.46%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1924      +/-   ##
==========================================
+ Coverage   74.63%   79.10%   +4.46%     
==========================================
  Files         217      217              
  Lines        6974     6987      +13     
==========================================
+ Hits         5205     5527     +322     
+ Misses       1769     1460     -309     
Impacted Files Coverage Δ
...Zipkin/Implementation/ZipkinExporterEventSource.cs 63.63% <80.00%> (+13.63%) ⬆️
...Telemetry.Exporter.Zipkin/ZipkinExporterOptions.cs 100.00% <100.00%> (ø)
...DiagnosticSourceInstrumentation/PropertyFetcher.cs 90.62% <0.00%> (+6.25%) ⬆️
src/OpenTelemetry/Sdk.cs 100.00% <0.00%> (+7.14%) ⬆️
...DiagnosticSourceInstrumentation/ListenerHandler.cs 77.77% <0.00%> (+11.11%) ⬆️
...enTelemetry/Metrics/ObjectArrayEqualityComparer.cs 26.66% <0.00%> (+26.66%) ⬆️
...enTelemetry/Metrics/StringArrayEqualityComparer.cs 26.66% <0.00%> (+26.66%) ⬆️
src/OpenTelemetry/Metrics/DataPoint/DataValue.cs 33.33% <0.00%> (+33.33%) ⬆️
...elemetry/Metrics/MeterProviderBuilderExtensions.cs 44.44% <0.00%> (+44.44%) ⬆️
...y/Metrics/MetricAggregators/SumMetricAggregator.cs 79.24% <0.00%> (+79.24%) ⬆️
... and 13 more

@vishweshbankwar vishweshbankwar marked this pull request as ready for review March 19, 2021 19:58
@vishweshbankwar vishweshbankwar requested a review from a team March 19, 2021 19:58
@vishweshbankwar vishweshbankwar marked this pull request as draft March 26, 2021 22:44
@vishweshbankwar vishweshbankwar marked this pull request as ready for review March 26, 2021 22:46
Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Please handle possible Exception from reading Env variable.

Copy link
Contributor

@pjanotti pjanotti left a comment

Choose a reason for hiding this comment

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

@cijothomas @vishweshbankwar this is something that we would like to have for auto-instrumentation. I see that it is not filling up the default in case of error parsing env var Uri (and related test) any other thing holding this change?

Copy link
Contributor

@pjanotti pjanotti left a comment

Choose a reason for hiding this comment

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

LGTM besides a nit for the README - @cijothomas now that 1.1.0 has shipped can we also merge this one?

src/OpenTelemetry.Exporter.Zipkin/README.md Outdated Show resolved Hide resolved
@pjanotti
Copy link
Contributor

@cijothomas Anything still blocking this one?

{
this.Endpoint = new Uri(Environment.GetEnvironmentVariable(ZipkinEndpointEnvVar) ?? DefaultZipkinEndpoint);
}
catch (Exception ex)
Copy link
Member

Choose a reason for hiding this comment

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

minor (may follow up in separate PR):
We can do similar to what Jaeger/OTLP does - catch SecurityException for reading env variable. Handle the Uri parse exception separately. Both should be logged as separate EventSource events.
This avoids catching the generic Exception.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure - will create a separate PR for that.

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.

7 participants