You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When one ScopeDoctorGroupneeds another, I would expect the outermost group span to be a parent of the group(s) it imports.
For example:
scope doctor run ==========================================
doctor run ==================================
group (outer) ====================
group (inner) =====
group (sibling) =====
This would let us properly time each group and quickly see which groups are taking longest to run.
Actual Behavior
The parent group comes after its children at a sibling level.
unzip scope-telemetry-mvce.zip
cd scope-telemetry-mvce
docker compose up -d
open http://localhost:16686
SCOPE_OTEL_ENDPOINT=http://localhost:4318 scope doctor run
Directory structure
❯ tree -a.├── .scope│ ├── child-group.yaml│ └── mvce.yaml└── docker-compose.yml
In order to fix this, we would need to preserve the tree of groups and ensure that only root nodes have their parent set to doctor run while child groups properly point to their parent group.
It's worth noting that it's actually a forest, as multiple root nodes are currently possible.
I'm sure there are other benefits to preserving this structure in the code that I haven't thought of.
The text was updated successfully, but these errors were encountered:
Upon further reflection, I believe that a valid scope config is a directed acyclic graph as multiple groups (including multiple root level groups) may have dependencies on the same groups.
That would be the correct data structure. Transforming the configuration into a DAG would ensure things are always executed in the correct order, validation would provide a guarantee no cycles are ever entered, and navigating the structure would naturally allow for proper spanning.
but it does seem that we're not walking the directed graph during execution.
We're just returning a Vec<string> of group names to be executed.
That's why the spans don't nest properly, we're not actually opening the span of the parent group prior to opening the span of the child group.
Tangentially related side note:
I don't believe we're computing the transitive reduction of the graph.
I may have just missed it, but petgraph has an implementation we should probably use.
Expected behavior
When one
ScopeDoctorGroup
needs
another, I would expect the outermost group span to be a parent of the group(s) it imports.For example:
This would let us properly time each group and quickly see which groups are taking longest to run.
Actual Behavior
The parent group comes after its children at a sibling level.
MVCE (Minimal Verifiable Complete Example)
zip archive for convenience
unzip scope-telemetry-mvce.zip cd scope-telemetry-mvce docker compose up -d open http://localhost:16686 SCOPE_OTEL_ENDPOINT=http://localhost:4318 scope doctor run
Directory structure
mvce.yaml
child-group.yaml
docker-compose.yaml
Proposed Fix
The runner always sets the parent span for all groups to
doctor run
.scope/scope/src/doctor/runner.rs
Line 151 in 1ef9b90
And the groups are passed as a
Vec
scope/scope/src/doctor/runner.rs
Line 125 in 1ef9b90
In order to fix this, we would need to preserve the
tree
of groups and ensure that only root nodes have their parent set todoctor run
while child groups properly point to their parent group.It's worth noting that it's actually a forest, as multiple root nodes are currently possible.
I'm sure there are other benefits to preserving this structure in the code that I haven't thought of.
The text was updated successfully, but these errors were encountered: