Skip to content

Conversation

@nuclearcat
Copy link
Member

This is groundwork to introduce models required by kernelci/kernelci-pipeline#1419

Add a new TelemetryEvent database model to capture structured telemetry
events from pipeline services. This enables tracking of scheduler
submissions, runtime errors, job skips, and test results across all
runtimes, we will send this telemetry events from pipeline to api.

The collection uses a 14-day TTL index (configurable via
TELEMETRY_TTL_SECONDS env var) for automatic cleanup, plus compound
indexes optimized for common query patterns (by kind, runtime+device_type,
job_name, and result+infra_error).

Also moves EVENT_HISTORY_TTL_SECONDS to the top of the file alongside
the new TELEMETRY_TTL_SECONDS constant for consistency.

Signed-off-by: Denys Fedoryshchenko <[email protected]>
Add abstract Telemetry interface and concrete LatestAPI implementation
for pipeline telemetry endpoints:
add(events): Bulk insert telemetry events via POST /telemetry
find(attributes): Query events with filters via GET /telemetry
stats(attributes): Get aggregated statistics via GET /telemetry/stats

Signed-off-by: Denys Fedoryshchenko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant