Create Flow components to consume Kubernetes monitoring CRDs #2466
Labels
flow
Related to Grafana Agent Flow
frozen-due-to-age
Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
proposal
Proposal or RFC
proposal-accepted
Proposal has been accepted.
Milestone
Today, Grafana Agent Operator must be used if you want to consume ServiceMonitors, PodMonitors, Probes, and PodLogs for collecting telemetry data. I would like to see support for consuming those CRDs added to Grafana Agent itself in the form of Flow components.
Each Flow component will discover a specific CRD, and use the definition of that CRD to collect telemetry data. For example, a
prometheus.kubernetes.pod_monitors
component collect metrics from pods specified by the set of discovered PodMonitors. Collected metrics are then forwarded to a Prometheus-compatible component, usuallyprometheus.remote_write
.Adding these components allows Grafana Agent Flow to be a suitable alternative to Grafana Agent Operator, where users would have more power to configure everything Grafana Agent Flow supports instead of being limited to what Grafana Agent Operator happens to expose.
Example pipeline
An example Flow pipeline which uses these components may look like the following:
This just serves as an example; the arguments that each of the new components will support is to be determined, though they will likely need to be similar to how you configure a MetricsInstance or LogsInstance with Grafana Agent Operator.
Component names
I haven't been able to come up with a great name for these components which best describe what they do. For now, my preliminary suggestion is to use
PROJECT.kubernetes.PLURAL_CRD_NAME
for each component, meaning the following components are added:prometheus.kubernetes.service_monitors
for collecting metrics based on discovered ServiceMonitorsprometheus.kubernetes.pod_monitors
for collecting metrics based on discovered PodMonitorsprometheus.kubernetes.probes
for collecting metrics based on discovered Probesloki.kubernetes.pod_logs
for collecting logs based on discovered PodLogs.Benefits
Being able to send metrics from SerivceMonitors, PodMonitors, Probes to any Prometheus-compatible Flow component may be particularly interesting to users, such as being able to convert metrics to OTLP and write them to Kafka:
Tasks
prometheus.operator.servicemonitors
component #3384prometheus.operator.podmonitors
component #3382prometheus.operator.probes
component #3383The text was updated successfully, but these errors were encountered: