Skip to content

feat: sampling, validator, and formatter spans via plugin hooks #1050

Closed

Description

@ajbozarth

Background

Covers what retired sub-issues #471, #472, #473 were trying to do, rolled into one since the mechanism is identical across all three.

Scope

For each of sampling (BaseSamplingStrategy loop), validator (Requirement.check), and formatter (Formatter.apply / render_prompt / parse_response), add a plugin in tracing_plugins.py that hooks the existing pre/post hooks. The metrics plugins for these already exist (SamplingMetricsPlugin, RequirementMetricsPlugin) — mirror their structure.

  • Use semconv-compliant attribute names where defined; fall back to mellea.* for custom.
  • Each plugin can land as its own PR if preferred (this issue collapses the three only for planning purposes; the implementation can be split if it's cleaner).

Phase & dependencies

Phase 2 (coverage). Depends on Phase 1 (#1045, #1046, #1047). Can proceed in parallel with #1048, #1049, #1051, #1052, and with PR #1036 rebased onto Phase 1.

Acceptance criteria

  • Sampling iteration, requirement check, and formatter pass each produce spans with appropriate parent-child relationships.
  • Tests cover span emission for each component.

Parent epic: #444

Activity

  1. added
    area/telemetry
    on May 19, 2026
  2. added
    area/stdlib
    enhancement
    area/sampling
    area/formatter
    on May 20, 2026
  3. added
    p2
    on Jun 18, 2026
  4. self-assigned this
    on Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/formatterarea/samplingarea/stdlibarea/telemetryenhancementp2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions