Conversation
…rRocks/starrocks#66027 and first shipped in StarRocks 3.5.10
Validation ReportAll 11 validations passed. Show details
|
| "starrocks_fe_scheduled_tablet_num": "fe.scheduled_tablet_num", | ||
| # Summary families: the `.quantile`, `.sum` and `.count` sub-metrics are all derived from | ||
| # this single mapping, so no separate `_sum`/`_count` entries are needed. | ||
| "starrocks_fe_slow_lock_held_time_ms": "fe.slow_lock_held_time_ms", |
There was a problem hiding this comment.
The .sum metrics are submitted as monotonic counts, but StarRocks FE derives _sum from a 1-minute sliding window, so the value can decrease (StarRocks/starrocks#66027, PrometheusMetricVisitor.java:247-248).
Scrape 1 reports starrocks_fe_slow_lock_held_time_ms_sum 91230.0 with _count 137; 60 seconds later, scrape 2 reports _sum 8000.0 with _count 145. Running the check against these payloads submits both values as monotonic_count for celerdata.fe.slow_lock_held_time_ms.sum. The agent reads 8000.0 < 91230.0 as a counter reset: a bogus rate spike, then a re-baselined series.
Route _sum to a submission type matching its trajectory (for example a gauge), or drop .sum and keep the windowed quantiles plus .count. If the monotonic mapping is intentional, add a two-scrape test that pins the behavior.
There was a problem hiding this comment.
Agreed that it isn't monotonic, and it's worse than an occasional decrease. I went with your second option: .sum is dropped, and the quantiles and .count are kept.
Maybe as a compromise we ship a gauge with a different name?
| dd_run_check(CelerdataCheck("celerdata", {}, [fe_instance])) | ||
|
|
||
| for db_name in EXPECTED_DATABASES: | ||
| aggregator.assert_metric_has_tag("celerdata.fe.table_num", f"db_name:{db_name}") |
There was a problem hiding this comment.
The table_num test checks only that each db_name tag appears, so it can't catch a mapping that submits a wrong value for a database or repeats the first family's value for all of them.
If the transformer submitted 54 (the information_schema value) for all four databases, the current assert_metric_has_tag loop still passes. The fixture values are information_schema=54, _statistics_=10, sys=8, analytics=19.
Add value assertions next to the tag assertions, e.g. aggregator.assert_metric('celerdata.fe.table_num', value=10, tags=['db_name:_statistics_']), so family-to-value association is pinned as well.
There was a problem hiding this comment.
The test now builds {db_name: value} from the submitted series and compares it to the fixture values in one assertion. That catches the case you described (54 repeated for every database), any other wrong value, and a missing database:
|
|
||
| ***Fixed***: | ||
|
|
||
| * Collect all per-database `celerdata.fe.table_num` series. StarRocks FE interleaves this metric with `starrocks_fe_db_size_bytes`, so the OpenMetrics parser typed every series after the first as `unknown` and dropped them; pinning the metric type to `gauge` recovers every per-database series. |
There was a problem hiding this comment.
Issue #2854 also reports celerdata.fe.query.timeout.count never appearing in Datadog, and nothing in this PR affects that metric.
The issue describes two symptoms: missing query.timeout.count and table_num limited to information_schema; the PR fixes only the second. A reader linking the issue will assume both are resolved.
State in the PR description whether the query.timeout.count symptom is out of scope or tracked in a separate fix, so #2854 isn't closed as fully resolved.
There was a problem hiding this comment.
I looked into the query.timeout.count half: it doesn't reproduce, so there's no code fix for it. The metric has been in METRIC_MAP since the first release, its family isn't affected by the interleaving, and the Agent forwards it even when the value is 0. The new test_query_timeout_given_zero_valued_counter_returns_the_count_metric pins that it's collected, and the description now explains both symptoms.
What does this PR do?
Two changes to the CelerData FE metrics, reviving #3021 and #3025 by @jaogoy.
Collect every per-database
celerdata.fe.table_numseries. StarRocks FE emitstable_numinterleaved withdb_size_bytes, one pair per database, and writes a# TYPEline only for the first sample. The Prometheus parser types every later familyunknown, and OpenMetrics V2 drops those, so only the first database was collected. Pinning the metric type togaugeroutes every family through the gauge transformer.Add
celerdata.fe.slow_lock_held_time_msandcelerdata.fe.slow_lock_wait_time_ms(StarRocks/starrocks#66027, StarRocks 3.5.10+) as.quantile(gauge) and.count(monotonic count)..sumis intentionally not submitted. StarRocks computes_sumasgetCount() * snapshot.getMean(): a cumulative count times the mean of a 1-minute sliding window. That isn't a sum, and it isn't monotonic. It drops to 0 after any quiet minute, and the next slow lock makes it jump to (slow locks since FE start) × (that lock's duration), which the Agent records as a single increment.METRIC_MAPcan't drop one part of a summary, soCelerdataCheckregisters a small custom transformer for these two metrics.Motivation
Closes #2854, which reported two symptoms:
table_numonly reportinginformation_schema: fixed above.celerdata.fe.query.timeout.countmissing: this doesn't reproduce. The metric has been mapped since the first release, the interleaving doesn't affect it, and the Agent forwards it even when the value is 0. A new unit test pins that it's collected. If it's still missing on 1.3.0, please reopen with the output ofdatadog-agent check celerdata.