Export http/metrics into prometheus via an intermediate web server in
the pod, and configuring it as an additional source.
You can manually provide metrics by copying http/metrics.template to
http/metrics and edit the numbers while prometheus is running.
--- /dev/null
+http/metrics
--- /dev/null
+global:
+ scrape_interval: 5s
+ scrape_timeout: 5s
+ evaluation_interval: 15s
+alerting:
+ alertmanagers:
+ - static_configs:
+ - targets: []
+ scheme: http
+ timeout: 10s
+ api_version: v1
+scrape_configs:
+- job_name: 'prometheus'
+ static_configs:
+ - targets: ['localhost:9090']
+
+- job_name: host-http
+ honor_timestamps: true
+ metrics_path: /metrics
+ scheme: http
+ static_configs:
+ - targets: ['localhost:8080']
--- /dev/null
+This directory will be served by lighttpd in the pod
+Intended for exporting metrics
--- /dev/null
+# HELP thing_count how many things ran
+# TYPE thing_count counter
+thing_count 0
+
+# HELP thing_failures how many things failed
+# TYPE thing_failures counter
+thing_failures 0
- containerPort: 9090
hostPort: 3001
protocol: TCP
+ volumeMounts:
+ - name: prometheus-config
+ mountPath: /etc/prometheus/prometheus.yml
+ readOnly: true
+
+ - image: quay.io/bitnami/nginx
+ name: httpd
+ volumeMounts:
+ - name: http
+ mountPath: /app
+ readOnly: true
volumes:
- hostPath:
path: ./conf-grafana/datasource.yaml
type: File
name: grafana-datasource
+ - hostPath:
+ path: ./conf-prometheus/prometheus.yml
+ type: File
+ name: prometheus-config
+ - hostPath:
+ path: ./http
+ name: http