Skip to content

Commit e5f650b

Browse files
Wineshugatheletterftiffany76otelbot[bot]
authored
Docs: Modify Prometheus exporters section under Language APIs & SDKs (#9570)
Co-authored-by: Fabrizio Ferri-Benedetti <algernon@fastmail.com> Co-authored-by: Tiffany Hrabusa <30397949+tiffany76@users.noreply.github.com> Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
1 parent 578481b commit e5f650b

File tree

2 files changed

+15
-37
lines changed

2 files changed

+15
-37
lines changed
Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,17 @@
11
## Prometheus
22

3-
To send your metric data to [Prometheus](https://prometheus.io/), you can either
4-
[enable Prometheus' OTLP Receiver](https://prometheus.io/docs/guides/opentelemetry/#enable-the-otlp-receiver)
5-
and use the [OTLP exporter](#otlp) or you can use the Prometheus exporter, a
6-
`MetricReader` that starts an HTTP server that collects metrics and serialize to
7-
Prometheus text format on request.
3+
To send your metric data to [Prometheus](https://prometheus.io/), you can
4+
either:
85

9-
### Backend Setup {#prometheus-setup}
6+
- [Enable Prometheus' OTLP Receiver](https://prometheus.io/docs/guides/opentelemetry/#enable-the-otlp-receiver)
7+
and use the [OTLP exporter](#otlp) (best practice), or
8+
- Use the Prometheus exporter, a `MetricReader` that starts an HTTP server that
9+
collects metrics and serializes to Prometheus text format on request.
1010

11-
> [!NOTE]
12-
>
13-
> If you have Prometheus or a Prometheus-compatible backend already set up, you
14-
> can skip this section and setup the [Prometheus](#prometheus-dependencies) or
15-
> [OTLP](#otlp-dependencies) exporter dependencies for your application.
11+
### Backend setup {#prometheus-setup}
1612

17-
You can run [Prometheus](https://prometheus.io) in a docker container,
18-
accessible on port `9090` by following these instructions:
13+
To run a Prometheus server backend and begin scraping metrics, see the
14+
[Prometheus getting started guide](https://prometheus.io/docs/prometheus/latest/getting_started/).
1915

20-
Create a file called `prometheus.yml` with the following content:
21-
22-
```yaml
23-
scrape_configs:
24-
- job_name: dice-service
25-
scrape_interval: 5s
26-
static_configs:
27-
- targets: [host.docker.internal:9464]
28-
```
29-
30-
Run Prometheus in a docker container with the UI accessible on port `9090`:
31-
32-
```shell
33-
docker run --rm -v ${PWD}/prometheus.yml:/prometheus/prometheus.yml -p 9090:9090 prom/prometheus --web.enable-otlp-receiver
34-
```
35-
36-
> [!NOTE]
37-
>
38-
> When using Prometheus' OTLP Receiver, make sure that you set the OTLP endpoint
39-
> for metrics in your application to `http://localhost:9090/api/v1/otlp`.
40-
>
41-
> Not all docker environments support `host.docker.internal`. In some cases you
42-
> may need to replace `host.docker.internal` with `localhost` or the IP address
43-
> of your machine.
16+
To enable the OTLP Receiver, see the
17+
[Prometheus guide for enabling the OTLP Receiver](https://prometheus.io/docs/guides/opentelemetry/#enable-the-otlp-receiver).

static/refcache.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21959,6 +21959,10 @@
2195921959
"StatusCode": 200,
2196021960
"LastSeen": "2026-04-10T09:59:08.246389877Z"
2196121961
},
21962+
"https://prometheus.io/docs/prometheus/latest/getting_started/": {
21963+
"StatusCode": 200,
21964+
"LastSeen": "2026-04-20T20:35:35.466392978Z"
21965+
},
2196221966
"https://prometheus.io/docs/prometheus/latest/http_sd/": {
2196321967
"StatusCode": 200,
2196421968
"LastSeen": "2026-03-23T14:15:26.26619547Z"

0 commit comments

Comments
 (0)