fix(traceparent): only support outgoing for now#1406
fix(traceparent): only support outgoing for now#1406JoshuaMoelans merged 3 commits intojoshua/feat/traceparentfrom
Conversation
| 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(); |
There was a problem hiding this comment.
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.cuses the constantsSENTRY_TRACE_LENandTRACEPARENT_LENto check string lengths. However, these constants are not defined anywhere in the codebase. The change replaced the magic numbers51and55with 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_LENandTRACEPARENT_LENin an appropriate header file or directly in the test file. For example, add#define SENTRY_TRACE_LEN 51and#define TRACEPARENT_LEN 55at the top oftests/unit/test_tracing.c.
severity: 0.8, confidence: 0.98
Did we get this right? 👍 / 👎 to inform future reviews.
* 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 <mischan@abovevacant.com> * Apply suggestion from @supervacuus Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com> * Apply suggestion from @supervacuus Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com> * Apply suggestion from @supervacuus Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com> * 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 <mischan@abovevacant.com>
* 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 <mischan@abovevacant.com> * Apply suggestion from @supervacuus Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com> * Apply suggestion from @supervacuus Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com> * Apply suggestion from @supervacuus Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com> * fix(traceparent): only support outgoing for now (getsentry#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 <mischan@abovevacant.com>
#skip-changelog