Skip to main content

Monitoring

This section will go through the monitoring options of the ConfigCat Proxy.

Status Endpoint

The Proxy provides status information (health check) about its components on the following endpoint:

GETOPTIONS/status

The Proxy regularly checks whether the underlying SDKs can communicate with their configured source and with the cache. This endpoint returns the actual state of these checks.

If everything is operational, each status node shows the value healthy. If an SDK could not connect to its source, it'll put an error to its records collection. If a component's last two records are errors, its status will switch to degraded. If a component becomes operational again it'll put an [ok] to the records and will switch to healthy again.

The root status is healthy if all of the SDKs are healthy. If any of the SDKs become degraded, the root will also switch to degraded.

Responses:

  • 200: The status returned successfully.
  • 204: In response to an OPTIONS request.

Example Response:

{
"status": "healthy",
"sdks": {
"my_sdk": {
"key": "****************************************hwTYg",
"mode": "online",
"source": {
"type": "remote",
"status": "healthy",
"records": [
"Mon, 29 May 2023 16:36:40 UTC: [ok] config fetched"
]
}
},
"another_sdk": {
"key": "****************************************ovVnQ",
"mode": "offline",
"source": {
"type": "cache",
"status": "healthy",
"records": [
"Mon, 29 May 2023 16:36:40 UTC: [ok] reload from cache succeeded",
"Mon, 29 May 2023 16:36:45 UTC: [ok] config from cache not modified"
]
}
}
},
"cache": {
"status": "healthy",
"records": [
"Mon, 29 May 2023 16:36:40 UTC: [ok] cache read succeeded",
"Mon, 29 May 2023 16:36:40 UTC: [ok] cache write succeeded",
"Mon, 29 May 2023 16:36:40 UTC: [ok] cache read succeeded",
"Mon, 29 May 2023 16:36:45 UTC: [ok] cache read succeeded"
]
}
}

Prometheus Metrics

You can set up the Proxy to export metrics about its internal state in Prometheus format. These metrics are served via the /metrics endpoint on a specific port, so you can separate it from the public HTTP communication. The default port is 8051.

The following metrics are exported:

NameTypeDescription

configcat_http_request_duration_seconds

HistogramHistogram of Proxy HTTP response time in seconds.

Tags:
  • route: The request's URL path.
  • method: The request's HTTP method.
  • status: The response's HTTP status.

configcat_sdk_http_request_duration_seconds

HistogramHistogram of ConfigCat CDN HTTP response time in seconds.

Tags:
  • sdk: The SDK's identifier that initiated the request.
  • route: The request's URL path.
  • status: The response's HTTP status.

configcat_stream_connections

GaugeNumber of active client connections per stream.

Tags:
  • sdk: The SDK's identifier that handles the connection.
  • type: sse or grpc.
  • flag: The feature flag's key.
info

The Proxy also exports metrics about the Go environment, e.g., go_goroutines or go_memstats_alloc_bytes, and process-related stats, e.g., process_cpu_seconds_total.

To integrate with Prometheus, put the following scrape config—that points to the Proxy—into your Prometheus configuration:

scrape_configs:
- job_name: configcat_proxy
metrics_path: /metrics
static_configs:
- targets:
- <proxy-host>:8051

Available Options

The following metrics related options are available:

OptionDefaultDescription
metrics:
enabled: <true|false>
trueEnables or disables Prometheus metrics.
metrics:
port: 8051
8051The port used for serving metrics.