You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+96-1Lines changed: 96 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,7 +236,28 @@ This endpoint can used when placing Agent behind a load balancer to indicate whe
236
236
237
237
### Metrics
238
238
239
-
The `/metrics` endpoint exposes telemetry data of the running Optimizely Agent. The core runtime metrics are exposed via the go expvar package. Documentation for the various statistics can be found as part of the [mstats](https://go.dev/src/runtime/mstats.go) package.
239
+
The `/metrics` endpoint exposes telemetry data of the running Optimizely Agent.
240
+
241
+
Currently, Agent exposes two type of metrics data (expvar or prometheus) based on user's input. By default, expvar metrics will be used. To configure this, update config.yaml or
242
+
set the value of the environment variable `OPTIMIZELY_ADMIN_METRICSTYPE`. Supported values are `expvar` (default) & `promethues`.
243
+
244
+
```yaml
245
+
##
246
+
## admin service configuration
247
+
##
248
+
admin:
249
+
## http listener port
250
+
port: "8088"
251
+
## metrics package to use
252
+
## supported packages are expvar and prometheus
253
+
## default is expvar
254
+
metricsType: ""
255
+
## metricsType: "promethues" ## for prometheus metrics
256
+
```
257
+
258
+
#### Expvar metrics
259
+
260
+
The core runtime metrics are exposed via the Go expvar package. Documentation for the various statistics can be found as part of the [mstats](https://go.dev/src/runtime/mstats.go) package.
240
261
241
262
Example Request:
242
263
@@ -276,6 +297,80 @@ Custom metrics are also provided for the individual service endpoints and follow
276
297
"timers.<metric-name>.responseTimeHist.p99": 0,
277
298
```
278
299
300
+
#### Prometheus metrics
301
+
302
+
Optimizely Agent also supports Prometheus metrics. Prometheus is an open-source toolkit for monitoring and alerting. You can use it to collect and visualize metrics in a time-series database.
303
+
304
+
To access the Prometheus metrics, you can use the `/metrics` endpoint with a Prometheus server. The metrics are exposed in a format that Prometheus can scrape and aggregate.
305
+
306
+
Example Request:
307
+
308
+
```bash
309
+
curl localhost:8088/metrics
310
+
```
311
+
312
+
This will return a plain text response in the Prometheus Exposition Format, which includes all the metrics that Prometheus is currently tracking.
313
+
314
+
Please note that you need to configure your Prometheus server to scrape metrics from this endpoint.
315
+
316
+
For more information on how to use Prometheus for monitoring, you can refer to the [official Prometheus documentation](https://prometheus.io/docs/introduction/overview/).
317
+
318
+
Example Response:
319
+
320
+
```
321
+
...
322
+
# HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code.
323
+
# TYPE promhttp_metric_handler_requests_total counter
Agent exposes the runtime profiling data in the format expected by the [pprof](https://github.com/google/pprof/blob/master/doc/README.md) visualization tool.
0 commit comments