Skip to content

Commit 3c62307

Browse files
authored
Merge pull request #72 from VibeEngineeringAI/fix/pr62-15-trace-activity-exact-range
PR #62 follow-up 15: apply exact time bounds in get_trace_activity
2 parents 37f0997 + c89d9be commit 3c62307

2 files changed

Lines changed: 244 additions & 46 deletions

File tree

‎docs/tool-api.md‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,15 @@ traces dataset:
238238
}
239239
```
240240

241-
`dataset`, `startTime` and `endTime` are required. `groupBy` takes up to 5
241+
`dataset`, `startTime` and `endTime` are required. `startTime` must be before
242+
`endTime`; both are resolved once and applied as exact, half-open bounds (start
243+
inclusive, end exclusive) on the dataset's time partition, so subminute ranges
244+
keep their full precision. `groupBy` takes up to 5
242245
exact field names. `filters` maps exact field names to JSON scalars: strings,
243246
numbers and booleans test equality, and `null` tests `IS NULL`. `bucketCount`
244247
is 1–100, default 60. It approximates the number of `DATE_BIN` buckets over the
245-
dataset's time partition, or `p_timestamp` if none is configured. The dataset
248+
dataset's time partition, or `p_timestamp` if none is configured. Buckets are
249+
whole seconds, sized from the exact range and aligned to `startTime`. The dataset
246250
must have traces telemetry and contain `span_span_id` and `span_trace_id`.
247251
Unknown fields are rejected. `span_count` is `COUNT(DISTINCT span_span_id)` and
248252
`trace_count` is `COUNT(DISTINCT span_trace_id)`, so duplicate span rows are
@@ -253,10 +257,11 @@ contains `query`, `bucketInterval`, `semantics`, up to 500 `rows` and
253257
`query` is the exact SQL the tool runs; it ends in `LIMIT 501` so the tool can
254258
detect overflow. When more than 500 rows match, the newest buckets are dropped
255259
and `truncated` is `true`; reduce `bucketCount`, `groupBy` or the time range to
256-
get the full series. `query` has no time predicate: the time range comes from
257-
the request's `startTime` and `endTime`, which the query API rounds down to the
258-
minute. To reproduce the result, for example in a dashboard tile, run `query`
259-
through the query API with the same `startTime` and `endTime`.
260+
get the full series. `query` embeds the exact time bounds as a half-open
261+
predicate on the time field. The query API rounds a request's `startTime` and
262+
`endTime` down to the minute, so to reproduce the result, for example in a
263+
dashboard tile, run `query` through the query API with a time range that covers
264+
those bounds.
260265

261266
## Argument schema validation
262267

0 commit comments

Comments
 (0)