mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: expose prometheus port in helm chart (#10448)
Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
co-authored by
Dean Sheather
parent
44bb958114
commit
ddaf913088
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user