-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add Prometheus instrumentation for ingest-file workers #550
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
tillprochaska
force-pushed
the
feature/metrics
branch
from
November 14, 2023 09:21
ef0ee23
to
31fb41e
Compare
* I’m not entirely sure, but there might be cases where `file_path` is a directory, i.e. `file_size` would be `None` in that case. * The code didn’t cover the case where the entity already has a `fileSize` property. In this case, `file_size` would be `None`, even though `file_path` is a file. I’m not entirely sure when this happens, probably when reingesting an existing file. Both cases were catched by tests :)
tillprochaska
force-pushed
the
feature/metrics
branch
from
November 14, 2023 18:19
a5ec577
to
0a378e8
Compare
tillprochaska
requested review from
catileptic and
stchris
and removed request for
catileptic
November 14, 2023 18:31
tillprochaska
force-pushed
the
feature/metrics
branch
from
November 17, 2023 18:24
6e04a25
to
2783905
Compare
Even though it is considered an anti-pattern to add a prefix with the name of the software or component to metrics (according to the official Prometheus documentation), I have decided to add a prefix. I’ve found that this makes it much easier to find relevant metrics. The main disadvantage of per-component prefixes queries become slightly more complex if you want to query the same metric (e.g. HTTP request duration) across multiple components. This isn’t super important in our case though, so I think the trade-off is acceptable.
tillprochaska
force-pushed
the
feature/metrics
branch
from
November 17, 2023 18:32
2783905
to
31df0f4
Compare
catileptic
requested changes
Nov 20, 2023
As suggested by @catileptic
tillprochaska
force-pushed
the
feature/metrics
branch
from
November 21, 2023 08:28
9def368
to
80a18ab
Compare
catileptic
approved these changes
Nov 21, 2023
stchris
reviewed
Nov 21, 2023
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.
small comment to make it a bit more concise, otherwise it looks great
stchris
approved these changes
Nov 22, 2023
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.
Nice, thanks!
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.
This PR adds instrumentation for ingest-file workers:
In order to test these changes with a local Aleph instance:
Build the ingest-file image using
docker build -t ghcr.io/alephdata/ingest-file:metrics .
.In you Aleph
docker-compose.dev.yml
, set theingest-file
image tag tometrics
.In you Aleph
docker-compose.dev.yml
, set thePROMETHEUS_ENABLED=true
environment variable for theingest-file
service.Run
docker compose -f docker-compose.dev.yml up
to apply the changes.Run
docker compose exec ingest-file curl http://localhost:9090/metrics
.