mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
docs: markdown fixes and edits (#15527)
- **docs: improve admonition for need to add useHttpPath** - **docs: fix list item nesting** - **docs: fix list item nesting** - **docs: improve admonition for authentication** - **docs: tidy and update vault guide** - **docs: improve admonitions** - **docs: improve admonitions** - **docs: content edits, reference links to make copy easier to read** previews: - <https://coder.com/docs/@fix-guides-list-numbers/admin/external-auth> - <https://coder.com/docs/@fix-guides-list-numbers/admin/integrations/island> --------- Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Co-authored-by: EdwardAngert <EdwardAngert@users.noreply.github.com>
This commit is contained in:
co-authored by
EdwardAngert
EdwardAngert
parent
f6d37f6fcc
commit
4e0963966d
@@ -3,9 +3,8 @@
|
||||
Coder exposes many metrics which can be consumed by a Prometheus server, and
|
||||
give insight into the current state of a live Coder deployment.
|
||||
|
||||
If you don't have an Prometheus server installed, you can follow the Prometheus
|
||||
[Getting started](https://prometheus.io/docs/prometheus/latest/getting_started/)
|
||||
guide.
|
||||
If you don't have a Prometheus server installed, you can follow the Prometheus
|
||||
[Getting started](https://prometheus.io/docs/prometheus/latest/getting_started/) guide.
|
||||
|
||||
## Enable Prometheus metrics
|
||||
|
||||
@@ -19,7 +18,7 @@ use either the environment variable `CODER_PROMETHEUS_ADDRESS` or the flag
|
||||
address.
|
||||
|
||||
If `coder server --prometheus-enable` is started locally, you can preview the
|
||||
metrics endpoint in your browser or by using curl:
|
||||
metrics endpoint in your browser or with `curl`:
|
||||
|
||||
```console
|
||||
$ curl http://localhost:2112/
|
||||
@@ -31,13 +30,12 @@ coderd_api_active_users_duration_hour 0
|
||||
|
||||
### Kubernetes deployment
|
||||
|
||||
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. A Service Endpoint will not be exposed; if you need to expose the
|
||||
Prometheus port on a Service, (for example, to use a `ServiceMonitor`), create a
|
||||
separate headless service instead:
|
||||
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. A Service Endpoint will not be exposed; if you need to
|
||||
expose the Prometheus port on a Service, (for example, to use a
|
||||
`ServiceMonitor`), create a separate headless service instead.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
@@ -62,21 +60,22 @@ spec:
|
||||
|
||||
To allow Prometheus to scrape the Coder metrics, you will need to create a
|
||||
`scape_config` in your `prometheus.yml` file, or in the Prometheus Helm chart
|
||||
values. Below is an example `scrape_config`:
|
||||
values. The following is an example `scrape_config`.
|
||||
|
||||
```yaml
|
||||
scrape_configs:
|
||||
- job_name: "coder"
|
||||
scheme: "http"
|
||||
static_configs:
|
||||
- targets: ["<ip>:2112"] # replace with the the IP address of the Coder pod or server
|
||||
# replace with the the IP address of the Coder pod or server
|
||||
- targets: ["<ip>:2112"]
|
||||
labels:
|
||||
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`:
|
||||
create a `ServiceMonitor` in your Coder deployment namespace. The following is
|
||||
an example `ServiceMonitor`.
|
||||
|
||||
```yaml
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
@@ -96,7 +95,7 @@ spec:
|
||||
|
||||
## Available metrics
|
||||
|
||||
`coderd_agentstats_*` metrics must first be enabled with the flag
|
||||
You must first enable `coderd_agentstats_*` with the flag
|
||||
`--prometheus-collect-agent-stats`, or the environment variable
|
||||
`CODER_PROMETHEUS_COLLECT_AGENT_STATS` before they can be retrieved from the
|
||||
deployment. They will always be available from the agent.
|
||||
|
||||
Reference in New Issue
Block a user