Thanks for the response.
I have configured static and sd both as different job and when I am hitting SD job, I am getting targets as all the services inside the cluster but they are throwing 400 or 404 error but when I check the logs, the status is 200.
I am attaching job for your reference. Let me know if I am missing something. I also tried to check connection by going into blackbox-exporter pod but it is still throwing same error. I have put all under same namespace to avoid any communication failure.
- job_name: "blackbox-kubernetes-services"
metrics_path: /probe
params:
module: [http_2xx]
kubernetes_sd_configs:
- role: service
relabel_configs:
# Example relabel to probe only some services that have "
example.io/should_be_probed = true" annotation
# - source_labels: [__meta_kubernetes_service_annotation_example_io_should_be_probed]
# action: keep
# regex: true
- source_labels: [__address__]
target_label: __param_target
- target_label: __address__
replacement: prometheus-blackbox-exporter:9115
- source_labels: [__param_target]
target_label: instance
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_service_name]
target_label: kubernetes_service_name