-
Notifications
You must be signed in to change notification settings - Fork 400
Update metrics linting to be able to handle custom metrics #18733
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
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] ```
Conflicts: scripts-dev/mypy_synapse_plugin.py
Conflicts: scripts-dev/mypy_synapse_plugin.py
Conflicts: synapse/metrics/__init__.py
Conflicts: synapse/metrics/__init__.py
Conflicts: scripts-dev/mypy_synapse_plugin.py
I believe this PR looks good to merge as is. |
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.
Thanks for pushing through to get this running by default!
Thanks for the review @devonh and @frebib for the suggestion to make the lint viable 🦛 |
Update metrics linting to be able to handle custom metrics
Part of #18592
Dev notes
GaugeBucketCollector
LaterGauge
mypy extensions
Mypy
Bug/limitation where multiple extensions usingget_base_class_hook
interfere with each other python/mypy#19524Todo
analyze_prometheus_metric_classes
regardless of other mypy plugins (Multiple extensions usingget_base_class_hook
interfere with each other python/mypy#19524), see Update metrics linting to be able to handle custom metrics #18733 (comment)Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.