通常使用kube-prometheus-stack这个 helm chart 来自建 Prometheus,在values.yaml中进行自定义配置然后安装到集群,其中可以配置 Prometheus 原生的scrape_config(非 CRD),配置方法是将自定义的scrape_config写到prometheus.prometheusSpec.additionalScrapeConfigs字段下,示例如下: prometheus: prometheusSpec: additionalScrapeConfi...
https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/additional-scrape-config.md?spm=a2c4g.11186623.0.0.2b735695FoJ93z&file=additional-scrape-config.md // 若job配置比较简单,可跳过这一步,直接编辑helm prometheus/prometheusSpec/additionalScrapeConfigs . 本文考虑到后续还会配置其...
name: prometheus-additional-configs key: prometheus-additional-config.yaml 关于additionalScrapeConfigs 属性的具体介绍,我们可以使用kubectl explain命令来了解详细信息: $ kubectl explain prometheus.spec.additionalScrapeConfigs KIND: Prometheus VERSION: monitoring.coreos.com/v1 RESOURCE: additionalScrapeConfigs<Objec...
安装prometheus的方法:在官网下载后解压运行./prometheus--config.file=prometheus.yml 修改单机版的配置相对操作比较简单,有两种: 1.直接在prometheus的配置文件prometheus.yml中指定要采集的点。 scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this conf...
1、创建prometheus-additional.yaml配置文件 新增prometheus 在 Kubernetes 下的自动服务发现 prometheus-additional.yaml -job_name:'dev-kubernetes-endpoints'scrape_interval:10sscrape_timeout:10smetrics_path:(.*)/actuator/prometheusscheme:httprelabel_configs:-action:keepregex:truesource_labels:-__meta_kubernetes...
官网地址:https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/additional-scrape-config.md cat prometheus-additional.yaml - job_name: 'blackbox' metrics_path: /probe params: module: [http_2xx] # Look for a HTTP 200 response. ...
prometheus 文件配置项scrape_config详解:static_configs、file_sd_configs、relabel_configs、metric_reabel_configs 在网上看到一个一篇文章,介绍prometheus配置文件,非常的详细,所以抄了一遍,方便查看 原文地址:https://soulchild.cn/1963.html
https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/additional-scrape-config.md 使用原生的prometheus时, 我们创建 job 直接修改配置文件即可, 然而在 prometheus-operator 中所有的配置都抽象成了 k8sCRD资源, 手动配置 job 需要: ...
secret"additional-configs"created 3、声明 prometheus 的资源对象文件中添加上这个额外的配置:(prometheus-prometheus.yaml) 添加: additionalScrapeConfigs: name: additional-configs key: prometheus-additional.yaml apiVersion:monitoring.coreos.com/v1 kind:Prometheus ...
修改后的additionalScrapeConfigs字段如下: additionalScrapeConfigs: # Scrape config for envoy stats - job_name: 'envoy-stats' metrics_path: /stats/prometheus kubernetes_sd_configs: - role: pod relabel_configs: - source_labels: [__meta_kubernetes_pod_container_port_name] action: keep regex: ...