Update metrics linting to be able to handle custom metrics#18733
Merged
MadLittleMods merged 33 commits intodevelopfrom Aug 1, 2025
Merged
Update metrics linting to be able to handle custom metrics#18733MadLittleMods merged 33 commits intodevelopfrom
MadLittleMods merged 33 commits intodevelopfrom
Conversation
``` synapse/metrics/__init__.py:522: error: Expected the `labelnames` argument of Histogram to be a list of label names (including `SERVER_NAME_LABEL`), but got TupleExpr:528( StrExpr(type) StrExpr(reason) NameExpr(SERVER_NAME_LABEL [synapse.metrics.SERVER_NAME_LABEL])). If this is a process-level metric (vs homeserver-level), use a type ignore comment to disable this check. [missing-server-name-label] ```
38 tasks
3 tasks
Conflicts: scripts-dev/mypy_synapse_plugin.py
MadLittleMods
commented
Jul 28, 2025
9 tasks
MadLittleMods
commented
Jul 29, 2025
Conflicts: scripts-dev/mypy_synapse_plugin.py
MadLittleMods
commented
Jul 29, 2025
Conflicts: synapse/metrics/__init__.py
Conflicts: synapse/metrics/__init__.py
Conflicts: scripts-dev/mypy_synapse_plugin.py
Member
|
I believe this PR looks good to merge as is. |
devonh
reviewed
Aug 1, 2025
devonh
approved these changes
Aug 1, 2025
Member
devonh
left a comment
There was a problem hiding this comment.
Thanks for pushing through to get this running by default!
Contributor
Author
|
Thanks for the review @devonh and @frebib for the suggestion to make the lint viable 🦛 |
3 tasks
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
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.
Update metrics linting to be able to handle custom metrics
Part of #18592
Dev notes
GaugeBucketCollectorLaterGaugemypy extensions
Mypy
Bug/limitation where multiple extensions usingget_base_class_hookinterfere with each other python/mypy#19524Todo
analyze_prometheus_metric_classesregardless of other mypy plugins (Multiple extensions usingget_base_class_hookinterfere with each other python/mypy#19524), see Update metrics linting to be able to handle custom metrics #18733 (comment)Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.