Files
grafana/devenv/docker/blocks/self-instrumentation
Zoltán Bedi 9453cedb51 Update self instrumentation to use alloy and bump versions (#109266)
* Update self instrumentation to use alloy and bump versions

* Update devenv/docker/blocks/self-instrumentation/config.alloy

Co-authored-by: Sam DeHaan <dehaansa@gmail.com>

* Add remote write receiver feature to Prometheus configuration in docker-compose.yaml

* Add example for plugin profiling to the doc

---------

Co-authored-by: Sam DeHaan <dehaansa@gmail.com>
2025-08-14 12:34:41 +02:00
..

Self Instrumentation

To run this source, in the Grafana repo root:

make devenv sources=self-instrumentation

This will setup Prometheus, Loki, Tempo, and Pyroscope.

You then need to run Grafana with those added config:

[log.file]
format = json

[log.frontend]
enabled = true
custom_endpoint=http://localhost:12347/collect

[tracing.opentelemetry.otlp]
address = localhost:4317
insecure = true

To collect profiles with pyroscope, you need to run Grafana with the following env vars:

export GF_DIAGNOSTICS_PROFILING_ENABLED=true
export GF_DIAGNOSTICS_PROFILING_ADDR=0.0.0.0
make run

To enable profiling in your plugin add the following to your custom.ini:

[plugin.grafana-bigquery-datasource]
profiling_enabled = true
profiling_port = 6161
profiling_block_rate = 1
profiling_mutex_rate = 1

and the following to your config.alloy in the pyroscope.scrape.targets section:

  {"__address__" = "host.docker.internal:6161", "service_name"="grafana-bigquery-datasource"},