Skip to content
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

metrics, visualization: StatsD Exporter, Prometheus Rules & Grafana Dashboard #939

Merged
merged 3 commits into from
Aug 23, 2024

Conversation

nosahama
Copy link
Contributor

@nosahama nosahama commented Aug 23, 2024

About this change - What it does

This PR adds a statsd-exporter to the service, which will translate existing statsd metrics in influxdb style to prometheus metrics. We also add a simple grafana dashboard to Karapace, thus we can visualize the various metrics.

We also now take the statsd host and port values from the config/env, rather than being hard coded within the client.

Sample prometheus rules file was added and a calculated metric is used within the dashboard. Spin up the container, send some requests and see the metrics on grafana and see the firing alerts on the prometheus alert manager.

Screenshot 2024-08-23 at 10 53 48 Screenshot 2024-08-23 at 10 54 06

Alerts firing from the prometheus rules file, added with a low threshold so we see it fire:
Screenshot 2024-08-23 at 10 54 44

This is not final, the recorded metrics could use better promql techniques, this is just a base for any future work and at least we visualize what already exists in the service, i.e. the Schema Reader panel uses the exported statsd metrics and the HTTP requests use the added prometheus metrics, thus we have 2 metric handlers within the service and should migrate to one in the long run.

A good question would be how and where will karapace send it's metrics while running within the Aiven environment.

@nosahama nosahama requested review from a team as code owners August 23, 2024 08:53
@nosahama nosahama changed the title Nosahama/statsd exporter grafana metrics, dashboard: StatsD Exporter, Prometheus Rules & Grafana Dashboard Aug 23, 2024
@nosahama nosahama changed the title metrics, dashboard: StatsD Exporter, Prometheus Rules & Grafana Dashboard metrics, visualization: StatsD Exporter, Prometheus Rules & Grafana Dashboard Aug 23, 2024
Copy link
Contributor

@eliax1996 eliax1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, LGTM

Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  karapace
  config.py
  statsd.py
Project Total  

This report was generated by python-coverage-comment-action

@eliax1996
Copy link
Contributor

Waiting a little bit if someone else want to take a look, then gonna merge it

@eliax1996 eliax1996 merged commit 36c7858 into main Aug 23, 2024
10 checks passed
@eliax1996 eliax1996 deleted the nosahama/statsd-exporter-grafana branch August 23, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants