Skip to content

Conversation

hannahkm
Copy link
Contributor

@hannahkm hannahkm commented Sep 5, 2025

  • Added msgp struct tags to fields in payloadV1 and traceChunk for serialization.
  • Introduced EncodeMsg methods for payloadV1 and spanListV1 to support msgp encoding.
  • Updated field types in traceChunk to enhance compatibility with msgp serialization.

What does this PR do?

Implements the v1 trace protocol. Includes commits cherry-picked from #3932 since I closed my previous PR.

Motivation

https://datadoghq.atlassian.net/browse/LANGPLAT-750

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!

- Added msgp struct tags to fields in payloadV1 and traceChunk for serialization.
- Introduced EncodeMsg methods for payloadV1 and spanListV1 to support msgp encoding.
- Updated field types in traceChunk to enhance compatibility with msgp serialization.
@pr-commenter
Copy link

pr-commenter bot commented Sep 5, 2025

Benchmarks

Benchmark execution time: 2025-09-29 19:12:00

Comparing candidate commit a12502c in PR branch hannahkm/implement-v1-serialization with baseline commit 25440fd in branch hannahkm/msgp-payload-interface.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 metrics, 0 unstable metrics.

Copy link
Contributor

datadog-official bot commented Sep 5, 2025

⚠️ Tests

⚠️ Warnings

❄️ 1 New flaky test detected

TestWrapConsumerGroupHandler from github.com/DataDog/dd-trace-go/contrib/IBM/sarama/v2 (Datadog) (✨ Fix with BitsAI)
Failed

=== RUN   TestWrapConsumerGroupHandler
2025/09/29 18:59:04 Sarama consumer up and running!...
    consumer_group_test.go:146: Message claimed: value = test 1, timestamp = 2025-09-29 18:59:04.742 +0000 UTC, topic = IBM_sarama_TestWrapConsumerGroupHandler
    consumer_group_test.go:88: 
        	Error Trace:	/home/runner/work/dd-trace-go/dd-trace-go/contrib/IBM/sarama/consumer_group_test.go:88
        	Error:      	"[
        	            	name: kafka.produce
        	            	tags: map[string]interface {}{"_dd.base_service":"", "_dd.p.tid":"68dad6f800000000", "_dd.profiling.enabled":0, "_dd.top_level":1, "component":"IBM/sarama", "language":"go", "messaging.destination.name":"IBM_sarama_TestWrapConsumerGroupHandler", "messaging.kafka.partition":0, "messaging.system":"kafka", "offset":0, "resource.name":"Produce Topic IBM_sarama_TestWrapConsumerGroupHandler", "service.name":"kafka", "span.kind":"producer", "span.name":"kafka.produce", "span.type":"queue"}
...

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a12502c | Docs | Was this helpful? Give us feedback!

}

type stringTable struct {
m sync.Mutex
Copy link
Member

Choose a reason for hiding this comment

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

I'm not aware of any concurrent serialization going over the same span. Do we need this?

// }
if protocol == traceProtocolV1 {
return &safePayload{
p: newPayloadV1(),
Copy link
Member

Choose a reason for hiding this comment

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

Beyond the linter errors, this is looking in the right direction.

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.

2 participants