Skip to content

Conversation

@JoshuaMoelans
Copy link
Member

@JoshuaMoelans JoshuaMoelans commented Oct 7, 2025

#skip-changelog

@JoshuaMoelans JoshuaMoelans marked this pull request as ready for review October 7, 2025 15:32
Comment on lines 1861 to 1868
TEST_CHECK(collector.sentry_trace_found);
TEST_CHECK(!collector.traceparent_found);

TEST_CHECK_INT_EQUAL(strlen(collector.sentry_trace_value), 51);
TEST_CHECK_INT_EQUAL(
strlen(collector.sentry_trace_value), SENTRY_TRACE_LEN);

sentry_transaction_finish(tx);
sentry_close();
Copy link

Choose a reason for hiding this comment

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

Potential bug: The test file tests/unit/test_tracing.c uses the undefined constants SENTRY_TRACE_LEN and TRACEPARENT_LEN, which will cause a compilation failure.
  • Description: The test file tests/unit/test_tracing.c uses the constants SENTRY_TRACE_LEN and TRACEPARENT_LEN to check string lengths. However, these constants are not defined anywhere in the codebase. The change replaced the magic numbers 51 and 55 with these constants but failed to include their definitions. This will result in an "undefined identifier" error during compilation, causing the build to fail.

  • Suggested fix: Define the constants SENTRY_TRACE_LEN and TRACEPARENT_LEN in an appropriate header file or directly in the test file. For example, add #define SENTRY_TRACE_LEN 51 and #define TRACEPARENT_LEN 55 at the top of tests/unit/test_tracing.c.
    severity: 0.8, confidence: 0.98

Did we get this right? 👍 / 👎 to inform future reviews.

@JoshuaMoelans JoshuaMoelans merged commit 3262fa4 into joshua/feat/traceparent Oct 8, 2025
36 of 37 checks passed
@JoshuaMoelans JoshuaMoelans deleted the joshua/feat/traceparent_only_outgoing branch October 8, 2025 07:33
JoshuaMoelans added a commit that referenced this pull request Oct 8, 2025
* initial traceparent support

* CHANGELOG.md update

* consolidate tests

* remove redundant value_len check

* check for exact length

* reuse header key comparison + extract parsing per header type

* static internal helper

* add size bounds + checks for headers

* only accept 00 or 01 sampling flag

* Apply suggestion from @supervacuus

Co-authored-by: Mischan Toosarani-Hausberger <[email protected]>

* Apply suggestion from @supervacuus

Co-authored-by: Mischan Toosarani-Hausberger <[email protected]>

* Apply suggestion from @supervacuus

Co-authored-by: Mischan Toosarani-Hausberger <[email protected]>

* Apply suggestion from @supervacuus

Co-authored-by: Mischan Toosarani-Hausberger <[email protected]>

* fix(traceparent): only support outgoing for now (#1406)

* cleanup

* remove feature of parsing incoming traceparent

* re-add len macros

* add tests to verify consistency of trace and span IDs across headers for transactions and spans

* use trace header sizes in header propagation

* update CHANGELOG.md

---------

Co-authored-by: Mischan Toosarani-Hausberger <[email protected]>
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