File tree Expand file tree Collapse file tree 3 files changed +37
-6
lines changed
experimental/examples/prometheus Expand file tree Collapse file tree 3 files changed +37
-6
lines changed Original file line number Diff line number Diff line change @@ -11,17 +11,28 @@ This is a simple example that demonstrates basic metrics collection and exports
1111npm install
1212```
1313
14- Setup [ Prometheus] ( https://prometheus.io/docs/prometheus/latest/getting_started/ )
15-
1614## Run the Application
1715
18- - Run the server
19-
2016``` sh
2117# from this directory
2218npm run start
2319```
2420
21+ If you are using the default configurations, the metrics should be available at < http://localhost:9464/metrics >
22+
23+ ## Run Prometheus
24+
25+ ### With docker
26+
27+ ``` sh
28+ # from this directory
29+ docker compose up
30+ ```
31+
32+ ### With binary
33+
34+ Setup [ Prometheus] ( https://prometheus.io/docs/prometheus/latest/getting_started/ )
35+
2536- Replace the ` prometheus.yml ` provided by the Prometheus installation with the following:
2637
2738``` yaml
@@ -34,7 +45,6 @@ scrape_configs:
3445 # scheme defaults to 'http'.
3546 static_configs :
3647 - targets : ['localhost:9464']
37-
3848` ` `
3949
4050- Start Prometheus
@@ -44,7 +54,7 @@ scrape_configs:
4454prometheus --config.file=prometheus.yml
4555```
4656
47- ### Prometheus UI
57+ ## Prometheus UI
4858
4959If you are using the default configurations, the prometheus client will be available at < http://localhost:9090 >
5060
Original file line number Diff line number Diff line change 1+ version : ' 3.7'
2+
3+ services :
4+ prometheus :
5+ image : prom/prometheus:v2.47.2
6+ extra_hosts :
7+ - host.docker.internal:host-gateway
8+ volumes :
9+ - " ./prometheus.docker.yml:/etc/prometheus/prometheus.yml"
10+ ports :
11+ - 9090:9090
12+ restart : always
Original file line number Diff line number Diff line change 1+ global :
2+ scrape_interval : 15s # Default is every 1 minute.
3+
4+ scrape_configs :
5+ - job_name : ' opentelemetry'
6+ # metrics_path defaults to '/metrics'
7+ # scheme defaults to 'http'.
8+ static_configs :
9+ - targets : ['host.docker.internal:9464']
You can’t perform that action at this time.
0 commit comments