Skip to content

Commit db04702

Browse files
committed
Add OTel docs outline
Signed-off-by: Fabian Stäber <[email protected]>
1 parent a8902cb commit db04702

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

docs/content/otel/names.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ title: Names
33
weight: 3
44
---
55

6-
TODO: How to iplement OpenTelemetry semantic conventions, and how OpenTelemetry metric and label names are converted to Prometheus.
6+
TODO: This section will contain information on:
7+
8+
* Mapping Prometheus metric names to OpenTelemetry when using the `OpenTelemetryExporter`. See OpenTelemetry's [Prometheus and OpenMetrics Compatibility](https://opentelemetry.io/docs/specs/otel/compatibility/prometheus_and_openmetrics/).
9+
* Using dots in label and metric names to implement OpenTelemetry's semantic conventions.

docs/content/otel/otlp.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ title: OTLP
33
weight: 1
44
---
55

6-
TODO: How to push metrics to an OpenTelemetry endpoint using the OpenTelemetry exporter.
6+
TODO: This section will describe how to push metrics to an OpenTelemetry endpoint using the OpenTelemetry exporter.
7+
8+
In the meantime, have a look at the example in [examples/example-exporter-opentelemetry](https://github.com/prometheus/client_java/tree/main/examples/example-exporter-opentelemetry).
9+
It has an example Java program with the `OpenTelemetryExporter`, and a Docker compose setting up a pipeline with the OpenTelemetry collector and a Prometheus server.

docs/content/otel/tracing.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,13 @@ title: Tracing
33
weight: 2
44
---
55

6-
TODO: How to integrate Prometheus metrics with OTel traces.
6+
It is a common scenario that you use the Prometheus Java client for metrics, and the OpenTelemetry Java instrumentation agent for tracing.
7+
8+
The Prometheus Java client has some awesome features under the hood to support integration with OpenTelemetry tracing:
9+
10+
* `service.name` and `service.instance.id` are used in OpenTelemetry to uniquely identify a service instance. If an OpenTelemetry Java agent is attached, the Prometheus library will automatically use the same `service.name` and `service.instance.id` as the agent when pushing metrics in OpenTelemetry format. That way the monitoring backend will see that the metrics and the traces are coming from the same instance.
11+
* Exemplars are added automatically if a Prometheus metric is updated in the context of a distributed OpenTelemetry trace.
12+
* If a Span is used as an Exemplar, the Span is marked with the Span attribute `exemplar="true"`. This can be used in the OpenTelemetry's sampling policy to make sure Exemplars are always sampled.
13+
14+
TODO: We will add more information on integration OTel tracing with Prometheus metrics here.
15+
In the meantime, have a look at the tail sampling end-to-end example in [examples/example-exemplars-tail-sampling](https://github.com/prometheus/client_java/tree/main/examples/example-exemplars-tail-sampling).

0 commit comments

Comments
 (0)