Skip to content
DDOSCOMDDOSCOMDocs

Grafana Alloy

This configuration scrapes Prometheus metrics, moves them into an OTLP flow, and delivers them to the DDOSCOM Eyenode gateway with OAuth 2.0.

Define OTEL_GATEWAY_ENDPOINT, OTEL_GATEWAY_OAUTH_TOKEN_URL, OTEL_GATEWAY_OAUTH_CLIENT_ID, and OTEL_GATEWAY_OAUTH_CLIENT_SECRET in the Alloy process environment. Get the secret from Secrets in the Eyenode Dashboard, then see the get-started guide for the remaining values and secure handling.

Save this file as config.alloy. Replace node_exporter:9100 with your environment’s Prometheus endpoint if needed.

logging {
level = "info"
format = "logfmt"
}
prometheus.scrape "node" {
targets = [
{ "__address__" = "node_exporter:9100" },
]
scrape_interval = "10s"
forward_to = [otelcol.receiver.prometheus.otel_gateway_ddoscom_prometheus.receiver]
}
otelcol.auth.oauth2 "otel_gateway_ddoscom_auth" {
client_id = sys.env("OTEL_GATEWAY_OAUTH_CLIENT_ID")
client_secret = sys.env("OTEL_GATEWAY_OAUTH_CLIENT_SECRET")
token_url = sys.env("OTEL_GATEWAY_OAUTH_TOKEN_URL")
scopes = ["openid"]
timeout = "10s"
expiry_buffer = "60s"
}
otelcol.exporter.otlphttp "otel_gateway_ddoscom_endpoint" {
client {
endpoint = sys.env("OTEL_GATEWAY_ENDPOINT")
auth = otelcol.auth.oauth2.otel_gateway_ddoscom_auth.handler
}
}
otelcol.receiver.prometheus "otel_gateway_ddoscom_prometheus" {
output {
metrics = [otelcol.exporter.otlphttp.otel_gateway_ddoscom_endpoint.input]
}
}

Run Alloy with the file and variables in the same process. First confirm the node_exporter scrape succeeds, then verify export activity and that Eyenode shows metrics in the expected tenant and time range.

[!NOTE] This configuration sends metrics only. Add separate components and flows before sending logs or traces.

If authentication, scraping, or delivery fails, follow gateway troubleshooting.