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
[Exporter] How to use the blackbox_exporter with prometheus-operator? #256
Comments
We ultimately want to have blackbox probing fully-integrated. Right now you'd have to achieve this by using a custom Prometheus configuration with your operator. You can do so by omitting the serviceMonitorSelector. For a deeper integration, we have to understand the different use cases better. Can you elaborate a bit on which things you want to blackbox probe? |
Thanks for the hints at using a custom configuration for this! I was thinking about a) cluster internal and b) external blackbox probing (tcp, icmp, http, https). |
Also interested in this, and we're currently using blackbox exporter to monitor availability for external services to give us a bit of a clearer picture of what a user is seeing until the rest of our monitoring shapes up. Current workaround is having a second Prometheus instance with a custom configuration that sends to our alertmanager. |
Me too... I'm trying to figure out how to monitor things external to the k8s cluster. I.E. WMI exporter and Node Exporter for nodes in our regular VM environment, and snmp and blackbox exporter for ping/snmp monitoring of other devices on our network. |
@MattMencel anything not running as part of the Kubernetes cluster or in it is a use case for a custom Prometheus configuration. You can specify your own configuration by skipping the |
Yeah that's where I got stuck. I'm still pretty new to prometheus and k8s. For now I've got an external prometheus VM where I'm doing some of this monitoring. Eventually I'm wanting to move it all into the k8s cluster. Thanks! |
I'm starting to monitor external services with blackbox and operator so I got onto this issue. My proposal for this issue and for others that will not be managed by operator is to accept a job append configuration. The Prometheus
Configmap
|
@gianrubio +1 for the appendJob idea; that's exactly what I'm looking for. I like the simplicity of ServiceMonitors and would like to use them in most cases, but there are a few jobs in my existing (non-Operator) Prometheus I'd like to carry across, such as monitoring the external etcd used by Kube masters, which can't be expressed as a ServiceMonitor. |
@grrywlsn actually in that case what you want to do is create an This issue is about actually blackbox probing your applications. For example performing real HTTP requests on your application to see whether it is responding the way you expect. |
@gianrubio the point of the Prometheus Operator is to provide sensible abstractions for Prometheus. Your suggestion starts a bit too low level. We want to build abstractions that are higher up, so people don't need to know the Prometheus/blackbox exporter configuration paradigms. |
@brancz awesome, thanks for that example! it wasn't all that obvious from the docs that I could see. |
@grrywlsn docs contributions are always welcome! 🙂 If anything is not as clear as it should be we're happy about PRs! |
Good to know. I'm working on moving our Prometheus deployments to Prometheus Operator deployments at the moment, so would be happy to update when we've got something good. |
@brancz so do you think operator will be responsible to manage blackbox-export as same way it take care of alertmanager? What about a statefulset implementation of blackbox exporter? |
The blackbox exporter doesn't have any state of its own, so a StatefulSet would be exaggerated, but some kind of abstraction would make sense, however, currently I am thinking of mainly abstracting the way the blackbox exporter is configured, rather than how it is run. I believe that the integration will look something like the integration of the Alertmanager in the Prometheus object, where we loosely reference a blackbox exporter running behind a specific |
@brancz I wrote a draft to manage blackbox exporter with prometheus operator as a tpr. Suggestions are welcomed |
@gianrubio Nice draft, but exactly do you mean with the question 1, "the http protocol (http x http) on the service spec"? Should it mean http and https? |
@galexrt it was a typo, fixed now! |
@gianrubio How about changing the
For http probe the address would contain Edit: Just saw that the |
@gianrubio thanks a lot for your effort. I was two weeks on vacation, and am catching up on everything as quickly as I can. I have some comments regarding the proposal.
|
@brancz were you able to add documentation on custom configuration as a workaround for this or can you point me to one? I am wanting to use |
@Punitag I haven't found the time, but the tl;dr is that you skip the |
@brancz Bit is it possible to add custom job config for specifi service monitor? |
For the time being I would recommend to use a custom prometheus config to run the blackbox exporter. We'll eventually have to figure out a meaningful abstraction to use it, but we're not there yet. |
Yes but is it possible to use custom promethues config with prometheus-operator? |
Yes we have a documentation page on this: https://github.com/coreos/prometheus-operator/blob/master/Documentation/custom-configuration.md |
Have you an example o using it? |
I'm not sure I understand the question. The |
I struggled figuring out how to get this working too. I ended up with a I'd like to help out with some docs around this as it wasn't very clear. blackbox_exporter Deployment{
"apiVersion": "apps/v1beta1",
"kind": "Deployment",
"metadata": {
"name": "blackbox-exporter",
"namespace": "legacy"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "blackbox-exporter"
}
},
"template": {
"metadata": {
"labels": {
"app": "blackbox-exporter"
}
},
"spec": {
"containers": [
{
"image": "registry/blackbox-exporter:v0.11.0",
"name": "blackbox-exporter",
"ports": [
{
"containerPort": 9115,
"name": "metrics"
}
]
}
]
}
}
}
} blackbox_exporter Service{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"labels": {
"app": "blackbox-exporter"
},
"name": "blackbox-exporter",
"namespace": "legacy"
},
"spec": {
"ports": [
{
"name": "http-metrics",
"port": 9115,
"protocol": "TCP",
"targetPort": "metrics"
}
],
"selector": {
"app": "blackbox-exporter"
}
}
} {
"apiVersion": "monitoring.coreos.com/v1",
"kind": "ServiceMonitor",
"metadata": {
"labels": {
"k8s-app": "blackbox-exporter"
},
"name": "blackbox-exporter",
"namespace": "tectonic-system"
},
"spec": {
"endpoints": [
{
"interval": "60s",
"port": "http-metrics"
},
{
"interval": "60s",
"params": {
"module": [
"http_2xx"
],
"target": [
"10.10.1.120:9200"
]
},
"path": "/probe",
"targetPort": 9115
}
],
"namespaceSelector": {
"matchNames": [
"legacy"
]
},
"selector": {
"app": "blackbox-exporter"
}
}
} |
This issue has been automatically marked as stale because it has not had any activity in last 60d. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had any activity in last 60d. Thank you for your contributions. |
There is still work to be done to have a first class support for blackbox probing. |
This issue has been automatically marked as stale because it has not had any activity in last 60d. Thank you for your contributions. |
#2832 is working on this API. Hopefully soon coming to your prometheus-operator deployments! :) |
This issue has been automatically marked as stale because it has not had any activity in last 60d. Thank you for your contributions. |
Hi @iroller
Prometheus additional-scrape-configs
Error In Prometheus Targets |
This issue has been automatically marked as stale because it has not had any activity in last 60d. Thank you for your contributions. |
#2832 is progressing nicely :) |
Since we merged #2832 we can close this issue for now. If there is anything missing for this feature or bugs feel free to open a new issue. 🎉 |
For future googlers:
custom.values.yaml
|
To make the above solution work, you also need to configure prometheus as written in the note here.
Another solution is to use
|
Here now Blackbox IngressProbe |
…es-master MON-3479: [bot] Bump openshift/prometheus-operator to v0.69.1
The blackbox_exporter requires
targets
andparams
to be set for the exporter to report data.See the example configuration for prometheus: https://github.com/prometheus/blackbox_exporter#prometheus-configuration
Is there a way to achieve a config like the above with
prometheus-operator
and how?If it is achievable, it would be nice to add it to the user-guides, as I'm definitely not the only one interested in running the blackbox_exporter.
The text was updated successfully, but these errors were encountered: