Closed urbaman closed 2 months ago
@urbaman: Thanks for opening an issue, it is currently awaiting triage.
If you haven't already, please provide the following information:
bug
, enhancement
or documentation
agent
, appsec
, configuration
, cscli
, local-api
In the meantime, you can:
@urbaman: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.
/kind bug
/kind documentation
/kind enhancement
And this cannot be achieved via these labels?
I guess not? https://github.com/crowdsecurity/helm-charts/blob/main/charts/crowdsec/templates/agent-serviceMonitor.yaml btw I dont use k8s so just trying to probe more information.
No, they should be added in the servicemonitor templates (the one you pointed to for example) in the metadata section, something like this:
Template:
metadata:
name: {{ .Release.Name }}-agent-service
namespace: {{ .Release.Namespace }}
labels:
{{- include "podLabels" . | nindent 4 }}
app.kubernetes.io/component: agent
{{- if .Values.agent.metrics.serviceMonitor.additionalLabels }}
{{ toYaml .Values.agent.metrics.serviceMonitor.additionalLabels | indent 4 }}
{{- end }}
values.yaml:
metrics:
enabled: false
# -- Creates a ServiceMonitor so Prometheus will monitor this service
# -- Prometheus needs to be configured to watch on all namespaces for ServiceMonitors
# -- See the documentation: https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack#prometheusioscrape
# -- See also: https://github.com/prometheus-community/helm-charts/issues/106#issuecomment-700847774
serviceMonitor:
enabled: false
additionalLabels: {}
For both serviceMonitors.
Please add an additionalLabels: tag to serviceMonitors, so people is able to add labels scraped by prometheus with prometheus.
Example: