-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature, observability: Added Prometheus Metrics & Instrumentation #902
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nosahama
commented
Jun 18, 2024
nosahama
commented
Jun 18, 2024
nosahama
force-pushed
the
nosahama/prometheus-metrics
branch
2 times, most recently
from
June 18, 2024 13:31
ccedf97
to
926af08
Compare
This was referenced Jun 18, 2024
eliax1996
previously approved these changes
Jun 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done, other than this I see no reason for not merging! Great job
nosahama
force-pushed
the
nosahama/prometheus-metrics
branch
3 times, most recently
from
June 19, 2024 11:00
40bc4a3
to
84f1c3b
Compare
nosahama
commented
Jun 19, 2024
nosahama
force-pushed
the
nosahama/prometheus-metrics
branch
3 times, most recently
from
June 19, 2024 11:48
84aa69c
to
b07e65b
Compare
- we add the `PrometheusInstrumentation` class to house available metrics - we use a middleware to automatically instrument the HTTP requests mertrics, i.e. total, in progress, latency, etc. - we add unit tests [EC-299]
nosahama
force-pushed
the
nosahama/prometheus-metrics
branch
from
June 19, 2024 12:06
b07e65b
to
addaaa2
Compare
eliax1996
approved these changes
Jun 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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
andkarapace-registry
services, both services expose metrics via the/metrics
endpoint. The screenshot below shows the local prometheus UI:Follow ups
Histogram
metricReferences: