@@ -564,10 +564,12 @@ alertmanager:
564564 # # app: my-app
565565 # #
566566 selector : {}
567- drycc :
567+
568+ containerScrape :
568569 token : xxxxx
569570 url : xxxx
570571 scheme : https
572+ namespaces : []
571573# # @section Prometheus server Parameters
572574# #
573575# # Drycc Prometheus image
@@ -641,6 +643,24 @@ server:
641643 - job_name: addons
642644 {{- include "addons.ds_scrape_config" (dict "context" $) | nindent 4 }}
643645 {{- end }}
646+
647+ {{ $scheme := .Values.containerScrape.scheme }}
648+ {{ $token := .Values.containerScrape.token }}
649+ {{ $url := .Values.containerScrape.url }}
650+ {{- range $namespace := .Values.containerScrape.namespaces }}
651+
652+ {{- if $namespace }}
653+ - job_name: 'jobns-%s {{ $namespace }}'
654+ scheme: {{ $scheme }}
655+ metrics_path: /v2/apps/{{ $namespace }}/metrics
656+ authorization:
657+ type: Token
658+ credentials: {{ $token }}
659+ static_configs:
660+ - targets: [ {{ $url }} ]
661+ {{- end }}
662+ {{- end }}
663+
644664 {{- if .Values.server.extraScrapeConfigs}}
645665 {{- include "common.tplvalues.render" (dict "value" .Values.server.extraScrapeConfigs "context" $) | nindent 2 }}
646666 {{- end }}
@@ -657,7 +677,7 @@ server:
657677 static_configs:
658678 - targets: [ "{{ printf "%s.%s.svc.%s:%d" (include "prometheus.alertmanager.fullname" .) (include "common.names.namespace" .) .Values.clusterDomain (int .Values.alertmanager.service.ports.http) }}" ]
659679 {{- end }}
660-
680+
661681 # # @param server.alertingRules Prometheus alerting rules. This content will be stored in the the rules.yaml file and the content can be a template.
662682 # # ref: <https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/>
663683 # #
@@ -666,16 +686,9 @@ server:
666686 # # @param server.extraScrapeConfigs Promethus configuration, useful to declare new scrape_configs. This content will be merged with the 'server.configuration' value and stored in the the prometheus.yaml file.
667687 # # ref: <https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config>
668688 # #
669- extraScrapeConfigs :
670- - job_name : ' containers'
671- scheme : ' {{ .Values.drycc.scheme }}'
672- metrics_path : /v2/apps/{{ include "common.names.namespace" . }}/metrics
673- authorization :
674- type : Token
675- credentials : ' {{ .Values.drycc.token }}'
676- static_configs :
677- - targets : [ '{{ .Values.drycc.url }}' ]
678-
689+
690+ extraScrapeConfigs : []
691+
679692 # # @param server.replicaCount Number of Prometheus replicas to deploy
680693 # #
681694 replicaCount : 1
0 commit comments