Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add emitting of transaction data inside context trace data #1075

Merged
4 changes: 4 additions & 0 deletions src/sentry_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,9 @@ sentry_transaction_finish(sentry_transaction_t *opaque_tx)
sentry_value_t trace_context
= sentry__value_get_trace_context(opaque_tx->inner);
sentry_value_t contexts = sentry_value_new_object();
sentry_value_set_by_key(
trace_context, "data", sentry_value_get_by_key(tx, "extra"));
sentry_value_incref(sentry_value_get_by_key(tx, "extra"));
sentry_value_set_by_key(contexts, "trace", trace_context);
sentry_value_set_by_key(tx, "contexts", contexts);

Expand All @@ -944,6 +947,7 @@ sentry_transaction_finish(sentry_transaction_t *opaque_tx)
sentry_value_remove_by_key(tx, "op");
sentry_value_remove_by_key(tx, "description");
sentry_value_remove_by_key(tx, "status");
sentry_value_remove_by_key(tx, "extra");
supervacuus marked this conversation as resolved.
Show resolved Hide resolved

sentry__transaction_decref(opaque_tx);

Expand Down
3 changes: 2 additions & 1 deletion tests/test_integration_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ def test_transaction_only(cmake, httpserver, build_args):
assert_meta(
envelope,
transaction="little.teapot",
transaction_data={"url": "https://example.com"},
)

# Extract the one-and-only-item
Expand Down Expand Up @@ -575,6 +574,8 @@ def test_transaction_only(cmake, httpserver, build_args):
timestamp = time.strptime(payload["timestamp"], RFC3339_FORMAT)
assert timestamp >= start_timestamp

assert trace_context["data"] == {"url": "https://example.com"}
JoshuaMoelans marked this conversation as resolved.
Show resolved Hide resolved


def test_capture_minidump(cmake, httpserver):
tmp_path = cmake(["sentry_example"], {"SENTRY_BACKEND": "none"})
Expand Down
Loading