Agent Environment
Datadog Agent 7 (public.ecr.aws/datadog/agent:7), running on ECS Fargate.
MySQL 8.0 (AWS RDS), DBM enabled.
Describe what happened
The query-activity job of the MySQL DBM check crashes on every run:
File "/opt/datadog-agent/embedded/lib/python3.13/site-packages/datadog_checks/mysql/activity.py", line 308, in _normalize_rows
if row["event_timer_end"] < seen[row["thread_id"]]["event_timer_start"]:
TypeError: '<' not supported between instances of 'NoneType' and 'int'
Followed by:
(utils.py:453) | [... job:query-activity] Job loop crash
_normalize_rows compares event_timer_end against a previously seen event_timer_start without a NULL guard. In performance_schema.events_statements_current, TIMER_END is NULL while a statement is still executing, so any activity sample that catches an in-flight statement crashes the job.
The crash repeats on every collection interval. Regular mysql.* metrics keep flowing; only query activity/samples stop being collected.
Describe what you expected
Rows with a NULL event_timer_end should be skipped or treated as still-running, not crash the job loop.
Steps to reproduce the issue
- Enable DBM on a MySQL instance with
query_activity enabled.
- Have a statement running long enough to be sampled while still in flight (
TIMER_END NULL in events_statements_current).
- The activity job crashes with the traceback above.
Frequency: reproduces consistently on a moderately loaded instance — observed on every collection cycle over several hours.
Agent Environment
Datadog Agent 7 (
public.ecr.aws/datadog/agent:7), running on ECS Fargate.MySQL 8.0 (AWS RDS), DBM enabled.
Describe what happened
The
query-activityjob of the MySQL DBM check crashes on every run:Followed by:
_normalize_rowscomparesevent_timer_endagainst a previously seenevent_timer_startwithout a NULL guard. Inperformance_schema.events_statements_current,TIMER_ENDis NULL while a statement is still executing, so any activity sample that catches an in-flight statement crashes the job.The crash repeats on every collection interval. Regular
mysql.*metrics keep flowing; only query activity/samples stop being collected.Describe what you expected
Rows with a NULL
event_timer_endshould be skipped or treated as still-running, not crash the job loop.Steps to reproduce the issue
query_activityenabled.TIMER_ENDNULL inevents_statements_current).Frequency: reproduces consistently on a moderately loaded instance — observed on every collection cycle over several hours.