Skip to content
Merged
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
40 changes: 25 additions & 15 deletions docs/sources/collect/opentelemetry-to-lgtm-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ This topic describes how to:
* [`otelcol.auth.basic`][otelcol.auth.basic]
* [`otelcol.exporter.loki`][otelcol.exporter.loki]
* [`otelcol.exporter.otlp`][otelcol.exporter.otlp]
* [`otelcol.exporter.otlphttp`][otelcol.exporter.otlphttp]
* [`otelcol.exporter.prometheus`][otelcol.exporter.prometheus]
* [`otelcol.processor.batch`][otelcol.processor.batch]
* [`otelcol.processor.memory_limiter`][otelcol.processor.memory_limiter]
* [`otelcol.receiver.otlp`][otelcol.receiver.otlp]
* [`prometheus.remote_write`][prometheus.remote_write]

Expand Down Expand Up @@ -76,7 +78,7 @@ otelcol.exporter.otlp "default" {
The pipeline looks like this:

```plaintext
Metrics, Logs, Traces: OTLP Receiver → batch processor → OTLP Exporter
Metrics, Logs, Traces: OTLP Receiver → Batch Processor → OTLP HTTP Exporter
```

## Grafana Cloud
Expand Down Expand Up @@ -109,14 +111,19 @@ Replace the following:

This configuration uses the credentials stored in `otelcol.auth.basic "default"` to authenticate against the Grafana Cloud OTLP endpoints, and you should start to see your data arrive.

## Other platforms (Grafana Enterprise, Grafana Open Source)
{{< admonition type="note" >}}
For Grafana Cloud, use `otelcol.exporter.otlphttp` which sends data over HTTP/HTTPS.
Use `otelcol.exporter.otlp` for gRPC endpoints when working with other platforms.
{{< /admonition >}}

## Other platforms: Grafana Enterprise and Grafana Open Source

You can implement the following pipelines to send your data to Loki, Tempo, and Mimir or Prometheus.

```plaintext
Metrics: OTel → batch processorMimir or Prometheus remote write
Logs: OTel → batch processor → Loki exporter
Traces: OTel → batch processorOTel exporter
Metrics: OTLP Receiver → Batch ProcessorPrometheus Exporter → Prometheus Remote Write
Logs: OTLP Receiver → Batch Processor → Loki Exporter → Loki Write
Traces: OTLP Receiver → Batch ProcessorOTLP Exporter (gRPC/HTTP)
```

### Grafana Loki
Expand All @@ -136,7 +143,7 @@ loki.write "default" {
}
```

To use Loki with basic-auth, which is required with Grafana Cloud Logs, you must configure the [`loki.write`][loki.write] component.
To use Loki with basic-auth, which Grafana Cloud Logs requires, you must configure the [`loki.write`][loki.write] component.
You can get the Loki configuration from the Loki **Details** page in the [Grafana Cloud Portal][].

```alloy
Expand All @@ -158,7 +165,7 @@ loki.write "grafana_cloud_logs" {

### Grafana Tempo

[Grafana Tempo][] is an open source, easy-to-use, scalable distributed tracing backend.
[Grafana Tempo][] is an open source, scalable distributed tracing backend.
Tempo can ingest OTLP directly, and you can use the OTLP exporter to send the traces to Tempo.

```alloy
Expand All @@ -169,13 +176,13 @@ otelcol.exporter.otlp "default" {
}
```

To use Tempo with basic-auth, which is required with Grafana Cloud Traces, you must use the [otelcol.auth.basic][] component.
To use Tempo with basic-auth, which Grafana Cloud Traces requires, you must use the [otelcol.auth.basic][] component.
You can get the Tempo configuration from the Tempo **Details** page in the [Grafana Cloud Portal][].

```alloy
otelcol.exporter.otlp "grafana_cloud_traces" {
otelcol.exporter.otlphttp "grafana_cloud_traces" {
client {
endpoint = "tempo-us-central1.grafana.net:443"
endpoint = "https://tempo-us-central1.grafana.net:443"
auth = otelcol.auth.basic.grafana_cloud_traces.handler
}
}
Expand Down Expand Up @@ -204,7 +211,7 @@ prometheus.remote_write "default" {
}
```

To use Prometheus with basic-auth, which is required with Grafana Cloud Metrics, you must configure the [`prometheus.remote_write`][prometheus.remote_write] component.
To use Prometheus with basic-auth, which Grafana Cloud Metrics requires, you must configure the [`prometheus.remote_write`][prometheus.remote_write] component.
You can get the Prometheus configuration from the Prometheus **Details** page in the [Grafana Cloud Portal][].

```alloy
Expand All @@ -227,6 +234,7 @@ prometheus.remote_write "grafana_cloud_metrics" {
### Put it all together

Instead of referencing `otelcol.exporter.otlp.default.input` in the output of `otelcol.processor.batch`, you need to reference the three exporters you set up.
For Grafana Cloud, use `otelcol.exporter.otlphttp` for traces to send data over HTTPS.
The final configuration becomes:

```alloy
Expand All @@ -250,13 +258,13 @@ otelcol.processor.batch "example" {
output {
metrics = [otelcol.exporter.prometheus.grafana_cloud_metrics.input]
logs = [otelcol.exporter.loki.grafana_cloud_logs.input]
traces = [otelcol.exporter.otlp.grafana_cloud_traces.input]
traces = [otelcol.exporter.otlphttp.grafana_cloud_traces.input]
}
}

otelcol.exporter.otlp "grafana_cloud_traces" {
otelcol.exporter.otlphttp "grafana_cloud_traces" {
client {
endpoint = "tempo-us-central1.grafana.net:443"
endpoint = "https://tempo-us-central1.grafana.net:443"
auth = otelcol.auth.basic.grafana_cloud_traces.handler
}
}
Expand Down Expand Up @@ -316,7 +324,7 @@ ts=2023-05-09T09:37:15.303522Z level=info trace_id=6466516c9e1a556422df7a84c0ade
ts=2023-05-09T09:37:15.303557Z level=info trace_id=6466516c9e1a556422df7a84c0ade6b0 msg="finished node evaluation" node_id=otelcol.exporter.prometheus.grafana_cloud_metrics duration=30.083µs
ts=2023-05-09T09:37:15.303611Z component=prometheus.remote_write.grafana_cloud_metrics subcomponent=rw level=info remote_name=7f623a url=https://prometheus-us-central1.grafana.net/api/prom/push msg="Replaying WAL" queue=7f623a
ts=2023-05-09T09:37:15.303618Z level=info trace_id=6466516c9e1a556422df7a84c0ade6b0 msg="finished node evaluation" node_id=otelcol.auth.basic.grafana_cloud_traces duration=52.5µs
ts=2023-05-09T09:37:15.303694Z level=info trace_id=6466516c9e1a556422df7a84c0ade6b0 msg="finished node evaluation" node_id=otelcol.exporter.otlp.grafana_cloud_traces duration=70.375µs
ts=2023-05-09T09:37:15.303694Z level=info trace_id=6466516c9e1a556422df7a84c0ade6b0 msg="finished node evaluation" node_id=otelcol.exporter.otlphttp.grafana_cloud_traces duration=70.375µs
ts=2023-05-09T09:37:15.303782Z component=otelcol.processor.memory_limiter.default level=info msg="Memory limiter configured" limit_mib=150 spike_limit_mib=30 check_interval=1s
ts=2023-05-09T09:37:15.303802Z level=info trace_id=6466516c9e1a556422df7a84c0ade6b0 msg="finished node evaluation" node_id=otelcol.processor.memory_limiter.default duration=100.334µs
ts=2023-05-09T09:37:15.303853Z level=info trace_id=6466516c9e1a556422df7a84c0ade6b0 msg="finished node evaluation" node_id=otelcol.processor.batch.default duration=44.75µs
Expand Down Expand Up @@ -345,7 +353,9 @@ You can check the pipeline graphically by visiting <http://localhost:12345/graph
[otelcol.auth.basic]: ../../reference/components/otelcol/otelcol.auth.basic/
[otelcol.exporter.loki]: ../../reference/components/otelcol/otelcol.exporter.loki/
[otelcol.exporter.otlp]: ../../reference/components/otelcol/otelcol.exporter.otlp/
[otelcol.exporter.otlphttp]: ../../reference/components/otelcol/otelcol.exporter.otlphttp/
[otelcol.exporter.prometheus]: ../../reference/components/otelcol/otelcol.exporter.prometheus/
[otelcol.processor.batch]: ../../reference/components/otelcol/otelcol.processor.batch/
[otelcol.processor.memory_limiter]: ../../reference/components/otelcol/otelcol.processor.memory_limiter/
[otelcol.receiver.otlp]: ../../reference/components/otelcol/otelcol.receiver.otlp/
[prometheus.remote_write]: ../../reference/components/prometheus/prometheus.remote_write/
Loading