feat: expose prometheus port in helm chart (#10448)

Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
Patrick McKee
2023-11-06 14:47:28 +00:00
committed by GitHub
co-authored by Dean Sheather
parent 44bb958114
commit ddaf913088
6 changed files with 273 additions and 6 deletions
+22 -1
View File
@@ -35,7 +35,8 @@ The Prometheus endpoint can be enabled in the
[Helm chart's](https://github.com/coder/coder/tree/main/helm) `values.yml` by
setting the environment variable `CODER_PROMETHEUS_ADDRESS` to `0.0.0.0:2112`.
The environment variable `CODER_PROMETHEUS_ENABLE` will be enabled
automatically.
automatically. A Service Endpoint will also be exposed allowing Prometheus
Service Monitors to be used.
### Prometheus configuration
@@ -53,6 +54,26 @@ scrape_configs:
apps: "coder"
```
To use the Kubernetes Prometheus operator to scrape metrics, you will need to
create a `ServiceMonitor` in your Coder deployment namespace. Below is an
example `ServiceMonitor`:
```yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: coder-service-monitor
namespace: coder
spec:
endpoints:
- port: prometheus-http
interval: 10s
scrapeTimeout: 10s
selector:
matchLabels:
app.kubernetes.io/name: coder
```
## Available metrics
<!-- Code generated by 'make docs/admin/prometheus.md'. DO NOT EDIT -->