Skip to content

Commit

Permalink
Add OTel docs outline
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Stäber <fabian@fstab.de>
  • Loading branch information
fstab committed Sep 26, 2023
1 parent a8902cb commit db04702
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 4 additions & 1 deletion docs/content/otel/names.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ title: Names
weight: 3
---

TODO: How to iplement OpenTelemetry semantic conventions, and how OpenTelemetry metric and label names are converted to Prometheus.
TODO: This section will contain information on:

* 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/).
* Using dots in label and metric names to implement OpenTelemetry's semantic conventions.
5 changes: 4 additions & 1 deletion docs/content/otel/otlp.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ title: OTLP
weight: 1
---

TODO: How to push metrics to an OpenTelemetry endpoint using the OpenTelemetry exporter.
TODO: This section will describe how to push metrics to an OpenTelemetry endpoint using the OpenTelemetry exporter.

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).
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.
11 changes: 10 additions & 1 deletion docs/content/otel/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@ title: Tracing
weight: 2
---

TODO: How to integrate Prometheus metrics with OTel traces.
It is a common scenario that you use the Prometheus Java client for metrics, and the OpenTelemetry Java instrumentation agent for tracing.

The Prometheus Java client has some awesome features under the hood to support integration with OpenTelemetry tracing:

* `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.
* Exemplars are added automatically if a Prometheus metric is updated in the context of a distributed OpenTelemetry trace.
* 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.

TODO: We will add more information on integration OTel tracing with Prometheus metrics here.
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 comments on commit db04702

Please sign in to comment.