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

feat: add Prometheus labels #7749

Merged
merged 5 commits into from
May 22, 2023
Merged

Conversation

ColdFire87
Copy link
Contributor

Hi,

This PR adds labeling support for ServiceMonitor endpoints. Those labels end up on the jobs/targets, and can be used to group jobs. E.g. can add a department & team label:

serviceMonitor:
  enabled: true
  endpoints:
    relabelings:
      - targetLabel: department
        replacement: "Foo"
      - targetLabel: team
        replacement: "Bar"

This can then be used in Grafana dashboards to group jobs by labels (or add variables to filter):

group by(job) (up{team="Foo"})

EDIT: This is the same PR as #7720, but I had to sync the changes into my fork, which forced the closure of the previous PR.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 21, 2023
@ColdFire87
Copy link
Contributor Author

/assign @desaintmartin

@desaintmartin
Copy link
Member

@maciaszczykm could you trigger CI pipeline?

@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Merging #7749 (f88e3e0) into master (dfd20b4) will increase coverage by 0.17%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #7749      +/-   ##
==========================================
+ Coverage   42.01%   42.19%   +0.17%     
==========================================
  Files         163      218      +55     
  Lines       10827    12099    +1272     
  Branches        0      179     +179     
==========================================
+ Hits         4549     5105     +556     
- Misses       6031     6709     +678     
- Partials      247      285      +38     

Copy link
Member

@desaintmartin desaintmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It works this time!
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ColdFire87, desaintmartin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2023
@k8s-ci-robot k8s-ci-robot merged commit ac5da43 into kubernetes:master May 22, 2023
14 checks passed
@ColdFire87
Copy link
Contributor Author

thanks everyone 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants