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

Move java sdk configuration documentation into docs site #4377

Merged
merged 16 commits into from
Jun 1, 2024

Conversation

jaydeluca
Copy link
Contributor

@jaydeluca jaydeluca commented Apr 27, 2024

Contributes to:

Notes:

  • Instead of listing both the system properties and environment variables, I just added the system properties and included an info section on how to convert them to environment variables. I chose system properties because the conversion from system property -> env var is more straight forward than the other way around

Preview: https://deploy-preview-4377--opentelemetry.netlify.app/docs/languages/java/automatic/configuration/#resources

@jaydeluca jaydeluca requested review from a team as code owners April 27, 2024 17:48
Copy link
Member

@theletterf theletterf left a comment

Choose a reason for hiding this comment

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

Great work! First pass review follows.

content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
@theletterf
Copy link
Member

@open-telemetry/java-instrumentation-maintainers PTAL

@svrnm svrnm added the sig-approval-missing Co-owning SIG didn't provide an approval label Apr 30, 2024
Copy link
Contributor

@chalin chalin left a comment

Choose a reason for hiding this comment

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

One minor drive-by comment regarding use of a "real" (bidirectionally linked) footnote.

@jaydeluca
Copy link
Contributor Author

One minor drive-by comment regarding use of a "real" (bidirectionally linked) footnote.

@chalin I looked around for a pattern to follow for footnotes to ensure consistency and landed on mirroring the Next Steps sections from other pages. If this is not what you were suggesting, please let me know. If this is what you meant, then I can followup with a similar PR to the SDK repo to add a link to the doc site as well.

@svrnm
Copy link
Member

svrnm commented May 13, 2024

@open-telemetry/java-approvers @open-telemetry/java-instrumentation-approvers PTAL!

@chalin
Copy link
Contributor

chalin commented May 13, 2024

Hi @jaydeluca - I've edited the opening comment to indicate that this PR contributes to #4032. We should only close #4032 once the corresponding pieces are removed from that file (I don't know if the entire file is covered here and will therefore be removed, or have a link added to this page). WDYT?

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

I'm on board with this, but would like to see us describe these env vars in a way that makes it clear that they can be used outside the otel java agent. I'd also like to see us bring everything over so we can delete https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md and have a single source of truth.

@jkwatson WDYT? If merged, we'll need to make sure we add notes to the contributors guide to indicate that any new env vars / system properties need to be updated here.

content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
content/en/docs/languages/java/automatic/configuration.md Outdated Show resolved Hide resolved
…nfigs into single entries, other format updates and review comments
Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

I know these were just copy / pasted from the java directory, but seeing them prompted me to review and leave a few comments. I think all the comments are important, but don't necessarily need to be addressed in this PR. I'll defer to the maintainers on if they have any preference of fixing now or in a followup.

Comment on lines +24 to +25
For example `otel.instrumentation.common.default-enabled` would convert to
`OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED`.
Copy link
Member

@jack-berg jack-berg May 31, 2024

Choose a reason for hiding this comment

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

Let's use a concrete example from below here:

Suggested change
For example `otel.instrumentation.common.default-enabled` would convert to
`OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED`.
For example `otel.sdk.enabled` would convert to
`OTEL_SDK_ENABLED`.


## General

The autoconfigure module registers Java shutdown hooks to shut down the SDK when
Copy link
Member

Choose a reason for hiding this comment

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

Let's link to or provide some context on what the autoconfigure module actually is. We have to assume the reader doesn't know what the autoconfigure module is when they land on this page. Maybe a link to this: http://localhost:1313/docs/languages/java/instrumentation/#automatic-configuration

And that section should probably link back to this page for a full list of all options.

Signal specific configurations take priority over the generic versions.

For example, if you set both `otel.exporter.otlp.endpoint` and
`otel.exporter.otlp.traces.endpoint`, the latter will take precedence.
Copy link
Member

Choose a reason for hiding this comment

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

Should we just include this text about priority inside the "Signal configuration" alert?


Exporters which adhere to
`otel.java.experimental.exporter.memory_mode=reusable_data` are
`OtlpGrpcMetricExporter`, `OtlpHttpMetricExporter`, and `PrometheusHttpServer`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`OtlpGrpcMetricExporter`, `OtlpHttpMetricExporter`, and `PrometheusHttpServer`.
`OtlpGrpc{Signal}Exporter`, `OtlpHttp{Signal}Exporter`, and `PrometheusHttpServer`.

All the OTLP exporters now adhere to it.


[^2]:

OpenTelemetry Java agent 2.x uses `http/protobuf` by default.
Copy link
Member

Choose a reason for hiding this comment

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

I think something is funky with the footnote display. When I run locally, clicking on the 2 footnote brings me to the bottom of the page.

Comment on lines +126 to +127
The policy has the following configuration, which there is currently no way to
customize:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The policy has the following configuration, which there is currently no way to
customize:
The policy has the following configuration, which is can only be customized via programmatic configuration (see [customizing the OpenTelemetry SDK](#customizing-the-opentelemetry-sdk)):

Comment on lines +175 to +179
You almost always want to specify the
[`service.name`](/docs/specs/semconv/resource/#service) for your application. It
corresponds to how you describe the application, for example `authservice` could
be an application that authenticates requests. If not specified, SDK defaults
the service name to `unknown_service:java`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
You almost always want to specify the
[`service.name`](/docs/specs/semconv/resource/#service) for your application. It
corresponds to how you describe the application, for example `authservice` could
be an application that authenticates requests. If not specified, SDK defaults
the service name to `unknown_service:java`.
You almost always want to specify `otel.service.name` to set the [`service.name`](/docs/specs/semconv/resource/#service) resource attribute, which represents the logical name of your service. If not specified, the SDK sets `service.name=unknown_service:java` by default.

Comment on lines +202 to +204
If you are using the `ResourceProvider` SPI, which many instrumentation agent
distributions include automatically, you can turn on or off one or more of them
by using the following configuration items:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If you are using the `ResourceProvider` SPI, which many instrumentation agent
distributions include automatically, you can turn on or off one or more of them
by using the following configuration items:
Many instrumentation agent distributions automatically various `ResourceProvider` implementations. These can be turned on or off as follows:


Supported values are the following:

| Value | Description |
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a column to this table with the artifact that contains each of these?

  • tracecontext lives in opentelemetry-api
  • baggage lives in opentelemetry-api
  • b3 lives in opentelemetry-extension-trace-propagators
  • b3multi lives in opentelemetry-extension-trace-propagators
  • jaeger lives in opentelemetry-extension-trace-propagators
  • xray lives in io.opentelemetry.contrib:opentelemetry-aws-xray-propagator
  • ottrace lives in opentelemetry-extension-trace-propagators

`OtlpGrpcMetricExporter`, `OtlpHttpMetricExporter`, and `PrometheusHttpServer`.
Support for additional exporters may be added in the future.

#### OTLP exporter (span, metric, and log exporters)
Copy link
Member

Choose a reason for hiding this comment

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

We should mention the artifact coordinates in each place where we describe configuration that requires a particular artifact to be included in order to work.

I think this comes up for each of the exporter sections (otlp, logging, logging-otlp, zipkin, prometheus), and for the propagators.

@jaydeluca
Copy link
Contributor Author

I think all the comments are important, but don't necessarily need to be addressed in this PR. I'll defer to the maintainers on if they have any preference of fixing now or in a followup.

👍 sounds good, thanks for all the feedback and ideas. i'm happy to address them now or in a followup based on the preference of the maintainers

@cartermp cartermp removed the sig-approval-missing Co-owning SIG didn't provide an approval label Jun 1, 2024
@cartermp
Copy link
Contributor

cartermp commented Jun 1, 2024

@jaydeluca if you can file a follow-up issue here to cover some of what @jack-berg mentioned, that'd be great!

@cartermp cartermp merged commit 05a20c1 into open-telemetry:main Jun 1, 2024
15 checks passed
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

6 participants