Skip to content

Commit

Permalink
Update version and add scrapeconfig.yaml (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoQuote authored Apr 1, 2024
1 parent dc866a2 commit 5dc60d9
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/tencentcloud-info-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.2.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
23 changes: 23 additions & 0 deletions charts/tencentcloud-info-exporter/templates/scrapeconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.scrapeConfig.enabled }}
apiVersion: monitoring.coreos.com/v1alpha1
kind: ScrapeConfig
metadata:
labels:
{{ include "tencentcloud-info-exporter.labels" . | indent 4 }}
name: {{ template "tencentcloud-info-exporter.fullname" . }}
spec:
staticConfigs:
- targets:
- {{ include "tencentcloud-info-exporter.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.port }}
metricsPath: {{ .Values.scrapeConfig.telemetryPath }}
{{- if .Values.scrapeConfig.relabelings }}
relabelings:
{{ toYaml .Values.scrapeConfig.relabelings | indent 4 }}
{{- end }}
{{- if .Values.scrapeConfig.metricRelabelings }}
metricRelabelings:
{{ toYaml .Values.scrapeConfig.metricRelabelings | indent 4 }}
{{- end }}
scrapeInterval: {{ .Values.scrapeConfig.interval }}
scrapeTimeout: {{ .Values.scrapeConfig.timeout }}
{{- end }}
16 changes: 16 additions & 0 deletions charts/tencentcloud-info-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@ serviceMonitor:
# targetLabels: []
# metricRelabelings: []

scrapeConfig:
# Use https://prometheus-operator.dev/docs/user-guides/scrapeconfig/ to congfigure scrapeConfig
# It is advbised to use scrapeConfig instead of servicemonitor, as it is more flexible
# ServiceMonitor and scrapeConfig can be enabled at the same time, but it is not recommended
# When set true then use a ScrapeConfig to configure scraping
enabled: false
timeout: 10s
interval: 1m
telemetryPath: /metrics
relabelings:
- regex: 'container|endpoint|pod|service|instance'
action: "labeldrop"
metricRelabelings:
- regex: 'instance'
action: "labeldrop"

## Custom PrometheusRules to be defined
## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart
## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions
Expand Down

0 comments on commit 5dc60d9

Please sign in to comment.