Skip to content

Expose a public trace-generation API in pkg/synth for pipeline testing #199

Description

@andrewh

Context

Surfaced by the collector pipeline testing design (issue #73, see
docs/research/collector-pipeline-testing.md). Enabler for the invariant
sub-issues (#74, #75, #76, #77) under the epic in issue #63.

Problem

The proof-of-concept generates traces from inside package synth because it
reuses the unexported walkTrace. Every pipeline-testing invariant needs to
generate motel traces into a real OTLP exporter, so as written they would all
have to live inside package synth or duplicate the generation machinery. The
reusable harness (pkg/pipelinetest) is OTLP-only and deliberately does not
depend on synth, so it cannot drive generation itself.

Proposed work

Expose a small public API in pkg/synth that emits a topology's traces into a
caller-provided TracerProvider (or exporter) — for example, generating N
traces from a *Topology with a given seed and span limit. This is essentially
the loop in SampleTraces and pkg/synth/pipeline_test.go made public and
exporter-agnostic.

Acceptance criteria

  • Public, exporter-agnostic generation API in pkg/synth
  • The pipeline-testing PoC and future invariants drive generation through it,
    not through the unexported walkTrace
  • Unit coverage that the API emits the expected spans into an in-memory exporter

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions