-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add Task Processor metrics #27
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f3bba73
feat: Add Task processor
khvn26 c581a11
make sure the entrypoint works
khvn26 2ac0a0b
remove unused logger
khvn26 6d76515
improve code organisation
khvn26 49e534c
add initial metrics
khvn26 cd76885
prevent exposing task processor netrics from api
khvn26 02833ed
implement `task_processor_task_duration_seconds`, `task_processor_fin…
khvn26 4938a97
implement `task_processor_enqueued_tasks_total`
khvn26 e66a5cc
update docs
khvn26 54d9189
correct assertion
khvn26 5bb0efe
test for `TASK_PROCESSOR_MODE`
khvn26 6b3f074
fix bad merge
khvn26 60cf548
improvement
khvn26 722d9e5
less code
khvn26 80943c0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1acd7c3
fix fixture
khvn26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import prometheus_client | ||
| from django.conf import settings | ||
|
|
||
| from common.prometheus import Histogram | ||
|
|
||
| task_processor_enqueued_tasks_total = prometheus_client.Counter( | ||
rolodato marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "task_processor_enqueued_tasks_total", | ||
| "Total number of enqueued tasks", | ||
| ["task_identifier"], | ||
| ) | ||
|
|
||
| if settings.TASK_PROCESSOR_MODE: | ||
| task_processor_finished_tasks_total = prometheus_client.Counter( | ||
| "task_processor_finished_tasks_total", | ||
| "Total number of finished tasks", | ||
| ["task_identifier", "result"], | ||
| ) | ||
| task_processor_task_duration_seconds = Histogram( | ||
| "task_processor_task_duration_seconds", | ||
| "Task processor task duration in seconds", | ||
| ["task_identifier", "result"], | ||
| ) | ||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.