Skip to content

Commit

Permalink
OTel documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobat committed Aug 22, 2023
1 parent 211d239 commit 403e688
Showing 1 changed file with 59 additions and 1 deletion.
60 changes: 59 additions & 1 deletion docs/src/main/asciidoc/opentelemetry.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,28 @@ extension to be added as a dependency to your project.
implementation("io.opentelemetry.contrib:opentelemetry-aws-xray-propagator")

Check warning on line 301 in docs/src/main/asciidoc/opentelemetry.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in 'Customise Propagator'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in 'Customise Propagator'.", "location": {"path": "docs/src/main/asciidoc/opentelemetry.adoc", "range": {"start": {"line": 301, "column": 40}}}, "severity": "INFO"}
----

==== Customise Propagator

To customise the propagation header you can implement the `TextMapPropagatorCustomizer` interface. This can be used, as an example, to restrict propagation of OpenTelemetry trace headers and prevent potentially sensitive data to be sent to third party systems.

```java
/**
* /**
* Meant to be implemented by a CDI bean that provides arbitrary customization for the TextMapPropagator
* that are to be registered with OpenTelemetry
*/
public interface TextMapPropagatorCustomizer {

TextMapPropagator customize(Context context);

interface Context {
TextMapPropagator propagator();

ConfigProperties otelConfigProperties();
}
}
```

=== Resource
A https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/overview.md#resources[resource] is a representation
of the entity that is producing telemetry, it adds attributes to the exported trace to characterize who is producing the trace.
Expand Down Expand Up @@ -331,6 +353,10 @@ public class CustomConfiguration {
}
----

==== User data

By setting `quarkus.otel.traces.eusp.enabled=true` you can add information about the user related to each span. The user's ID and roles will be added to the span attributes, if available.

=== Sampler
A https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#sampling[sampler] decides whether
a trace should be sampled and exported, controlling noise and overhead by reducing the number of sample of traces collected and sent
Expand Down Expand Up @@ -528,10 +554,42 @@ which retrieves the OpenTelemetry `Context` to extract the current span for prop

== Exporters

Quarkus OpenTelemetry defaults to the standard OTLP exporter defined in OpenTelemetry.
=== Default

The Quarkus OpenTelemetry extension uses its own exporter built on top of Vert.x for optimal performance and maintainability.

Check warning on line 559 in docs/src/main/asciidoc/opentelemetry.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using ', which (non restrictive clause preceded by a comma)' or 'that (restrictive clause without a comma)' rather than ', that'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using ', which (non restrictive clause preceded by a comma)' or 'that (restrictive clause without a comma)' rather than ', that'.", "location": {"path": "docs/src/main/asciidoc/opentelemetry.adoc", "range": {"start": {"line": 559, "column": 123}}}, "severity": "INFO"}

The exporter is automatically wired with CDI, that's why the `quarkus.otel.traces.exporter` property defaults to `cdi`.

The `quarkus.otel.exporter.otlp.traces.protocol` default to `grpc` and `http/protobuf` can also be used.

=== On Quarkiverse
Additional exporters will be available in the Quarkiverse https://github.com/quarkiverse/quarkus-opentelemetry-exporter/blob/main/README.md[quarkus-opentelemetry-exporter] project.

Check warning on line 566 in docs/src/main/asciidoc/opentelemetry.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in 'OpenTelemetry exporter'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in 'OpenTelemetry exporter'.", "location": {"path": "docs/src/main/asciidoc/opentelemetry.adoc", "range": {"start": {"line": 566, "column": 138}}}, "severity": "INFO"}

=== OpenTelemetry exporter
The default OpenTelemetry exporter can be used, but it's not recommended because of the additional dependency on the OkHttp library.

It can be activated by setting `quarkus.otel.traces.exporter=otlp` and include the following dependencies in your project:

[source,xml,role="primary asciidoc-tabs-target-sync-cli asciidoc-tabs-target-sync-maven"]
.pom.xml
----
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp-common</artifactId>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp</artifactId>
</dependency>
----

[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]

Check warning on line 586 in docs/src/main/asciidoc/opentelemetry.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.CaseSensitiveTerms] Use 'Gradle' rather than 'gradle'. Raw Output: {"message": "[Quarkus.CaseSensitiveTerms] Use 'Gradle' rather than 'gradle'.", "location": {"path": "docs/src/main/asciidoc/opentelemetry.adoc", "range": {"start": {"line": 586, "column": 14}}}, "severity": "INFO"}
.build.gradle
----
implementation("io.opentelemetry:opentelemetry-exporter-otlp-common")
implementation("io.opentelemetry:opentelemetry-exporter-otlp")
----

[[configuration-reference]]
== OpenTelemetry Configuration Reference

Expand Down

0 comments on commit 403e688

Please sign in to comment.