Mostly putting this here in case anyone else finds it useful (unsure if this project is still being maintained), but an example of this being used with kube-prometheus-stack in a kubernetes environment using secrets for the api key:
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/monitoring.coreos.com/scrapeconfig_v1alpha1.json
apiVersion: monitoring.coreos.com/v1alpha1
kind: ScrapeConfig
metadata:
name: &name octoprint
spec:
metricsPath: /plugin/prometheus_exporter/metrics
authorization:
type: Bearer
credentials:
name: scrape-config-secret
key: octoprint-api-key
relabelings:
- action: replace
replacement: *name
targetLabel: job
staticConfigs:
- targets:
- "octopi.local:5000"
This references a secret called scrape-config-secret and a key of octoprint-api-key - making using of bearer token instead of params
Mostly putting this here in case anyone else finds it useful (unsure if this project is still being maintained), but an example of this being used with kube-prometheus-stack in a kubernetes environment using secrets for the api key:
This references a secret called
scrape-config-secretand a key ofoctoprint-api-key- making using of bearer token instead of params