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

Getting rid of default metrics #8739

Closed
bentcoder opened this issue Apr 19, 2021 · 1 comment
Closed

Getting rid of default metrics #8739

bentcoder opened this issue Apr 19, 2021 · 1 comment

Comments

@bentcoder
Copy link

Hi,

I am not sure if I am missing something in the documentation but is there a way of getting rid of default metrics such as coredns_*, go_*, process_* and scrape_* while using Prometheus in Kubernetes? My current config is below as follows.

Thanks

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole

metadata:
  name: monitoring

rules:
  - apiGroups: [""]
    resources: ["services", "pods", "endpoints"]
    verbs: ["get", "watch", "list"]
  - nonResourceURLs: ["/metrics"]
    verbs: ["get"]
global:
  scrape_interval: 15s
  scrape_timeout: 15s
  evaluation_interval: 1m
scrape_configs:
- job_name: application-metrics
  honor_timestamps: true
  scrape_interval: 15s
  scrape_timeout: 15s
  metrics_path: /metrics
  scheme: http
  follow_redirects: true
  relabel_configs:
  - separator: ;
    regex: __meta_kubernetes_service_label_(.+)
    replacement: $1
    action: labelmap
  - source_labels: [__meta_kubernetes_namespace]
    separator: ;
    regex: (.*)
    target_label: namespace
    replacement: $1
    action: replace
  - source_labels: [__meta_kubernetes_service_name]
    separator: ;
    regex: (.*)
    target_label: service
    replacement: $1
    action: replace
  kubernetes_sd_configs:
  - role: endpoints
    follow_redirects: true
@roidelapluie
Copy link
Member

Thanks for your report. It looks as if this is actually a question about usage and not development.

It makes more sense to ask questions like this on the prometheus-users mailing list or our forums rather than in a GitHub issue. In our community channels, more people are available to potentially respond to your question, and the whole community can benefit from the answers provided.

@prometheus prometheus locked as resolved and limited conversation to collaborators Nov 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants