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

Prometheus exporter for metrics #126

Merged
merged 2 commits into from
May 30, 2024
Merged

Prometheus exporter for metrics #126

merged 2 commits into from
May 30, 2024

Conversation

aelkiss
Copy link
Member

@aelkiss aelkiss commented May 30, 2024

This adds a very simple plack application which we can run as a sidecar container for the ingest workers that will allow the metrics to be scraped.

To see it in action/test it locally:

docker compose up prometheus-exporter
curl http://localhost:9090 # should see the metric names
cp t/fixtures/simple/test/*.zip volumes_to_test # or put anything else in volumes_to_test
docker compose run validate
curl http://localhost:9090 # should see some values for some metrics

@aelkiss aelkiss requested a review from mwarin May 30, 2024 17:48
@aelkiss aelkiss marked this pull request as ready for review May 30, 2024 17:48
@aelkiss
Copy link
Member Author

aelkiss commented May 30, 2024

FYI @moseshll

Copy link
Contributor

@mwarin mwarin left a comment

Choose a reason for hiding this comment

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

Looks great. I was able to variations on the following:

$ docker compose run --rm prometheus-exporter perl lib/HTFeed/JobMetrics.pm --operation add --metric ingest_handle_items --value 5000

...

$ curl http://localhost:9090 | grep ingest_handle_items
# TYPE ingest_handle_items counter
ingest_handle_items 5000

... and that's an APPROVE.

@@ -0,0 +1,30 @@
use HTFeed::JobMetrics;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect to see use strict; and use warnings; at the top of every perl script, OR a comment with a compelling argument why not.

@aelkiss aelkiss merged commit b0d512b into main May 30, 2024
1 check passed
@aelkiss aelkiss deleted the prometheus-exporter branch May 30, 2024 20:05
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