feat: add Prometheus metrics for license warnings and errors (#21749)

Fixes: coder/internal#767

Adds two new Prometheus metrics for license health monitoring:

- `coderd_license_warnings` - count of active license warnings
- `coderd_license_errors` - count of active license errors

Metrics endpoint after startup of a deployment with license enabled:

```
...
# HELP coderd_license_errors The number of active license errors.
# TYPE coderd_license_errors gauge
coderd_license_errors 0
...
# HELP coderd_license_warnings The number of active license warnings.
# TYPE coderd_license_warnings gauge
coderd_license_warnings 0
...
```
This commit is contained in:
Marcin Tojek
2026-01-29 13:50:15 +01:00
committed by GitHub
parent 06e396188f
commit 04b0253e8a
6 changed files with 164 additions and 10 deletions
+6
View File
@@ -978,3 +978,9 @@ coderd_agentapi_metadata_flushed_total 71
# HELP coderd_agentapi_metadata_publish_errors_total Total number of metadata batch pubsub publish calls that have resulted in an error.
# TYPE coderd_agentapi_metadata_publish_errors_total counter
coderd_agentapi_metadata_publish_errors_total 0
# HELP coderd_license_warnings The number of active license warnings.
# TYPE coderd_license_warnings gauge
coderd_license_warnings 0
# HELP coderd_license_errors The number of active license errors.
# TYPE coderd_license_errors gauge
coderd_license_errors 0