-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VictoriaMetrics ScrapeConfig #812
VictoriaMetrics ScrapeConfig #812
Comments
@Sam-Sundar Maybe this PR fix |
@dongjiang1989 i tried it, no luck. Earlier atlease |
What is the new ServiceMonitor in https://github.com/prometheus-community/helm-charts/releases/tag/prometheus-mysql-exporter-2.5.1 ? In addition to probe collection, is there also metric collection? @Sam-Sundar |
Hey @dongjiang1989 , I did apply the changes even before the PR got merged and also tried now by pulling the changes thro' helm. No luck. Now both When i try to search for mysql metric in prometheus, i'm not able to find any. |
In the prometheus target list, are |
Hey @dongjiang1989, this is my mysql-exporter target. {
"discoveredLabels": {
"__address__": "10.68.4.21:9104",
"__meta_kubernetes_endpoint_address_target_kind": "Pod",
"__meta_kubernetes_endpoint_address_target_name": "mysql-exporter-prometheus-mysql-exporter-67d44746b6-58qkx",
"__meta_kubernetes_endpoint_node_name": "gke-justcall-staging-infra-node-pool-136d9490-qcbs",
"__meta_kubernetes_endpoint_port_name": "mysql-exporter",
"__meta_kubernetes_endpoint_port_protocol": "TCP",
"__meta_kubernetes_endpoint_ready": "true",
"__meta_kubernetes_endpoints_label_app_kubernetes_io_instance": "mysql-exporter",
"__meta_kubernetes_endpoints_label_app_kubernetes_io_managed_by": "Helm",
"__meta_kubernetes_endpoints_label_app_kubernetes_io_name": "prometheus-mysql-exporter",
"__meta_kubernetes_endpoints_label_app_kubernetes_io_version": "v0.15.1",
"__meta_kubernetes_endpoints_label_helm_sh_chart": "prometheus-mysql-exporter-2.4.0",
"__meta_kubernetes_endpoints_labelpresent_app_kubernetes_io_instance": "true",
"__meta_kubernetes_endpoints_labelpresent_app_kubernetes_io_managed_by": "true",
"__meta_kubernetes_endpoints_labelpresent_app_kubernetes_io_name": "true",
"__meta_kubernetes_endpoints_labelpresent_app_kubernetes_io_version": "true",
"__meta_kubernetes_endpoints_labelpresent_helm_sh_chart": "true",
"__meta_kubernetes_endpoints_name": "mysql-exporter-prometheus-mysql-exporter",
"__meta_kubernetes_namespace": "monitoring",
"__meta_kubernetes_pod_annotation_checksum_credentials": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
"__meta_kubernetes_pod_annotation_kubectl_kubernetes_io_restartedAt": "2024-03-21T00:55:37+05:30",
"__meta_kubernetes_pod_annotation_prometheus_io_path": "/metrics",
"__meta_kubernetes_pod_annotation_prometheus_io_port": "9104",
"__meta_kubernetes_pod_annotation_prometheus_io_scrape": "true",
"__meta_kubernetes_pod_annotationpresent_checksum_credentials": "true",
"__meta_kubernetes_pod_annotationpresent_kubectl_kubernetes_io_restartedAt": "true",
"__meta_kubernetes_pod_annotationpresent_prometheus_io_path": "true",
"__meta_kubernetes_pod_annotationpresent_prometheus_io_port": "true",
"__meta_kubernetes_pod_annotationpresent_prometheus_io_scrape": "true",
"__meta_kubernetes_pod_container_image": "quay.io/prometheus/mysqld-exporter:v0.15.1",
"__meta_kubernetes_pod_container_name": "prometheus-mysql-exporter",
"__meta_kubernetes_pod_container_port_number": "9104",
"__meta_kubernetes_pod_container_port_protocol": "TCP",
"__meta_kubernetes_pod_controller_kind": "ReplicaSet",
"__meta_kubernetes_pod_controller_name": "mysql-exporter-prometheus-mysql-exporter-67d44746b6",
"__meta_kubernetes_pod_host_ip": "10.128.0.23",
"__meta_kubernetes_pod_ip": "10.68.4.21",
"__meta_kubernetes_pod_label_app_kubernetes_io_instance": "mysql-exporter",
"__meta_kubernetes_pod_label_app_kubernetes_io_name": "prometheus-mysql-exporter",
"__meta_kubernetes_pod_label_pod_template_hash": "67d44746b6",
"__meta_kubernetes_pod_labelpresent_app_kubernetes_io_instance": "true",
"__meta_kubernetes_pod_labelpresent_app_kubernetes_io_name": "true",
"__meta_kubernetes_pod_labelpresent_pod_template_hash": "true",
"__meta_kubernetes_pod_name": "mysql-exporter-prometheus-mysql-exporter-67d44746b6-58qkx",
"__meta_kubernetes_pod_node_name": "gke-justcall-staging-infra-node-pool-136d9490-qcbs",
"__meta_kubernetes_pod_phase": "Running",
"__meta_kubernetes_pod_ready": "true",
"__meta_kubernetes_pod_uid": "a8e8e4f0-aa6d-40f0-8f16-0d324b774e19",
"__meta_kubernetes_service_annotation_cloud_google_com_neg": "{\"ingress\":true}",
"__meta_kubernetes_service_annotation_meta_helm_sh_release_name": "mysql-exporter",
"__meta_kubernetes_service_annotation_meta_helm_sh_release_namespace": "monitoring",
"__meta_kubernetes_service_annotationpresent_cloud_google_com_neg": "true",
"__meta_kubernetes_service_annotationpresent_meta_helm_sh_release_name": "true",
"__meta_kubernetes_service_annotationpresent_meta_helm_sh_release_namespace": "true",
"__meta_kubernetes_service_label_app_kubernetes_io_instance": "mysql-exporter",
"__meta_kubernetes_service_label_app_kubernetes_io_managed_by": "Helm",
"__meta_kubernetes_service_label_app_kubernetes_io_name": "prometheus-mysql-exporter",
"__meta_kubernetes_service_label_app_kubernetes_io_version": "v0.15.1",
"__meta_kubernetes_service_label_helm_sh_chart": "prometheus-mysql-exporter-2.4.0",
"__meta_kubernetes_service_labelpresent_app_kubernetes_io_instance": "true",
"__meta_kubernetes_service_labelpresent_app_kubernetes_io_managed_by": "true",
"__meta_kubernetes_service_labelpresent_app_kubernetes_io_name": "true",
"__meta_kubernetes_service_labelpresent_app_kubernetes_io_version": "true",
"__meta_kubernetes_service_labelpresent_helm_sh_chart": "true",
"__meta_kubernetes_service_name": "mysql-exporter-prometheus-mysql-exporter",
"__metrics_path__": "/metrics",
"__scheme__": "http",
"__scrape_interval__": "15s",
"__scrape_timeout__": "10s",
"__tmp_prometheus_job_name": "serviceMonitor/justcall-iq-ai/prometheus-oper-istio-controlplane/0"
}
} |
Fixed it by creating a VMServicescrape and adding scrapeconfig to VictoriaMetrics. {{- if .Values.serviceMonitor.enabled }}
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
name: {{ template "prometheus-mysql-exporter.fullname" . }}
labels:
{{- include "prometheus-mysql-exporter.labels" . | nindent 4 }}
{{- if .Values.serviceMonitor.additionalLabels }}
{{ toYaml .Values.serviceMonitor.additionalLabels | indent 4 }}
{{- end }}
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
spec:
namespaceSelector:
matchNames:
{{- if .Values.serviceMonitor.namespaceSelector }}
{{- with .Values.serviceMonitor.namespaceSelector }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- else }}
- {{ include "prometheus-mysql-exporter.namespace" . }}
{{- end }}
selector:
matchLabels:
{{- include "prometheus-mysql-exporter.selectorLabels" . | nindent 6 }}
{{- with .Values.serviceMonitor.jobLabel }}
jobLabel: {{ . | quote}}
{{- end }}
{{- with .Values.serviceMonitor.targetLabels }}
targetLabels:
{{ toYaml . | trim | indent 4 -}}
{{- end }}
{{- with .Values.serviceMonitor.podTargetLabels }}
podTargetLabels:
{{ toYaml . | trim | indent 4 -}}
{{- end }}
endpoints:
{{- if .Values.serviceMonitor.multipleTarget.enabled }}
{{- range .Values.serviceMonitor.multipleTarget.targets }}
- path: /probe
port: {{ $.Values.service.name }}
{{- if $.Values.serviceMonitor.interval }}
interval: {{ $.Values.serviceMonitor.interval }}
{{- end }}
{{- if $.Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ $.Values.serviceMonitor.scrapeTimeout }}
{{- end }}
metricRelabelConfigs:
- action: replace
replacement: {{ .endpoint }}
sourceLabels: [instance]
targetLabel: instance
- action: replace
replacement: {{ .name }}
sourceLabels: [target]
targetLabel: target
{{- if $.Values.serviceMonitor.metricRelabelings -}}
{{ toYaml $.Values.serviceMonitor.metricRelabelings | nindent 8 }}
{{- end }}
{{- if $.Values.serviceMonitor.relabelings }}
relabelings: {{ toYaml $.Values.serviceMonitor.relabelings | nindent 8 }}
{{- end }}
params:
target:
- {{ .endpoint }}:{{ .port | default 3306 }}
{{- if $.Values.serviceMonitor.multipleTarget.sharedSecret.enabled }}
auth_module:
- client.{{ $.Values.serviceMonitor.multipleTarget.sharedSecret.name }}
{{- else }}
auth_module:
- client.{{ .name }}
{{- end }}
{{- end }}
{{- end }}
- path: /metrics
port: {{ .Values.service.name }}
{{- if .Values.serviceMonitor.interval }}
interval: {{ .Values.serviceMonitor.interval }}
{{- end }}
{{- if .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.serviceMonitor.metricRelabelings }}
metricRelabelings: {{ toYaml .Values.serviceMonitor.metricRelabelings | nindent 8 }}
{{- end }}
{{- if .Values.serviceMonitor.relabelings }}
relabelings: {{ toYaml .Values.serviceMonitor.relabelings | nindent 8 }}
{{- end }}
{{- end }} ScrapeConfig
|
Host operating system: output of
uname -a
: Kubernetesmysqld_exporter version: output of
mysqld_exporter --version
: v0.15.1MySQL server version: 5.7
mysqld_exporter command line flags
What did you do that produced an error?
I have installed mysqld exporter with helm chart and below is my values.yaml file.
The helm chart created a servicemonitor, and i also created and applied a scrape config like below.
Below is my ServiceMonitor
But after applying all these, i could only see the metrics in VM which will be present in
/metrics
endpoint which are mysql exporter's metrics and not the/probe
endpoint metrics. Due to this we are not able to see any of the useful metrics which we would like to. Any help here would be greatly appreciated :)PS: Although, curl request with
/probe&target=
gets the metrics, i suspect issue with ServiceMonitor and ScrapeConfigs.What did you expect to see?
All the metrics from
/probe
endpoint.What did you see instead?
Metrics from
/metrics
endpoint.The text was updated successfully, but these errors were encountered: