Skip to content

PodMonitor CRD's scrapeProtocols option seems to be ignored #4607

@ScOut3R

Description

@ScOut3R

Component(s)

prometheus.operator.podmonitors

What's wrong?

A discovered PodMonitor target has the following:

scrape_protocols:
    - OpenMetricsText1.0.0
    - OpenMetricsText0.0.1
    - PrometheusText1.0.0
    - PrometheusText0.0.4

Even though the PodMonitor resource has:

scrapeProtocols:
    - PrometheusProto

Steps to reproduce

Enable the prometheus.operator.podmonitors component on an Alloy deployment and define a monitoring.coreos.com/v1/PodMonitor CRD with the specs including:

scrapeProtocols:
    - PrometheusProto

The discovered target will ignore the protocol and use the default ones.

System information

x64_86 Google Kubernetes Engine

Software version

v1.11.0

Configuration

Alloy config snippet:


prometheus.operator.podmonitors "pods" {
	forward_to = [prometheus.remote_write.mimir.receiver]

	rule {
		action        = "keep"
		regex         = env("HOSTNAME")
		source_labels = ["__meta_kubernetes_pod_node_name"]
	}

	scrape {
		default_scrape_interval = "15s"
	}
}


PodMonitor resource:

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: [...]
  namespace: [...]
spec:
  podMetricsEndpoints:
    - interval: 15s
      path: /metrics
      port: http
  scrapeProtocols:
    - PrometheusProto
  selector:
    matchLabels:
     [...]

Logs

The Alloy agent does not log any errors.

Tip

React with 👍 if this issue is important to you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions