Add Observability to the Karapace services (registry, rest) via prometheus metrics and instrumentation.
Why this way
Using prometheus, we can take advantage of it's labels, dimensional data model, available tools and ecosystem. This provides the building blocks of adding observability into the service, with focus on extensibility and testing (unit and integration).
Caveats
Right now, we have added a few metric types majorly for the HTTP requests, but this can be extended with more metrics for the different operations of the system, i.e. schema reader metrics, etc.
We use the karapace prefix to act as a namespace and identifier for the service metrics.
A sample prometheus service is added to the docker compose setup to show the pulled metrics via the prometheus.scrape_configs, the UI is shown in the screenshot below.
To support StatsD, we can add a statsd-exporter service to the docker compose setup to test the provided mapping.
We've added scrape jobs for both the karapace-rest and karapace-registry services, both services expose metrics via the /metrics endpoint. The screenshot below shows the local prometheus UI:
Follow ups
See if we want to toggle the metrics enablement via environment variables
About this change - What it does
Add Observability to the Karapace services (
registry
,rest
) via prometheus metrics and instrumentation.Why this way
Using prometheus, we can take advantage of it's labels, dimensional data model, available tools and ecosystem. This provides the building blocks of adding observability into the service, with focus on extensibility and testing (unit and integration).
Caveats
schema reader
metrics, etc.karapace
prefix to act as a namespace and identifier for the service metrics.prometheus.scrape_configs
, the UI is shown in the screenshot below.We've added scrape jobs for both the
karapace-rest
andkarapace-registry
services, both services expose metrics via the/metrics
endpoint. The screenshot below shows the local prometheus UI:Follow ups
Histogram
metricReferences: