Module to automatically configure receivers for Grafana Cloud.
>= v0.34
The following arguments are supported when passing arguments to the module loader:
Name | Type | Description | Default | Required |
---|---|---|---|---|
stack_name |
string |
Name of your stack as shown in the account console | yes | |
token |
secret |
Access policy token or API Key. | yes |
To create a token:
- Navigate to the Grafana Cloud Portal
- Go to either the
Access Policies
orAPI Keys
page, located in theSecurity
section - Create an Access Policy or API token with the correct permissions
The token must have permissions to read stack information. The setup of these permissions depends on the type of token:
- Access Policies need the
stacks:read
scope - API Keys need at least the the
MetricsPublisher
role
The following fields are exported by the module:
Name | Type | Description |
---|---|---|
metrics_receiver |
prometheus.Interceptor |
A value that other components can use to send metrics data to. |
logs_receiver |
loki.LogsReceiver |
A value that other components can use to send logs data to. |
traces_receiver |
otelcol.Consumer |
A value that other components can use to send trace data to. |
profiles_receiver |
write.fanOutClient |
A value that other components can use to send profiling data to. |
stack_information |
object |
Decoded representation of the Stack info endpoint. |
module.git "grafana_cloud" {
repository = "https://github.com/grafana/agent-modules.git"
revision = "main"
path = "modules/grafana-cloud/autoconfigure/module.river"
arguments {
stack_name = "<your-stack-name>"
token = "<your-access-token>"
}
}
prometheus.scrape "default" {
targets = [
{"__address__" = "127.0.0.1:12345"},
]
forward_to = [
module.git.grafana_cloud.exports.metrics_receiver,
]
}