-
Notifications
You must be signed in to change notification settings - Fork 583
Allow and document how users control SE tracing for OpenTelemetry using Helidon config under tracing (and telemetry)
#10791
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
Draft
tjquinno
wants to merge
2
commits into
helidon-io:main
Choose a base branch
from
tjquinno:4.x-otel-tracing-config-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
107 changes: 107 additions & 0 deletions
107
docs/src/main/asciidoc/includes/tracing/tracer-otel.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| /////////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| Copyright (c) 2025 Oracle and/or its affiliates. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
|
|
||
| /////////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| // tag::setup[] | ||
| ifndef::rootdir[:rootdir: {docdir}/../..] | ||
| ifndef::flavor-lc[:flavor-lc: se] | ||
| :feature-name: OpenTelemetry Tracing | ||
| // end::setup[] | ||
|
|
||
| Helidon is integrated with OpenTelemetry and OpenTelemetry tracing. | ||
|
|
||
| include::{rootdir}/includes/dependencies.adoc[] | ||
|
|
||
| // tag::otel-dependency[] | ||
|
|
||
|
|
||
| [source,xml] | ||
| .Dependency for OpenTelemetry support | ||
| ---- | ||
| <dependency> | ||
| <groupId>io.helidon.tracing.providers</groupId> | ||
| <artifactId>helidon-tracing-providers-opentelemetry</artifactId> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| ---- | ||
| To control OpenTelemetry tracing using Helidon configuration, also add the following dependency. | ||
| [source,xml] | ||
| .Dependency for configuring OpenTelemetry using Helidon config | ||
| ---- | ||
| <dependency> | ||
| <groupId>io.helidon.telemetry</groupId> | ||
| <artifactId>helidon-telemetry-opentelemetry-config</artifactId> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| ---- | ||
| You must also add at least one dependency on an OpenTelemetry exporter so your service sends its span data to a back-end system such as Jaeger or Grafana. | ||
|
|
||
| The following example dependency uses the OpenTelemetry `otlp` exporter. | ||
|
|
||
| [source,xml] | ||
| .Example dependency for an OpenTelemetry exporter | ||
| ---- | ||
| <dependency> | ||
| <groupId>io.opentelemetry</groupId> | ||
| <artifactId>opentelemetry-exporter-otlp</artifactId> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| ---- | ||
|
|
||
| // end::otel-dependency[] | ||
|
|
||
| // tag::otel-configuration[] | ||
|
|
||
| == Configuring OpenTelemetry Tracing | ||
| Because OpenTelemetry comprises several signals, of which tracing is only one, you configure OpenTelemetry tracing differently from other implementations of tracing. | ||
|
|
||
| For complete information on configuring OpenTelemetry using Helidon {flavor-uc}, see xref:{rootdir}/{flavor-lc}/open-telemetry.adoc[the Helidon {flavor-uc} OpenTelemetry documentation]. | ||
|
|
||
| The following example shows only some of the settings you can use to control OpenTelemetry tracing. | ||
|
|
||
| ifdef::se-flavor[] | ||
| [source,yaml] | ||
| .Example Helidon configuration for OpenTelemetry tracing | ||
| ---- | ||
| telemetry: | ||
| service: helidon-otel-tracing-example # <1> | ||
| signals: | ||
| tracing: | ||
| processors: | ||
| - type: simple # <2> | ||
| exporters: | ||
| - type: otlp # <3> | ||
| ---- | ||
| endif::se-flavor[] | ||
| ifdef::mp-flavor[] | ||
| [source.properties] | ||
| .Example Helidon configuration for OpenTelemetry tracing | ||
| ---- | ||
| telemetry.service=helidon-otel-tracing-example # <1> | ||
| telemetry.signals.tracing.processors.0.type=simple <2> | ||
| telemetry.signals.tracing.exporters.0.type=otlp <3> | ||
| ---- | ||
| endif::mp-flavor[] | ||
| <1> Specifies the OpenTelemetry service name. | ||
| <2> Selects the `simple` span processor. | ||
| <3> Selects which span exporter to use. | ||
|
|
||
| The `simple` processor type sends each span to the backend as soon as it ends, rather than grouping multiple spans into batches, and so is appropriate for testing and demos but not for production deployments. | ||
|
|
||
| The `otlp` exporter type matches the exporter dependency example shown above. If you try to configure a particular exporter type without added the corresponding dependency to your project, the server fails during startup. | ||
tjquinno marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| // end::otel-configuration[] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.