-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
Codecov Report
@@ 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
|
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>
e03065e
to
ea9e3f6
Compare
Just fix the conflict on the changelog. Is it good to merge now? |
Please fix the lint issue, then this should be ready to merge. |
Signed-off-by: Ben Ye <ben.ye@bytedance.com>
@@ -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) |
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.
If we are overriding this, shall we add a info log explaining where this value comes from?
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