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

Update instrument-java-application.rst #1596

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dmitchsplunk
Copy link
Contributor

Requirements

  • [ X ] Content follows Splunk guidelines for style and formatting.
  • [ X ] You are contributing original content.

Describe the change

The Java 2.x agent uses http as the default protocol (vs. grpc for the 1.x agent). To send traces directly to o11y cloud with the Java 2.x agent, we need to set the OTEL_EXPORTER_OTLP_TRACES_PROTOCOL environment variable to 'grpc'. Otherwise, the export fails with the following error:

[otel.javaagent 2024-11-08 17:07:02:915 -0500] [OkHttp https://ingest.us1.signalfx.com/...] WARN io.opentelemetry.exporter.internal.http.HttpExporter - Failed to export spans. Server responded with HTTP status code 404.

This setting was tested as part of this discussion on Slack.

To send data directly from the Java 2.x agent to o11y cloud, we need to set OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc.
@dmitchsplunk dmitchsplunk requested a review from a team as a code owner November 12, 2024 16:08
@bhillmer bhillmer added the stop-alert Stops Slack notification in #o11y-docs-feedback so that PR can be worked wo unnecessary noise label Nov 12, 2024
Copy link
Contributor

@breedx-splk breedx-splk left a comment

Choose a reason for hiding this comment

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

Can we continue defaulting to http/protobuf instead please? It's the recommended default from otel and we should try and be consistent with it. Prefer to set the endpoint instead....

Use http/protobuf instead of grpc when sending traces directly to o11y cloud.  Also, disable log export when sending directly to o11y cloud to avoid errors.
@dmitchsplunk
Copy link
Contributor Author

Thanks @breedx-splk . I've updated it to align with the Python example which uses the http/protobuf endpoint.

I suppose setting the protocol isn't strictly necessary for Java 2.x, since http/protobuf is the default now. I'd prefer to set it explicitly though, so it's clear.

I also set OTEL_LOGS_EXPORTER=none to avoid log exporter errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external stop-alert Stops Slack notification in #o11y-docs-feedback so that PR can be worked wo unnecessary noise
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants