Open xuanyuanaosheng opened 3 years ago
I have a similar problem, but the difference is that I use kube-prometheus-stack Chart.
What happened? I created a Probe custom resource,but the Operator did not discovery it
Description I think the Operator should be able to correctly discover Probe CRs.
There is no error log in Operator and Prometheus. Except Probe, ServiceMonitor and PorMonitor CRs can be dicover normally
Environment Version:k8s-1.19.2 kube-prometheus-stack:15.2.0
Additional explanation: Although blackbox-exporter Charts can be configured by setting the value of the .serviceMonitor.targets field, it is not as convenient as using Probe CRD
RESOLVE This IS my problem.I did not notice the prometheus.prometheusspec.probeSelectorNilUsesHelmValues field.
Any updates on this?
blackbox-exporter deployed via kube-prometheus is using two different endpoints for two different things. On port named https
we have blackbox exporter internal metrics and on probe
port we have the /probe
API allowing to probe other services. To use Probe
CR you need to ensure that:
I am marking this as help wanted in case anyone would like to contribute short documentation on the topic. Such a doc would be much appreciated!
@paulfantom Thanks for the help!
I'm still having trouble with my probe resource.
I have set the correct selectors for my prometheus resource, when I check kubectl get prometheus/prometheus-kube-prometheus-prometheus -o yaml
, I can see it has probeNamespaceSelector: {}
and probeSelector: {}
set. My probe resource looks like this:
apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
name: probe-demo
labels:
app: kube-prometheus-stack
chart: kube-prometheus-stack-10.1.0
heritage: Helm
release: prometheus
spec:
prober:
url: blackbox-exporter-prometheus-blackbox-exporter.svc:9115
module: http_2xx
targets:
staticConfig:
static:
- 'https://demo.do.prometheus.io'
- "https://google.com"
labels:
environment: prometheus.io
The probe url is the url of the blackbox service.
Am I missing something here?
This is the solution:
prometheus:
prometheusSpec:
serviceMonitorSelectorNilUsesHelmValues: false
podMonitorSelectorNilUsesHelmValues: false
probeSelectorNilUsesHelmValues: false
@JonasJW your config looks good. If this doesn't work, you need to check your RBAC rules.
I got the same issue, i have incl. label which is mentioned prometheus resource same in probe. its working for me.
Hi @xuanyuanaosheng, I have recently written an article regarding Blackbox exporter and Kubernetes: https://medium.com/cloud-native-daily/blackbox-exporter-to-probe-or-not-to-probe-57a7a495534b, which might help you. 😊
Hello, all, I have use the blackbox-exporter to do some probe: https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/blackbox-exporter.md
The probe yml is:
The serviceMonitor yml is
The service yml is
The service has two ports:
But the service monitor has only one (9115) to scrape:
The problem is I can not get the probe metrics like _probesuccess ? Does it have error in configuration?
I found that the name: probe (port: 19115) has no scrape, How to repaire this? whether to add a service monitor called probe?