You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/opentelemetry.adoc
+78-4Lines changed: 78 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -251,16 +251,90 @@ When creating manual instrumentation, while naming metrics or attributes you sho
251
251
252
252
== Exporters
253
253
254
-
=== Default
254
+
=== The Default
255
255
256
-
The Quarkus OpenTelemetry extension uses its own signal exporters built on top of Vert.x for optimal performance and maintainability.
256
+
The Quarkus OpenTelemetry extension uses its own signal exporters built on top of Vert.x for optimal performance and maintainability. All *Quarkus built in exporters use the OTLP protocol* through a couple of data senders, using `grpc` (the default) and `http/protobuf`.
257
257
258
-
The exporter is automatically wired with CDI, that's why the `quarkus.otel.traces.exporter`and `quarkus.otel.metrics.exporter` properties default to `cdi`.
258
+
The active exporter is automatically wired by CDI, that's why the `quarkus.otel.traces.exporter`, `quarkus.otel.metrics.exporter` and `quarkus.otel.logs.exporter` properties default value is `cdi`. This is not because of the protocol being used in the data transfer but because of how the exporters are wired.
259
259
260
-
The `quarkus.otel.exporter.otlp.protocol` defaults to `grpc` but `http/protobuf` can also be used.
260
+
CDI (Context Dependency Injection) will manage the exporters to use, according to the selected protocol or when applications implement their own CDI exporter, like in tests.
261
+
262
+
The `quarkus.otel.exporter.otlp.protocol` property instructs Quarkus to switch the senders and defaults to `grpc` but `http/protobuf` can also be used.
261
263
262
264
NOTE: If you change the protocol, you also need to change the port in the endpoint. The default port for `grpc` is `4317` and for `http/protobuf` is `4318`.
263
265
266
+
=== Using CDI to produce a test exporter
267
+
268
+
Leaving the default as CDI is particularly useful for tests. In the following example a Span exporter class is wired with CDI and then the telemetry can be used in test code.
269
+
270
+
Creating a custom `SpanExporter` bean:
271
+
272
+
[source,java]
273
+
----
274
+
@ApplicationScoped
275
+
static class InMemorySpanExporterProducer {
276
+
@Produces
277
+
@Singleton
278
+
InMemorySpanExporter inMemorySpanExporter() {
279
+
return InMemorySpanExporter.create();
280
+
}
281
+
}
282
+
----
283
+
284
+
Where `InMemorySpanExporter` is a class from the OpenTelemetry test utilities dependency:
<1> This excludes calls to the export endpoint itself.
329
+
330
+
For more details please take a look to the https://github.com/quarkusio/quarkus/blob/main/integration-tests/opentelemetry/src/main/java/io/quarkus/it/opentelemetry/ExporterResource.java[ExporterResource] in the Quarkus integration tests.
331
+
332
+
=== The OpenTelemetry OTLP exporter
333
+
334
+
This is currently not supported in quarkus. Configuration example for traces: `quarkus.otel.tracing.exporter=otlp`.
335
+
336
+
However, it's also not needed because Quarkus own default exporters will send data using the OTLP protocol.
337
+
264
338
=== On Quarkiverse
265
339
Additional exporters will be available in the Quarkiverse https://docs.quarkiverse.io/quarkus-opentelemetry-exporter/dev/index.html[quarkus-opentelemetry-exporter] project.
0 commit comments