group metrics by endpoint instead of path (#1856)

* group metrics by endpoint instead of path

* remove unused lint config files

---------

Co-authored-by: burnettk <burnettk@users.noreply.github.com>
This commit is contained in:
Kevin Burnett 2024-07-02 16:03:08 +00:00 committed by GitHub
parent 7dc15fbebb
commit 2f36a70cfb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 1 additions and 52 deletions

View File

@ -1,2 +0,0 @@
[darglint]
strictness = long

49
.flake8
View File

@ -1,49 +0,0 @@
[flake8]
select = B,B9,C,D,DAR,E,F,N,RST,S,W
ignore = E203,E501,RST201,RST203,RST301,W503,S410,S320
max-line-length = 120
extend-ignore = E203
max-complexity = 30
docstring-convention = google
rst-roles = class,const,func,meth,mod,ref
rst-directives = deprecated
per-file-ignores =
# More specific globs seem to overwrite the more generic ones so we have
# to split them out by directory
# So if you have a rule like:
# tests/*: D102,D103
# and a rule like:
# tests/test_hey.py: D102
# THEN, test_hey.py will NOT be excluding D103
# asserts are ok in tests
spiffworkflow-backend/tests/*:S101,D100,D101,D102,D103,D107
# prefer naming functions descriptively rather than forcing comments
spiffworkflow-backend/src/*:D100,D101,D102,D103,D107
spiffworkflow-backend/bin/keycloak_test_server.py:B950,D
spiffworkflow-backend/conftest.py:S105
spiffworkflow-backend/wsgi.py:S104
# allow writing to /tmp for throwaway script output
spiffworkflow-backend/bin/get_bpmn_json_for_process_instance:S108
# the exclude=./migrations option doesn't seem to work with pre-commit
# migrations are autogenerated from "flask db migration" so ignore them
spiffworkflow-backend/migrations/*:D
spiffworkflow-backend/src/spiffworkflow_backend/config/unit_testing.py:S105
spiffworkflow-backend/src/spiffworkflow_backend/load_database_models.py:F401
# this file overwrites methods from the logging library so we can't change them
# and ignore long comment line
spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py:N802,B950
# TODO: fix the S issues:
# S607 Starting a process with a partial executable path
# S605 Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell
spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py:S607,S101,S605,D102,D103,D101
# TODO: refactor this service so complexity should be reduced throughout
spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_report_service.py:C901,D100,D101,D102,D103,D107

View File

@ -20,7 +20,7 @@ def get_version_info_data() -> dict[str, Any]:
def setup_prometheus_metrics(app: flask.app.Flask, connexion_app: connexion.apps.flask_app.FlaskApp) -> None: def setup_prometheus_metrics(app: flask.app.Flask, connexion_app: connexion.apps.flask_app.FlaskApp) -> None:
metrics = ConnexionPrometheusMetrics(connexion_app) metrics = ConnexionPrometheusMetrics(connexion_app, group_by="endpoint")
app.config["PROMETHEUS_METRICS"] = metrics app.config["PROMETHEUS_METRICS"] = metrics
version_info_data = get_version_info_data() version_info_data = get_version_info_data()
if len(version_info_data) > 0: if len(version_info_data) > 0: