Skip to content

Conversation

@IshwarKanse
Copy link
Contributor

Description

This PR adds span links support to telemetrygen, enabling the generation of spans with links to previously created spans.
The new --span-links flag allows users to specify the number of span links to generate for each span, creating
relationships between spans for testing distributed tracing scenarios.

Key features:

  • New --span-links command line flag to control the number of links per span
  • Links are created to random existing span contexts from previously generated spans
  • Each link includes attributes for link type and index identification
  • Both parent and child spans can have links generated
  • Thread-safe collection and access of span contexts for linking

Testing

  • Added unit tests for span link generation functionality
  • Tested with various --span-links values (0, 1, 5, 10)
  • Verified links are properly attached to both parent and child spans
  • Confirmed thread-safe operation with multiple workers
  • Validated link attributes are correctly set

Documentation

  • Updated command line help text for the new --span-links flag
  • Added configuration documentation for the NumSpanLinks field

@IshwarKanse IshwarKanse requested review from a team, codeboten and mx-psi as code owners September 26, 2025 08:48
@github-actions github-actions bot added the first-time contributor PRs made by new contributors label Sep 26, 2025
@github-actions
Copy link
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

Copy link
Contributor

@andreasgerstmayr andreasgerstmayr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work 🚀!
I added two minor suggestions.

Assisted by Claude code using Gemini API.
@codeboten codeboten merged commit 138f7f5 into open-telemetry:main Sep 26, 2025
185 checks passed
@github-actions github-actions bot added this to the next release milestone Sep 26, 2025
@otelbot
Copy link
Contributor

otelbot bot commented Sep 26, 2025

Thank you for your contribution @IshwarKanse! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

@IshwarKanse IshwarKanse deleted the spanlinks branch November 28, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmd/telemetrygen telemetrygen command first-time contributor PRs made by new contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants