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

support zipkin exporter endpoint env #2490

Merged
merged 6 commits into from
Jan 6, 2022

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Jan 1, 2022

Signed-off-by: Ben Ye ben.ye@bytedance.com

Fixes #2309.

This pr adds support of reading env OTEL_EXPORTER_ZIPKIN_ENDPOINT to specify zipkin endpoint. If empty collector endpoint is provided, then the default collector address will be used mentioned in https://github.com/open-telemetry/opentelemetry-specification/blob/v1.0.1/specification/sdk-environment-variables.md#zipkin-exporter

exporters/zipkin/zipkin.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 3, 2022

Codecov Report

Merging #2490 (9a301f9) into main (11ce2dd) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2490   +/-   ##
=====================================
  Coverage   76.3%   76.3%           
=====================================
  Files        173     174    +1     
  Lines      12022   12027    +5     
=====================================
+ Hits        9177    9184    +7     
+ Misses      2600    2598    -2     
  Partials     245     245           
Impacted Files Coverage Δ
exporters/zipkin/env.go 100.0% <100.0%> (ø)
exporters/zipkin/zipkin.go 72.8% <100.0%> (ø)
sdk/trace/batch_span_processor.go 85.4% <0.0%> (+1.0%) ⬆️

Ben Ye added 3 commits January 4, 2022 17:12
Signed-off-by: Ben Ye <ben.ye@bytedance.com>
Signed-off-by: Ben Ye <ben.ye@bytedance.com>
Signed-off-by: Ben Ye <ben.ye@bytedance.com>
@yeya24 yeya24 force-pushed the support-zipkin-env branch from e03065e to ea9e3f6 Compare January 5, 2022 01:13
@yeya24
Copy link
Contributor Author

yeya24 commented Jan 5, 2022

Just fix the conflict on the changelog. Is it good to merge now?

@Aneurysm9
Copy link
Member

Please fix the lint issue, then this should be ready to merge.

Ben Ye added 2 commits January 4, 2022 19:25
Signed-off-by: Ben Ye <ben.ye@bytedance.com>
Signed-off-by: Ben Ye <ben.ye@bytedance.com>
@MrAlias MrAlias merged commit 1e4a609 into open-telemetry:main Jan 6, 2022
@yeya24 yeya24 deleted the support-zipkin-env branch January 7, 2022 07:33
@@ -79,7 +81,8 @@ func WithClient(client *http.Client) Option {
// New creates a new Zipkin exporter.
func New(collectorURL string, opts ...Option) (*Exporter, error) {
if collectorURL == "" {
return nil, errors.New("collector URL cannot be empty")
// Use endpoint from env var or default collector URL.
collectorURL = envOr(envEndpoint, defaultCollectorURL)
Copy link
Contributor

@jcchavezs jcchavezs Jan 7, 2022

Choose a reason for hiding this comment

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

If we are overriding this, shall we add a info log explaining where this value comes from?

@MrAlias MrAlias mentioned this pull request Feb 10, 2022
@pellared pellared added this to the untracked milestone Nov 8, 2024
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.

Support the OTEL_EXPORTER_ZIPKIN_ENDPOINT environment variable
7 participants