Grafana Agent v0.33 release: reusable pipelines, monitoring Kubernetes pods, and more
Grafana Agent v0.33 is here!
This new release includes a lot of exciting features, such as a powerful way to configure Grafana Agent with Flow Modules and the ability to monitor Kubernetes pods in your cluster with an Operator Flow component. We also added many more Flow components making the Flow ecosystem bigger!
Flow Modules: How to build reusable pipelines
Modules are a new way to create Grafana Agent Flow configurations that can be loaded as a component. Modules are also a great way to set parameters for a configuration to create reusable pipelines.
Let’s see an example of how modules can be created using module.file module loader. In this example, we pass credentials from a parent config to a module, which loads a prometheus.remote_write component. The exports of the prometheus.remote_write
component are exposed to the parent config, allowing the parent config to pass metrics to it.
Parent config:
module.file "metrics" {
filename = "/path/to/prometheus_remote_write_module.river"
arguments {
username = env("PROMETHEUS_USERNAME")
password = env("PROMETHEUS_PASSWORD")
}
}
prometheus.exporter.unix { }
prometheus.scrape "local_agent" {
targets = prometheus.exporter.unix.targets
forward_to = [module.file.metrics.exports.prometheus_remote_write.receiver]
scrape_interval = "10s"
}
Module config (prometheus_remote_write_module.river
)
argument "username" { }
argument "password" { }
export "prometheus_remote_write" {
value = prometheus.remote_write.grafana_cloud
}
prometheus.remote_write "grafana_cloud" {
endpoint {
url = "https://prometheus-us-central1.grafana.net/api/prom/push"
basic_auth {
username = argument.username.value
password = argument.password.value
}
}
}
You can also use other module loaders such as module.string (useful to load modules via HTTP calls or Amazon S3 buckets) or module.git.
Monitor your Kubernetes pods with Flow
In this release, we are happy to announce that we included a new beta Flow component to monitor your Kubernetes pods: prometheus.operator.podmonitors. This component discovers PodMonitor resources in your Kubernetes cluster and scrapes the targets they reference.
Let’s see an example of how to configure Flow to discover all PodMonitors in your cluster and forward collected metrics to a prometheus.remote_write
component.
prometheus.remote_write "staging" {
// Send metrics to a locally running Mimir.
endpoint {
url = "http://mimir:9009/api/v1/push"
basic_auth {
username = "example-user"
password = "example-password"
}
}
}
prometheus.operator.podmonitors "pods" {
forward_to = [prometheus.remote_write.staging.receiver]
namespaces = ["my-app"]
selector {
match_expression {
key = "team"
operator = "In"
values = ["ops"]
}
}
}
This example will limit discovered PodMonitors
to ones with the label team=ops
in a specific namespace: my-app
.
New Flow components
In this latest release, we also include a lot of new Flow components for Prometheus exporters in Grafana Agent:
- prometheus.exporter.windows
- prometheus.exporter.mysql
- prometheus.exporter.postgres
- prometheus.exporter.blackbox
- prometheus.exporter.snmp
- prometheus.exporter.statsd
- prometheus.exporter.memcached
We also added a first batch of Service Discovery Flow components:
- discovery.dns
- discovery.ec2
- discovery.lightsail
- discovery.gce
- discovery.digitalocean
- discovery.consul
- discovery.azure
Finally, as we continue to build Grafana Agent as a vendor-neutral solution, we are adding more OpenTelemetry Collector components in Flow. Some examples are:
- otelcol.auth.oauth2 performs OAuth 2.0 authentication for HTTP and gRPC based OpenTelemetry exporters.
- otelcol.exporter.logging accepts OpenTelemetry data from other
otelcol
components and writes it to the console. - otelcol.extension.jaeger_remote_sampling
- otelcol.auth.sigv4
Learn more about the Grafana Agent
For more information on the latest release, please refer to our Grafana Agent documentation or check out our Grafana Agent upgrade guide.
Please make note of some breaking changes in this release. The most important change is that support for 32-bit ARM builds is removed for the foreseeable future due to Go compiler issues. We will consider bringing back 32-bit ARM support once our Go compiler issues are resolved and 32-bit ARM builds are stable.
Finally, the experimental Dynamic Configuration feature will be removed in the upcoming v0.34.
As always, we’d love to hear from you, so feel free to drop by our Grafana Labs Community Slack or check out the Grafana Agent repo directly. We look forward to your comments and feedback!
Grafana Cloud is the easiest way to get started with metrics, logs, traces, and dashboards. We have a generous free forever tier and plans for every use case. Sign up for free now!