Last active
July 29, 2025 13:28
-
-
Save rumart/99e3a2b6249a4bc01493184509884b44 to your computer and use it in GitHub Desktop.
Grafana Alloy config used in blog post https://rudimartinsen.com/2025/07/27/otel-instrumenting-app/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| logging { | |
| level = "info" | |
| write_to = [loki.write.default.receiver] | |
| } | |
| livedebugging { | |
| enabled = true | |
| } | |
| prometheus.exporter.self "default" { | |
| } | |
| prometheus.scrape "metamonitoring" { | |
| targets = prometheus.exporter.self.default.targets | |
| forward_to = [prometheus.remote_write.default.receiver] | |
| } | |
| prometheus.remote_write "default" { | |
| endpoint { | |
| url = "<PROMETHEUS_SERVER>/api/v1/write" | |
| } | |
| } | |
| loki.write "default" { | |
| endpoint { | |
| url = "<LOKI_SERVER>/loki/api/v1/push" | |
| } | |
| } | |
| otelcol.processor.batch "default" { | |
| output { | |
| metrics = [otelcol.exporter.prometheus.default.input] | |
| } | |
| } | |
| otelcol.exporter.prometheus "default" { | |
| forward_to = [prometheus.remote_write.default.receiver] | |
| } | |
| otelcol.receiver.otlp "default" { | |
| http {} | |
| output { | |
| metrics = [otelcol.processor.batch.default.input] | |
| traces = [otelcol.exporter.otlp.tempo.input] | |
| logs = [otelcol.processor.attributes.default.input] | |
| } | |
| } | |
| otelcol.exporter.otlp "tempo" { | |
| client { | |
| endpoint = "<TEMPO_SERVER>:4317" | |
| tls { | |
| insecure = true | |
| insecure_skip_verify = true | |
| } | |
| } | |
| } | |
| otelcol.processor.attributes "default" { | |
| action { | |
| key = "loki.attribute.labels" | |
| action = "insert" | |
| value = "event.domain, event.name" | |
| } | |
| action { | |
| key = "loki.resource.labels" | |
| action = "insert" | |
| value = "service.name, service.namespace" | |
| } | |
| output { | |
| logs = [otelcol.exporter.loki.default.input] | |
| } | |
| } | |
| otelcol.exporter.loki "default" { | |
| forward_to = [loki.write.default.receiver] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment