grafana / alloy

OpenTelemetry Collector distribution with programmable pipelines
https://grafana.com/oss/alloy
Apache License 2.0
1.01k stars 105 forks source link

Scrape custom pods #522

Open hmeerlo opened 1 year ago

hmeerlo commented 1 year ago

Hi the docs state the following:

The pod must not have an annotation matching prometheus.io/scrape: "false" (this wouldn't be there unless you explicitly add it or if you deploy a Helm chart that has it).
The pod must have a port with a name ending in -metrics. This is the port that will be scraped by the Agent. A lot of people using Helm struggle with this, since Helm charts don't usually follow this. You would need to add a new scrape config to scrape helm charts or find a way to tweak the Helm chart to follow this rules.
The pod must have a label named name with any non-empty value. Helm usually lets you add extra labels, so this is less of a problem for Helm users.
The pod must currently be running. (i.e., Kubernetes must not report it having a phase of Succeeded or Failed).

But it is unclear to me what is meant with a port with a name ending in -metrics. A pod only has a containerPort for as far as I know that doesn't have a name property.

hmeerlo commented 1 year ago

Oh and it seems to completely contradict the config mentioned here: https://grafana.com/docs/grafana-cloud/kubernetes-monitoring/configuration/

rfratto commented 1 year ago

👋 We'll take a look, thanks! Those instructions were written for our original Kubernetes manifests based on our Jsonnet library and we'll need to see if things have changed.

But it is unclear to me what is meant with a port with a name ending in -metrics. A pod only has a containerPort for as far as I know that doesn't have a name property.

Pods can have named ports:

image
kubectl explain pod.spec.containers.ports.name
rfratto commented 1 year ago

cc @karengermond for tracking whether we might have stale docs