Request tracing support across core and connectors - #489
Merged
Conversation
lahirujayathilake
marked this pull request as ready for review
June 5, 2026 21:58
DImuthuUpe
requested changes
Jun 7, 2026
DImuthuUpe
left a comment
Contributor
There was a problem hiding this comment.
We need to closely look at the data models again the verify whether we can compress those further
lahirujayathilake
force-pushed
the
tracing-impl
branch
from
June 8, 2026 14:46
bef671e to
8ebe6e4
Compare
lahirujayathilake
marked this pull request as draft
June 8, 2026 20:47
lahirujayathilake
marked this pull request as ready for review
June 10, 2026 08:03
lahirujayathilake
marked this pull request as draft
June 10, 2026 20:48
lahirujayathilake
marked this pull request as ready for review
June 10, 2026 21:26
Contributor
|
@lahirujayathilake please fix merge conflicts |
lahirujayathilake
force-pushed
the
tracing-impl
branch
from
June 12, 2026 18:30
3fc47da to
64709e7
Compare
Member
Author
@DImuthuUpe, I updated the PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a single trace ID to every audit row a request produces. The trace ID flows through the core service, the event bus, and the AMIE, COmanage, and SLURM connectors. Also adds a small set of admin endpoints under
/audit/*so operators can look up a trace, see the full event chain, and filter by subsystem, status, or time window.Before this change, when a multi-step request failed somewhere (for example, an AMIE provisioning request that triggered downstream COmanage work), audit rows existed but had no link between them. There was no way to figure out "what was the full chain of events for this request, and where did it break?". This PR fixes that.
How it works
Audit rows are written by the components that do the work. AMIE writes structured rows as it walks each incoming packet through its state machine. The COmanage and SLURM connectors write rows when their subscribers start handling an event, and again on every success or failure outcome. Every row carries a trace ID, a span ID, a parent span ID, and a
sourcelabel (core,amie,comanage, orslurm). The IDs let the admin endpoints rebuild the event tree. The source label is used for filtering.Every audit row in Custos lives in one
audit_eventstable. Core, COmanage, SLURM, and AMIE all write to it with the same shape, tagged by source. AMIE used to keep its ownamie_audit_logtable with foreign keys into AMIE-specific tables. That is gone in this PR. The AMIE-specific references it still needs (the originating packet and the per-attempt processing event) now live in a small table calledamie_audit_extras, joined toaudit_eventsonaudit_event_id. The trace viewing layer readsaudit_eventsdirectly, no UNION, and the source label tells operators which subsystem produced each row.The shape generalizes. Any future connector that needs to attach its own references to an audit row creates a
<connector>_audit_extrastable and a matching /connectors/{name}/... endpoint that joins it. For now there is one connector-specific endpoint,GET /connectors/amie/packets/{packet_id}/audits, which returns every audit row written for one AMIE packet. The coreaudit_eventstable stays neutral and never grows connector-shaped columns.The admin endpoints are read-only. They let you list traces with filters, fetch the event tree for one trace, fetch a flat time-ordered list for a trace or a single span, and list the available subsystems for the filter UI.