Comments (9)
Any idea how this could work?
Regrettably I cannot help with that directly. I recall that snmp_exporter is using the same pattern (i.e., a target
url parameter). So you might get pointers on how to configure service discovery by looking for examples of snmp_exporter
deployments using kubernetes.
from prometheus-pve-exporter.
Just guessing wildly, do you maybe set metrics_path: /pve?target=x.x.x.x
in prometheus.yml
? That would at least explain the percent encoding.
from prometheus-pve-exporter.
No, I don't set anything in prometheus.yml. This is discovered through yaml file of your container, which prometheus on k8s auto-detects out of the box using annotations on the pod template. The below config for your container ended up being properly auto-detected by prometheus, except for the ? being escaped.
apiVersion: apps/v1
kind: Deployment
metadata:
name: proxmox-exporter
namespace: prometheus
spec:
replicas: 1
selector:
matchLabels:
app: proxmox-exporter
template:
metadata:
labels:
app: proxmox-exporter
annotations:
prometheus.io/scrape: 'true'
prometheus.io/path: "/pve?target=1.2.3.4"
prometheus.io/port: '9221'
prometheus.io/scheme: 'http'
spec:
containers:
- name: proxmox-exporter
image: prompve/prometheus-pve-exporter
volumeMounts:
- name: proxmox-exporter-config
mountPath: /etc/pve.yml
subPath: pve.yml
volumes:
- name: proxmox-exporter-config
configMap:
name: proxmox-exporter-config
When I used the prometheus-operator helm chart, it supported a serviceMonitor yaml file for discovery, where you could pass this data slightly differently, but that doesnt seem to work with annotations.
- port: proxmox-exporter
path: /pve
params:
target:
- 192.168.1.12
interval: 15s
Would it be possible to maybe allow for a second routing options like http://foo.bar/pve/1.2.3.4 , that might solve the issue. But I totally understand if thats too much hassle, and like I said, I just ended up using a scraper config so there is not an issue as much.
from prometheus-pve-exporter.
Right. I guess that prometheus.io/path: "/pve?target=1.2.3.4"
annotation ended up in metrics_path
. Could you try and set the annotation to prometheus.io/path: "/pve"
and instead inject the param via job
configuration in prometheus.yml
. I.e.:
- job_name: "my-prometheus-pve-job"
kubernetes_sd_configs:
- role: endpoints
params:
target:
- 192.168.1.12
from prometheus-pve-exporter.
I might be missing the whole picture regarding the kube setup, but I bet there is a way to supply url parameters either via annotations or job configuration to the exporter. There is also blackbox_exporter which has the same requirement and I bet that people are running that in kubernetes as well.
from prometheus-pve-exporter.
I looked at the blackbox exporter and in the prometheus scraper config it specifically allows for a target to be set through a k8s label:
- source_labels: [__address__]
target_label: __param_target
The default service/pod scrapers don't, because I guess most metrics targets don't need params. So I'd have to either make my own kubernetes_sd_config specifically for pve_exporter (then I might as well keep my current pve scraper), or see if I can modify the existing sd scraper to allow for (arbitrary) params.
It's not really a big deal, it just seems that out of the box this specific container can't be service-discovered as-is by a default prometheus k8s install.
from prometheus-pve-exporter.
Ok, I managed to fix this in the existing kubernetes_sd scraper by adding the following:
- action: labelmap
regex: __meta_kubernetes_pod_annotation_prometheus_io_param_(.+)
replacement: __param_$1
I'll see if the helm chart for prometheus is interested in a PR.
from prometheus-pve-exporter.
Just FYI, I created a PR for prometheus helm chart to address this issue. We'll see if they merge it, at least it was approved.
prometheus-community/helm-charts#1298
from prometheus-pve-exporter.
Oh cool, thanks!
from prometheus-pve-exporter.
Related Issues (20)
- Use one endpoint /metrics to expose all metrics (without /pve) for PushProx tool. HOT 1
- Remove positional arguments and replace them with flags
- Package publishing pipeline failed HOT 1
- Package publishing pipeline failed again HOT 1
- Add template information HOT 2
- Proxmox node metrics viewable via exporter target ip endpoint but not via prometheus HOT 4
- Prometheus config error HOT 5
- Best way to run promethes-pve-exporter as a service
- gettting metrics from ALL guest instead of the selected instance HOT 7
- Dependabot doesn't pick up new base image version HOT 1
- Alpine Linux 3.19.0 rejects pip install into system directorys
- ARM builds for docker fail (no prebuilt wheels available for cffi and pyyaml for alpine/arm64)
- Node=1&Cluster=0 Returns no data HOT 2
- Set urllib3.disable_warnings() when verify_ssl: false HOT 2
- Renewal Information: Docker-Sponsored Open Source Program prompve HOT 2
- Technical limitations to running this exporter remotely from the proxmox nodes HOT 2
- DEVOPS: Add userInfo events to user-engagement db
- how to use token credentials for two separte PVE nodes HOT 1
- PVE Behind Reverse Proxy HOT 1
- compose file? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prometheus-pve-exporter.