GithubHelp home page GithubHelp logo

done about kube-prometheus HOT 8 CLOSED

zyz-1998 avatar zyz-1998 commented on July 17, 2024
done

from kube-prometheus.

Comments (8)

slashpai avatar slashpai commented on July 17, 2024

This looks to be question for kube-prometheus config

Did you check https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizing.md?

from kube-prometheus.

zyz-1998 avatar zyz-1998 commented on July 17, 2024

Is this scenario unable to be solved through prometheus-operator ? What methods can you recommend? Thank you.

from kube-prometheus.

zyz-1998 avatar zyz-1998 commented on July 17, 2024

This looks to be question for kube-prometheus config

Did you check https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizing.md?

The kube-prometheus has been deployed in the production environment. I hope it can be modified on the existing basis. What are the ways? Thank you.

from kube-prometheus.

slashpai avatar slashpai commented on July 17, 2024

https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.RelabelConfig is available if you want to add new relabelling. IIUC you are asking how to do this since you deploy operator through kube-prometheus?

from kube-prometheus.

zyz-1998 avatar zyz-1998 commented on July 17, 2024

如果您想添加新的重新标签,可以使用 https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.RelabelConfig。IIUC 您问如何做到这一点,因为您通过 kube-prometheus 部署了 operator?

We are from different teams. The previously deployed personnel have left. The current production environment is deployed with kube-prometheus version 0.8. We currently want the indicators collected by kube-state-metrics to be processed based on the external relationship file json, but the configuration of prometheus is done by Prometheus. Generated by operator, that is, the secret in the monitor and Prometheus.yaml.gz in prometheus-k8s. At present, I have not found the location to change the configuration. It seems that I can only redeploy it.

from kube-prometheus.

zyz-1998 avatar zyz-1998 commented on July 17, 2024

https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.RelabelConfig is available if you want to add new relabelling. IIUC you are asking how to do this since you deploy operator through kube-prometheus?

Would you like to know how to modify the prometheus configuration file deployed by prometheus-operator and ensure that it takes effect permanently? The current one is the default - --config.file=/etc/prometheus/config_out/prometheus.env.yaml. Thank you very much.

from kube-prometheus.

simonpasquier avatar simonpasquier commented on July 17, 2024

The scrape configuration comes from a ServiceMonitor object which you'd need to modify.
If the installation has been made via kube-prometheus, the object is named "kube-state-metrics":

kubectl get -n monitoring servicemonitors kube-state-metrics

from kube-prometheus.

zyz-1998 avatar zyz-1998 commented on July 17, 2024

The scrape configuration comes from a ServiceMonitor object which you'd need to modify. If the installation has been made via kube-prometheus, the object is named "kube-state-metrics":

kubectl get -n monitoring servicemonitors kube-state-metrics

image

The scrape configuration comes from a ServiceMonitor object which you'd need to modify. If the installation has been made via kube-prometheus, the object is named "kube-state-metrics":

kubectl get -n monitoring servicemonitors kube-state-metrics

Thanks for your help, but there still seems to be a problem
I edited kubeStateMetrics-serviceMonitor.yaml and added the following:
`
relabelings:
- action: labeldrop
regex: (pod|service|endpoint|namespace)

 - sourceLabels: [app]
   regex: nginx
   replacement: 'my-nginx-test'
   targetLabel: module

 - sourceLabels: [label_app]
   regex: nginx
   replacement: 'my-nginx-test-label'
   targetLabel: module

 - sourceLabels: [app]
   regex: tip-1
   replacement: '\u540e\u7aef\u6a21\u5757'
   targetLabel: module

 - sourceLabels: [app]
   regex: tip-2
   replacement: '\u524d\u7aef\u6a21\u5757'
   targetLabel: module

`
Enter the prometheus container and you can see that it has taken effect, but it seems that the indicators still have not changed.

image
image

from kube-prometheus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.