The aim of this repository is to be a drop in replacement of Datadog's DogStatsD agent on the local development environment in order to be able to check the metrics we are sending before actually pushing them.
To be able to:
- Check the number of metrics we are sending to Datadog. As every application metric with a unique tags combination is a custom one, and we are charged for them, this is a good practice.
- Inspect the name, type, and values, in order to be sure we are sending valid samples.
- Validate the application behaviour and improve its observability by checking its metrics.
Just execute docker compose up -d and then run your application making the datadog integration point to localhost (the port is the same, 8125).
Metrics scrapping happens every 5s. After that, you can check them in http://localhost:3000/explore, selecting the Prometheus datasource, or using the Metrics overview dashboard provided.
Given prometheus, the time series database used, doesn't allow metric names with dots (.) as DataDog does, alloy automatically translate those dots to _ when exporting metrics to prometheus format.
From bash, you can execute the following command and send a custom metric to the statsd daemon:
echo -n "is_alive:1|g|#hostname:${HOSTNAME}" >/dev/udp/localhost/8125
After 5 seconds, prometheus will scrape alloy metrics and it should be shown in the grafana explore endpoint (see above).
If you need a fine grained debug, check alloy exposed metrics, or directly query prometheus.