Skip to content

[graphApi] add non-identity edge annotations with ancestor inheritence#84

Open
pbibra wants to merge 2 commits into
airbnb-mainfrom
pbibra-subgraph-product-context-annotations
Open

[graphApi] add non-identity edge annotations with ancestor inheritence#84
pbibra wants to merge 2 commits into
airbnb-mainfrom
pbibra-subgraph-product-context-annotations

Conversation

@pbibra
Copy link
Copy Markdown
Collaborator

@pbibra pbibra commented May 28, 2026

Summary

  • Adds is_annotation: true boolean to edge_metadata_tag_mapping fields in GraphConfig. Annotation fields are excluded from edge identity (not part of metadata or generateKey) so they never split otherwise identical edges.
  • Introduces Edge.annotations (Map<String, Set<String>>), accumulating distinct values across observations of the same logical edge. addObservation(Map<String,String>) replaces incrementObservedCount() as
    the single call site, combining count increment and annotation merge.
  • Adds GraphConfig.resolveAnnotationsForSpan, which walks the parent chain to find the nearest ancestor where all configured keys fully resolve. Results are memoized so each span's chain is walked at most once. All annotation fields currently inherit from ancestors by default. A future inherit_from_ancestor flag or equivalent on TagConfig could gate this per field.
  • Wires annotation resolution into GraphBuilder.traverseAndBuildGraph — only spans that produce edges are walked, keeping it lazy.

Requirements

@pbibra pbibra marked this pull request as ready for review June 1, 2026 15:44
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