gabotorresruiz commented on code in PR #44009:
URL: https://github.com/apache/superset/pull/44009#discussion_r4030313324
##########
superset/versioning/metrics.py:
##########
@@ -52,3 +52,37 @@ def incr_capture_error(stage: str) -> None:
stats_logger_manager.instance.incr(f"{_CAPTURE_METRIC_PREFIX}.{stage}.error")
except Exception: # pylint: disable=broad-except
logger.exception("versioning: failed to emit capture-error metric")
+
+
+def emit_capture_timing(stage: str, duration_ms: float) -> None:
+ """Emit the write-path latency for one capture *stage*, in milliseconds.
+
+ The documented recovery lever for capture trouble is the
+ ``ENABLE_VERSIONING_CAPTURE`` kill-switch, flipped on save-path
+ slowdown — the ``superset.versioning.capture.<stage>.latency`` series
Review Comment:
Not a blocker and it predates this PR, but the series does not land under
this name. `StatsdStatsLogger` builds `StatsClient(prefix="superset")` at
`superset/stats_logger.py:94`, so I dumped the wire payload:
`timing("superset.versioning.capture.finalize.latency", 12.3)` goes out as
`superset.superset.versioning.capture.finalize.latency:12.300000|ms`, while
`timing("sqllab.query.time_pending", 12.3)` goes out as
`superset.sqllab.query.time_pending:12.300000|ms`. Every other call site in the
tree leaves the namespace off (`sqllab.*`, `reports.*`, `mcp.tool.*`,
`security.*`, `deletion_retention.*`).
#42709 set `_CAPTURE_METRIC_PREFIX` so this is not yours to fix here, and
renaming it now would also move the `.error` counters someone may already be
alerting on. Flagging it because this docstring is what an operator builds the
alert from. Happy to take the follow up for `metrics.py:39`,
`tasks/version_history_retention.py:346` and
`versioning/activity/orchestrator.py:376` together if you would rather keep
this PR to the latency series.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]