opentelemetry-ruby
opentelemetry-ruby copied to clipboard
OTEL Exporter environment variables for Grafana Cloud Tempo
Hi Team,
Spent good amount to find any useful information on OTEL Exporter environment variables for Grafana Cloud Tempo and unfortunately I cannot find one example of an OTEL endpoint that requires authentication.
Need some info that how can I pass environment varibales ?
OTEL_EXPORTER_OTLP_ENDPOINT Endpoint: tempo-us-central1.grafana.net:443 Tempo URL: https://tempo-us-central1.grafana.net/tempo User: 141540 Password: <API Key>
We support standard OTEL environment variables for configuration however we do not provide guidance for vendor specific configuration, authz, or authz.
I recommend that you contact the Grafana Cloud team for support.
Hey @satya0429, and for anyone else reading, Grafana Cloud recommends the following best practice for collecting and exporting traces:
- Install the open source collector, Grafana Agent , in your infrastructure.
- Configure a new Grafana Agent Flow component to export traces to Grafana Cloud: otelcol.receiver.otlp
Example component config:
otelcol.receiver.otlp "default" {
// https://grafana.com/docs/agent/latest/flow/reference/components/otelcol.receiver.otlp/
grpc {
endpoint = "0.0.0.0:4318"
}
output {
traces = [otelcol.processor.batch.default.input]
}
}
otelcol.processor.batch "default" {
// https://grafana.com/docs/agent/latest/flow/reference/components/otelcol.processor.batch/
output {
traces = [otelcol.processor.memory_limiter.default.input]
}
}
otelcol.processor.memory_limiter "default" {
// https://grafana.com/docs/agent/latest/flow/reference/components/otelcol.processor.memory_limiter/
check_interval = "1s"
limit = "150MiB" // alternatively, set `limit_percentage` and `spike_limit_percentage`
output {
traces = [otelcol.exporter.otlp.grafana_cloud_tempo.input]
}
}
otelcol.exporter.otlp "grafana_cloud_tempo" {
// https://grafana.com/docs/agent/latest/flow/reference/components/otelcol.exporter.otlp/
client {
endpoint = env("TEMPO_ENDPOINT")
auth = otelcol.auth.basic.grafana_cloud_tempo.handler
}
}
otelcol.auth.basic "grafana_cloud_tempo" {
// https://grafana.com/docs/agent/latest/flow/reference/components/otelcol.auth.basic/
username = env("TEMPO_USERNAME")
password = env("TEMPO_PASSWORD")
}
We believe this setup will provide you with the most flexible, reliable, and scalable setup for exporting your traces to Grafana Cloud.
@satya0429 Grafana does have documentation here for pushing data directly from OTel SDKs with authentication. The environment variables referenced there are in fact standard OTel environment variables, which as @arielvalentin pointed out - the Ruby SDK does fully support. Should you choose to do so, you should be able to set those environment variables for your application to push traces directly to Tempo in Grafana Cloud.
However, as @arielvalentin also mentioned - that is typically where our support would end, unless there was some bug in the Ruby SDK related to supporting those headers. And, as @jmarbach mentioned - using some kind of local agent to buffer the traces locally for export will likely be a much better experience than having your application push directly to Tempo. Personally, I recommend following their advice! 😄 ❤️
I'm going to close this issue out, but please feel free to open another issue (or a discussion!) or chat with us in slack if you have any problems with the SDK itself. We're happy to help you use it!