Skip to content

exporter/zipkin: adding support for env var OTEL_EXPORTER_ZIPKIN_ENDPOINT#1064

Merged
codeboten merged 8 commits intoopen-telemetry:masterfrom
codeboten:zipkin-env-var
Sep 9, 2020
Merged

exporter/zipkin: adding support for env var OTEL_EXPORTER_ZIPKIN_ENDPOINT#1064
codeboten merged 8 commits intoopen-telemetry:masterfrom
codeboten:zipkin-env-var

Conversation

@codeboten
Copy link
Copy Markdown
Contributor

Description

As per spec, adding support for env var:OTEL_EXPORTER_ZIPKIN_ENDPOINT

Fixes #1055

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added

@codeboten codeboten requested a review from a team September 2, 2020 04:14
Copy link
Copy Markdown
Contributor

@ffe4 ffe4 left a comment

Choose a reason for hiding this comment

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

LGTM but shouldn't we also mention the environment variable in the documentation?

)
self.url = os.environ.get("OTEL_EXPORTER_ZIPKIN_ENDPOINT", DEFAULT_URL)

url = "{}://{}:{}{}".format(protocol, host_name, port, endpoint)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think default value for protocol should be https. We can have a special case to use http as a default when endpoint == DEFAULT_ENDPOINT.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm kinda wondering if the configuration parameters should just be a URL instead of protocol/host/port/endpoint. Looking at the other implementations, it looks like that is how they've implemented it. This would also simplify supporting that env variable.

JS

https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-exporter-zipkin/src/zipkin.ts#L44

Go

https://github.com/open-telemetry/opentelemetry-go/blob/master/exporters/trace/zipkin/zipkin.go#L37

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

I think that makes sense. My only concern is how users can discover the path part of the URL. If a user knows their zipkin endpoints is available at https://zipkin.corp.com, would they know or remember to add :9411 and /api/v2/spans? Perhaps documenting the default value in zipkin exporter docs would be enough of an indication?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Going with documenting the default value for now.

@codeboten
Copy link
Copy Markdown
Contributor Author

LGTM but shouldn't we also mention the environment variable in the documentation?

Good point, updated the docs

@codeboten codeboten added the release:required-for-ga To be resolved before GA release label Sep 3, 2020
@codeboten codeboten merged commit 370cc6b into open-telemetry:master Sep 9, 2020
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this pull request Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:required-for-ga To be resolved before GA release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support env variables for Zipkin exporter

5 participants