grafana/agent-configurator

OOTB otel component seems to have errors in default config

Closed this issue · 1 comments

image

I am using an admittedly naive basic config from the tool (see below) - but this seems not to run as-is, even with the appropriate secrets.

module.git "grafana_cloud" {
  repository = "https://github.com/grafana/agent-modules.git"
  path = "modules/grafana-cloud/autoconfigure/module.river"
  revision = "main"
  pull_frequency = "0s"
  arguments {
    stack_name = "moxious"
    token = env("GRAFANA_CLOUD_TOKEN")
  }
}
otelcol.exporter.prometheus "to_prometheus" {
  forward_to = [
    module.git.grafana_cloud.exports.metrics_receiver,
  ]
}

otelcol.exporter.loki "to_loki" {
  forward_to = [
    module.git.grafana_cloud.exports.logs_receiver,
  ]
}

otelcol.receiver.otlp "default" {
  grpc {}
  http {}
  output {
    metrics = [otelcol.exporter.prometheus.to_prometheus.input]
    logs = [otelcol.exporter.loki.to_loki.input]
    traces = [module.git.grafana_cloud.exports.traces_receiver]
  }
}

Thanks for reporting this! The root cause of this issue is the usage of the autoconfigure module. This module talks to the grafana cloud api to fetch the prometheus, loki, and tempo URL as well as tenant IDs.

The advantage of this is, that the user does not have to collect all this information themselves. Drawback: the grafana cloud token needs the stacks:read scope.

I'll track implementation in #175 and close this issue!