Prometheus Pushgateway: Difference between revisions
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
=Internal= | =Internal= | ||
* [[Prometheus Concepts#Pushgateway|Prometheus Concepts]] | * [[Prometheus Concepts#Pushgateway|Prometheus Concepts]] | ||
=Overview= | |||
Push gateways are used in case of applications or short-lived jobs that do not export metrics directly. | |||
=Installation= | =Installation= | ||
==Kubernetes== | ==Kubernetes== |
Revision as of 19:50, 14 October 2020
External
- https://prometheus.io/docs/instrumenting/pushing/
- https://github.com/prometheus/pushgateway/blob/master/README.md
Internal
Overview
Push gateways are used in case of applications or short-lived jobs that do not export metrics directly.
Installation
Kubernetes
apiVersion: v1
kind: Pod
metadata:
name: 'pushgateway'
labels:
function: 'pushgateway'
spec:
containers:
- name: 'pushgateway'
image: prom/pushgateway
---
apiVersion: v1
kind: Service
metadata:
name: 'pushgateway'
spec:
type: 'LoadBalancer'
selector:
function: 'pushgateway'
ports:
- name: 'pushgateway'
protocol: 'TCP'
port: 9091
targetPort: 9091
Playground
Operations
Push a Metric Sample
echo "some_metric 3.14" | curl --data-binary @- http://localhost:9091/metrics/job/some_job
Query Metrics
curl http://localhost:9091/metrics/
Health
curl http://localhost:9091/-/healthy
Readiness
curl http://localhost:9091/-/ready