Skip to content

Conversation

@alfredosa
Copy link

@alfredosa alfredosa commented Nov 18, 2025

What does this PR do?

CloudEvents is a very popular framework now to work with events, in an abstracted way. dd-trace-go does not have a native way to propagate context through CloudEvents.

I propose adding contrib/cloudevents/sdk-go.v2 which would provide:

  • Context Injection: functions to work and properly inject span context (mapping to W3C/TraceParent).
  • Context Extraction: functions to extract said data
  • Publisher Wrapper: aid with a wrapper and inject the context (as cloudevents extensions)
  • Handler Wrapper: A function for cloudevents.Client or handler functions to automatically start spans on incoming events.

Motivation

I think this would benefit every other adopter of cloud events! I opened #4137 to discuss but also mentioned I can provide the code, In case it's useful in advanced to expedite the discussion and get feedback.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running ./scripts/lint.sh locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@alfredosa alfredosa requested review from a team as code owners November 18, 2025 18:05
@alfredosa alfredosa changed the title feat(contrib/cloudevents): Provide functionality for tracing for clou… feat(contrib/cloudevents): Provide helpers for tracing for cloudevents Nov 18, 2025
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