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

Change default value for OTEL_EXPORTER_JAEGER_AGENT_PORT #1812

Merged
merged 4 commits into from
Aug 25, 2021
Merged

Change default value for OTEL_EXPORTER_JAEGER_AGENT_PORT #1812

merged 4 commits into from
Aug 25, 2021

Conversation

bastianeicher
Copy link
Contributor

jaeger-agent accepts traces on two different ports:

  • 6831 for the "normal" format used by most Jaeger clients
  • 6832 for a Node.js-only format

(see docs)

I believe the default value for OTEL_EXPORTER_JAEGER_AGENT_PORT should therefore be 6831 and not 6832.

@carlosalberto
Copy link
Contributor

Overall fine but I'm wondering as this is a breaking change, and may be hence breaking people's existing deployments. Any opinion about that?

@bastianeicher
Copy link
Contributor Author

opentelemetry-java does not use OTEL_EXPORTER_JAEGER_AGENT_PORT and specifies no default Jaeger agent port.

opentelemetry-dotnet does not use OTEL_EXPORTER_JAEGER_AGENT_PORT and already defaults to 6831.

opentelemetry-go does use OTEL_EXPORTER_JAEGER_AGENT_PORT and currently defaults to 6832.
However, I'm pretty sure almost everyone using opentelemetry-go with Jaeger will have done so by setting OTEL_EXPORTER_JAEGER_AGENT_PORT=6831 rather than reconfiguring jaeger-agent to swap port numbers.

@dyladan
Copy link
Member

dyladan commented Jul 12, 2021

So should JS continue to use 6832? This is what jaeger's client library does.

@carlosalberto
Copy link
Contributor

So should JS continue to use 6832? This is what jaeger's client library does.

Great question. @yurishkuro any opinion on this?

@yurishkuro
Copy link
Member

The reason Jaeger JS SDK used a different port compared to all other SDKs is because there was no support for compact encoding in the JS version of Thrift library that we used (only binary encoding was available).

What Thrift library does the JS Jaeger exporter use?

If it can produce compact encoding, then it can use the same default port. If it can only produce binary encoding, it must use a different default port 6832 (fwiw if anyone's interested to help out, we have a ticket and some investigation into auto-recognizing the payload format on the backend so that both ports could be used jaegertracing/jaeger#1596).

@dyladan
Copy link
Member

dyladan commented Jul 12, 2021

We are using the jaeger library directly which uses thriftrw.

From the thriftrw README:

The scope of this project may eventually cover alternate Thrift binary encodings including the compact binary protocol.

So no, it does not currently support the compact encoding.

@yurishkuro
Copy link
Member

Then JS needs to use a different default port from the rest of the SDKs. I am fairly confident we cannot expect new features in thriftrw.

We can change the spec to be explicit:

  • if SDK supports compact thrift, then default to 6831
  • if SDK only supports binary thrift, then default to 6832

@carlosalberto
Copy link
Contributor

Do other Jaeger transports (e.g. grpc) allow specifying port?

@carlosalberto
Copy link
Contributor

Hey @bastianeicher, would you mind updating this PR according to @yurishkuro's suggestion?

@bastianeicher
Copy link
Contributor Author

Maybe it would be better to use a different environment variable name to specify the binary thrift port?

E.g., opentelemetry-js could use OTEL_EXPORTER_JAEGER_AGENT_BINARY_PORT while all other otel SDKs stick with the existing OTEL_EXPORTER_JAEGER_AGENT_PORT.

Having the same environment variable use different default values and have different meanings in different SDKs seems risky to me. Maybe someone wants to set OTEL_EXPORTER_JAEGER_AGENT_PORT for all processes in their environment, without caring about which language they are written in.

@bastianeicher
Copy link
Contributor Author

I've updated the PR with my suggested two env var solution, plus links to the relevant Jaeger docs.

|----------------------------------------|------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
| OTEL_EXPORTER_JAEGER_AGENT_HOST | Hostname for the Jaeger agent | "localhost" |
| OTEL_EXPORTER_JAEGER_AGENT_PORT | Port for the Jaeger agent `compact` Thrift protocol (used by most clients) | 6831 |
| OTEL_EXPORTER_JAEGER_AGENT_BINARY_PORT | Port for the Jaeger agent `binary` Thrift protocol (used by Node.js clients) | 6832 |
Copy link
Member

Choose a reason for hiding this comment

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

I would rather say that JS has a different default than introduce an extra one-off var.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm worried about a scenario like this:

Somebody has set up their Jaeger agents to listen on non-default ports like 1234 for compact and 1235 for binary.
(This may not be a very common thing, but without non-default ports there's no need for the env vars anyway.)

Now they read the otel docs and discovers OTEL_EXPORTER_JAEGER_AGENT_PORT. They decide to set this environment variable for their entire environment. E.g., for all processes on a VM or as a default in a shared Docker base image or Helm chart.

Now, there is no way for them to pick the "correct" value for the variable, because it needs to be either 1234 or 1235 based on which otel SDK the various processes are using. While it's of course possible to set process-specific values, imho this seems to run counter to the spirit of environment variables.

Copy link
Member

@pellared pellared Jul 26, 2021

Choose a reason for hiding this comment

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

Go also uses the binary format: https://github.com/open-telemetry/opentelemetry-go/tree/main/exporters/jaeger . Those it mean that it should use compact format instead?

FYI @MrAlias @Aneurysm9

Copy link
Contributor Author

Choose a reason for hiding this comment

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

opentelemetry-go already uses the compact format:
https://github.com/open-telemetry/opentelemetry-go/blob/3be9813d56ff53aede1f2c77c54fd5bd3e53dcc7/exporters/jaeger/agent.go#L79

I believe it's just a bug-in-docs that the readme says "binary thrift protocol".

Copy link
Member

@pellared pellared Jul 26, 2021

Choose a reason for hiding this comment

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

Copy link
Member

@arminru arminru Aug 11, 2021

Choose a reason for hiding this comment

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

@bastianeicher Would you be fine with @MrAlias suggestion to carve it out from this PR to discuss it (adding a separate env var or making the default conditional) separately? Then we should be good to merge the rest right away.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MrAlias, @arminru I've changed the PR back to its original scope of only changing the default value for OTEL_EXPORTER_JAEGER_AGENT_PORT, as you suggested.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, Bastian!
Will you file a follow-up PR or should we ask the @open-telemetry/javascript-maintainers to take care of that?

Copy link
Member

Choose a reason for hiding this comment

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

Hello, js maintainer here. Is the suggested action item for JS to introduce OTEL_EXPORTER_JAEGER_AGENT_BINARY_PORT or for JS to simply have a different default value for OTEL_EXPORTER_JAEGER_AGENT_PORT?

Copy link
Member

Choose a reason for hiding this comment

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

@dyladan I'll merge the PR for now since this part is quite clear, let's discuss the way to go for JS in a follow-up issue or PR.

@github-actions
Copy link

github-actions bot commented Aug 3, 2021

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 3, 2021
@MrAlias MrAlias removed the Stale label Aug 3, 2021
@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 11, 2021
CHANGELOG.md Outdated Show resolved Hide resolved
@MrAlias MrAlias removed the Stale label Aug 11, 2021
@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 25, 2021
@arminru arminru enabled auto-merge (squash) August 25, 2021 08:30
@arminru arminru merged commit 96bb7da into open-telemetry:main Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet