Grafana Alloy
Send traces to xScaler using Grafana Alloy. Alloy can receive OTLP traces from your applications and forward them to xScaler over OTLP/HTTP.
:::warning Required headers Both headers are mandatory on every request:
Authorization: Bearer <token>— set in theheadersmapX-Scope-OrgID: <tenant-id>— set in theheadersmap :::
Configuration
Receive OTLP and forward to xScaler
Save the following as config.alloy:
otelcol.receiver.otlp "default" {
grpc { endpoint = "0.0.0.0:4317" }
http { endpoint = "0.0.0.0:4318" }
output {
traces = [otelcol.processor.batch.default.input]
}
}
otelcol.processor.batch "default" {
output {
traces = [otelcol.exporter.otlphttp.xscaler.input]
}
}
otelcol.exporter.otlphttp "xscaler" {
client {
endpoint = "https://euw1-01.t.xscalerlabs.com"
headers = {
"Authorization" = "Bearer <token>",
"X-Scope-OrgID" = "<tenant-id>",
}
tls { insecure = false }
}
}
Load credentials from environment variables
otelcol.exporter.otlphttp "xscaler" {
client {
endpoint = "https://euw1-01.t.xscalerlabs.com"
headers = {
"Authorization" = "Bearer " + env("XSCALER_TOKEN"),
"X-Scope-OrgID" = env("XSCALER_TENANT_ID"),
}
tls { insecure = false }
}
}
Send metrics, logs, and traces together
Alloy can forward all three signals in a single config:
otelcol.receiver.otlp "default" {
grpc { endpoint = "0.0.0.0:4317" }
http { endpoint = "0.0.0.0:4318" }
output {
metrics = [otelcol.processor.batch.default.input]
logs = [otelcol.processor.batch.default.input]
traces = [otelcol.processor.batch.default.input]
}
}
otelcol.processor.batch "default" {
output {
metrics = [otelcol.exporter.otlphttp.xscaler_metrics.input]
logs = [otelcol.exporter.otlphttp.xscaler_logs.input]
traces = [otelcol.exporter.otlphttp.xscaler_traces.input]
}
}
otelcol.exporter.otlphttp "xscaler_metrics" {
client {
endpoint = "https://euw1-01.m.xscalerlabs.com"
headers = {
"Authorization" = "Bearer " + env("XSCALER_TOKEN"),
"X-Scope-OrgID" = env("XSCALER_TENANT_ID"),
}
}
}
otelcol.exporter.otlphttp "xscaler_logs" {
client {
endpoint = "https://euw1-01.l.xscalerlabs.com"
headers = {
"Authorization" = "Bearer " + env("XSCALER_TOKEN"),
"X-Scope-OrgID" = env("XSCALER_TENANT_ID"),
}
}
}
otelcol.exporter.otlphttp "xscaler_traces" {
client {
endpoint = "https://euw1-01.t.xscalerlabs.com"
headers = {
"Authorization" = "Bearer " + env("XSCALER_TOKEN"),
"X-Scope-OrgID" = env("XSCALER_TENANT_ID"),
}
}
}
Run with Docker
docker run --rm \
-e XSCALER_TOKEN=<token> \
-e XSCALER_TENANT_ID=<tenant-id> \
-v $(pwd)/config.alloy:/etc/alloy/config.alloy \
-p 4317:4317 -p 4318:4318 \
grafana/alloy:latest \
run /etc/alloy/config.alloy
Troubleshooting
Traces not arriving
- Open the Alloy UI at
http://localhost:12345— red components indicate errors. - Verify the
endpointishttps://euw1-01.t.xscalerlabs.com(no path suffix). - Check both
AuthorizationandX-Scope-OrgIDare in theheadersmap.
401 Unauthorized
The Authorization value must be "Bearer <token>" — include the Bearer prefix.