Skip to content

Commit

Permalink
Configure OTel metrics on observability devservice
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobat committed Jul 15, 2024
1 parent 7228252 commit bdadc09
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docs/src/main/asciidoc/observability-devservices-lgtm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ For Tracing add the `quarkus-opentelemetry` extension to your build file:
implementation("io.quarkus:quarkus-opentelemetry")
----

The `quarkus.otel.exporter.otlp.traces.endpoint` property is automatically set to OTel collector endpoint as seen from the outside of the docker container.
The `quarkus.otel.exporter.otlp.endpoint` property is automatically set to OTel collector endpoint as seen from the outside of the docker container.

Check warning on line 75 in docs/src/main/asciidoc/observability-devservices-lgtm.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using 'because' or 'while' rather than 'as'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using 'because' or 'while' rather than 'as'.", "location": {"path": "docs/src/main/asciidoc/observability-devservices-lgtm.adoc", "range": {"start": {"line": 75, "column": 100}}}, "severity": "INFO"}

The `quarkus.otel.exporter.otlp.traces.protocol` is set to `http/protobuf`.
The `quarkus.otel.exporter.otlp.protocol` is set to `http/protobuf`.

=== Access Grafana

Check warning on line 79 in docs/src/main/asciidoc/observability-devservices-lgtm.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Headings] Use sentence-style capitalization in 'Access Grafana'. Raw Output: {"message": "[Quarkus.Headings] Use sentence-style capitalization in 'Access Grafana'.", "location": {"path": "docs/src/main/asciidoc/observability-devservices-lgtm.adoc", "range": {"start": {"line": 79, "column": 5}}}, "severity": "INFO"}

Expand All @@ -86,7 +86,7 @@ You will see a log entry like this:

[source, log]
----
[io.qu.ob.de.ObservabilityDevServiceProcessor] (build-35) Dev Service Lgtm started, config: {grafana.endpoint=http://localhost:42797, quarkus.otel.exporter.otlp.traces.endpoint=http://localhost:34711, otel-collector.url=localhost:34711, quarkus.micrometer.export.otlp.url=http://localhost:34711/v1/metrics, quarkus.otel.exporter.otlp.traces.protocol=http/protobuf}
[io.qu.ob.de.ObservabilityDevServiceProcessor] (build-35) Dev Service Lgtm started, config: {grafana.endpoint=http://localhost:42797, quarkus.otel.exporter.otlp.endpoint=http://localhost:34711, otel-collector.url=localhost:34711, quarkus.micrometer.export.otlp.url=http://localhost:34711/v1/metrics, quarkus.otel.exporter.otlp.protocol=http/protobuf}
----
Remember that Grafana is accessible in an ephemeral port, so you need to check the logs to see which port is being used. In this example, the grafana endpoint is `grafana.endpoint=http://localhost:42797`.

Check warning on line 92 in docs/src/main/asciidoc/observability-devservices-lgtm.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/observability-devservices-lgtm.adoc", "range": {"start": {"line": 92, "column": 66}}}, "severity": "INFO"}

Check warning on line 92 in docs/src/main/asciidoc/observability-devservices-lgtm.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 'which'. 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 'which'.", "location": {"path": "docs/src/main/asciidoc/observability-devservices-lgtm.adoc", "range": {"start": {"line": 92, "column": 95}}}, "severity": "INFO"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public Map<String, String> doStart() {

// set relevant properties for Quarkus extensions directly
if (catalog != null && catalog.hasOpenTelemetry()) {
containerConfigs.put("quarkus.otel.exporter.otlp.traces.endpoint",
containerConfigs.put("quarkus.otel.exporter.otlp.endpoint",
String.format("http://%s:%s", host, container.getOtlpPort()));
containerConfigs.put("quarkus.otel.exporter.otlp.traces.protocol", "http/protobuf");
containerConfigs.put("quarkus.otel.exporter.otlp.protocol", "http/protobuf");
}
if (catalog != null && catalog.hasMicrometerOtlp()) {
containerConfigs.put("quarkus.micrometer.export.otlp.url",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public static class TestResourceTestProfileOff implements QuarkusTestProfile {
public Map<String, String> getConfigOverrides() {
return Map.of(
"quarkus.micrometer.export.otlp.url", "http://${otel-collector.url}/v1/metrics",
"quarkus.otel.exporter.otlp.traces.protocol", "http/protobuf",
"quarkus.otel.exporter.otlp.traces.endpoint", "http://${otel-collector.url}",
"quarkus.otel.exporter.otlp.protocol", "http/protobuf",
"quarkus.otel.exporter.otlp.endpoint", "http://${otel-collector.url}",
"quarkus.observability.dev-resources", "false",
"quarkus.observability.enabled", "false");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public static class DevResourcesTestProfileOnly implements QuarkusTestProfile {
public Map<String, String> getConfigOverrides() {
return Map.of(
"quarkus.micrometer.export.otlp.url", "http://${otel-collector.url}/v1/metrics",
"quarkus.otel.exporter.otlp.traces.protocol", "http/protobuf",
"quarkus.otel.exporter.otlp.traces.endpoint", "http://${otel-collector.url}",
"quarkus.otel.exporter.otlp.protocol", "http/protobuf",
"quarkus.otel.exporter.otlp.endpoint", "http://${otel-collector.url}",
"quarkus.observability.dev-resources", "true",
"quarkus.observability.enabled", "false");
}
Expand Down

0 comments on commit bdadc09

Please sign in to comment.