Skip to content

podMonitorSelector and podMonitorNamespaceSelector missing from agent-operator.yaml #2079

Open
@bootstrap314

Description

@bootstrap314

When setting up the grafana-agent operator using the agent-operator.yaml template, podmonitor resources do not work. The reason they do not work, is missing configuration for podMonitorSelector and podMonitorNamespaceSelector.

Configuring the MetricsInstance as below fixes this issue:

apiVersion: monitoring.grafana.com/v1alpha1
kind: MetricsInstance
metadata:
  labels:
    agent: grafana-agent
  name: grafana-agent-metrics
  namespace: default
spec:
  remoteWrite:
  - basicAuth:
      password:
        key: password
        name: dev-metrics-secret
      username:
        key: username
        name: dev-metrics-secret
    url: https://prometheus-prod-10-prod-us-central-0.grafana.net/api/prom/push
  serviceMonitorNamespaceSelector: {}
  serviceMonitorSelector:
    matchLabels:
      instance: primary
  podMonitorNamespaceSelector: {}
  podMonitorSelector:
    matchLabels:
      instance: primary

Can someone please fix this? This cost my team two days of time, and for some reason was even missed in a ticket we opened with GrafanaCloud support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    operatorGrafana Agent Operator relatedtype/docsDocs Squad label across all Grafana Labs reposvariant/operatorRelated to Grafana Agent Static Operator.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions