Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Kubernetes annotations to configure kubernetes_sd #2989

Closed
roidelapluie opened this Issue Jul 25, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@roidelapluie
Copy link
Contributor

roidelapluie commented Jul 25, 2017

I propose that we take advantages of kubernetes annotations to configure scraping per pod/service:

---
apiVersion: v1
kind: DeploymentConfig
metadata:
  name: foo
  labels:
    app: foo
spec:
  replicas: 1
  template:
    metadata:
      annotations:
        prometheus.io/path: '/metrics'
      labels:
        app: foo
    spec:
      containers:
      - name: foo
        image: foo:latest
        ports:
        - containerPort: 8080
@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 28, 2017

Pod annotations are provided as meta labels on discovered pod targets.
So this is something you should be able to do via relabeling configurations as it is today.

@roidelapluie

This comment has been minimized.

Copy link
Contributor Author

roidelapluie commented Jul 28, 2017

I mean, to get the prometheus endpoint, the path where it fetches metrics

@roidelapluie

This comment has been minimized.

Copy link
Contributor Author

roidelapluie commented Jul 28, 2017

You need to know the path before you scrape

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 28, 2017

@matthiasr

This comment has been minimized.

Copy link
Contributor

matthiasr commented Jul 29, 2017

This is already included in the example configuration so there is nothing to do here.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.