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

Updates to the OpenTelemetry quickstart ahead of Quarkus 3.19 #1506

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions opentelemetry-quickstart/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
Quarkus guide: https://quarkus.io/guides/opentelemetry
# Quarkus quickstart example for OpenTelemetry

In this opentelemetry-quickstart is implemented OpenTelemetry Metrics detailed in the guide: https://quarkus.io/guides/opentelemetry-metrics .
This example provides a simple Quarkus application instrumented with OpenTelemetry, and allows telemetry data to be seen in a local Grafana LGTM DevService instance.

Additionally, it integrates the LGTM DevService for telemetry visualization by adding the `quarkus-observability-devservices-lgtm` dependency.
For detailed instructions the [Quarkus OpenTelemetry guide](https://quarkus.io/guides/opentelemetry) is available.

Usage and configuration are explained in the guide: https://quarkus.io/guides/opentelemetry-tracing#grafana-otel-lgtm-option
There are signal specific guides for:
* [Tracing](https://quarkus.io/guides/opentelemetry-tracing)
* [Metrics](https://quarkus.io/guides/opentelemetry-metrics)
* [Logs](https://quarkus.io/guides/opentelemetry-logging)

## See telemetry

The project includes the Grafana LGTM DevService for telemetry visualization. This is provided by the `quarkus-observability-devservices-lgtm` dependency.

Usage and configuration are explained in the [Grafana LGTM guide](https://quarkus.io/guides/observability-devservices-lgtm).

21 changes: 12 additions & 9 deletions opentelemetry-quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,28 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
<artifactId>quarkus-opentelemetry</artifactId>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client</artifactId>
</dependency>
<!-- For Dev Mode -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-opentelemetry</artifactId>
<artifactId>quarkus-observability-devservices-lgtm</artifactId>
<scope>provided</scope>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client</artifactId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-observability-devservices-lgtm</artifactId>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
quarkus.application.name=myservice
# OTel metrics off by default
quarkus.otel.metrics.enabled=true
# OTel logs off by default
quarkus.otel.logs.enabled=true
quarkus.otel.exporter.otlp.traces.headers=Authorization=Bearer my_secret
quarkus.log.console.format=%d{HH:mm:ss} %-5p traceId=%X{traceId}, parentId=%X{parentId}, spanId=%X{spanId}, sampled=%X{sampled} [%c{2.}] (%t) %s%e%n
# jfr must be enabled if you need OpenTelemetry metrics on native mode.
quarkus.native.monitoring=jfr
# Don't run the Grafana LGTM dev service during tests
%test.quarkus.observability.enabled=false