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

Instrument SpanContextFromContext to return the span context of the auto generated span #1033

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/include/go_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static __always_inline void *get_parent_go_context(struct go_iface *go_context,
return NULL;
}

static __always_inline struct span_context *get_parent_span_context(struct go_iface *go_context) {
static __always_inline struct span_context *span_context_from_go_context(struct go_iface *go_context) {
void *parent_go_ctx = get_parent_go_context(go_context, &go_context_to_sc);
if (parent_go_ctx == NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion internal/include/trace/start_span.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static __always_inline void start_span(start_span_params_t *params) {
if (params->get_parent_span_context_fn != NULL) {
found_parent = params->get_parent_span_context_fn(params->get_parent_span_context_arg, params->psc);
} else {
struct span_context *local_psc = get_parent_span_context(params->go_context);
struct span_context *local_psc = span_context_from_go_context(params->go_context);
if (local_psc != NULL) {
found_parent = 0;
*(params->psc) = *local_psc;
Expand Down
292 changes: 288 additions & 4 deletions internal/pkg/inject/offset_results.json
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,8 @@
"1.25.0",
"1.26.0",
"1.27.0",
"1.28.0"
"1.28.0",
"1.29.0"
]
}
]
Expand Down Expand Up @@ -1031,7 +1032,8 @@
"1.25.0",
"1.26.0",
"1.27.0",
"1.28.0"
"1.28.0",
"1.29.0"
]
}
]
Expand Down Expand Up @@ -1125,7 +1127,8 @@
"1.25.0",
"1.26.0",
"1.27.0",
"1.28.0"
"1.28.0",
"1.29.0"
]
}
]
Expand Down Expand Up @@ -1224,7 +1227,288 @@
"1.25.0",
"1.26.0",
"1.27.0",
"1.28.0"
"1.28.0",
"1.29.0"
]
}
]
}
]
}
]
},
{
"package": "go.opentelemetry.io/otel/trace",
"structs": [
{
"struct": "SpanContext",
"fields": [
{
"field": "spanID",
"offsets": [
{
"offset": null,
"versions": [
"0.1.0",
"0.1.1",
"0.1.2",
"0.2.0",
"0.2.1",
"0.2.2",
"0.2.3",
"0.3.0",
"0.4.0",
"0.4.1",
"0.4.2",
"0.4.3",
"0.5.0",
"0.6.0",
"0.7.0",
"0.8.0",
"0.9.0",
"0.10.0",
"0.11.0",
"0.12.0",
"0.13.0",
"0.14.0",
"0.15.0",
"0.16.0",
"0.17.0",
"0.18.0"
]
},
{
"offset": 16,
"versions": [
"0.19.0",
"0.20.0",
"1.0.0-RC1",
"1.0.0-RC2",
"1.0.0-RC3",
"1.0.0",
"1.0.1",
"1.1.0",
"1.2.0",
"1.3.0",
"1.4.0",
"1.4.1",
"1.5.0",
"1.6.0",
"1.6.1",
"1.6.2",
"1.6.3",
"1.7.0",
"1.8.0",
"1.9.0",
"1.10.0",
"1.11.0",
"1.11.1",
"1.11.2",
"1.12.0",
"1.13.0",
"1.14.0",
"1.15.0-rc.1",
"1.15.0-rc.2",
"1.15.0",
"1.15.1",
"1.16.0-rc.1",
"1.16.0",
"1.17.0",
"1.18.0",
"1.19.0-rc.1",
"1.19.0",
"1.20.0",
"1.21.0",
"1.22.0",
"1.23.0-rc.1",
"1.23.0",
"1.23.1",
"1.24.0",
"1.25.0",
"1.26.0",
"1.27.0",
"1.28.0",
"1.29.0"
]
}
]
},
{
"field": "traceFlags",
"offsets": [
{
"offset": null,
"versions": [
"0.1.0",
"0.1.1",
"0.1.2",
"0.2.0",
"0.2.1",
"0.2.2",
"0.2.3",
"0.3.0",
"0.4.0",
"0.4.1",
"0.4.2",
"0.4.3",
"0.5.0",
"0.6.0",
"0.7.0",
"0.8.0",
"0.9.0",
"0.10.0",
"0.11.0",
"0.12.0",
"0.13.0",
"0.14.0",
"0.15.0",
"0.16.0",
"0.17.0",
"0.18.0"
]
},
{
"offset": 24,
"versions": [
"0.19.0",
"0.20.0",
"1.0.0-RC1",
"1.0.0-RC2",
"1.0.0-RC3",
"1.0.0",
"1.0.1",
"1.1.0",
"1.2.0",
"1.3.0",
"1.4.0",
"1.4.1",
"1.5.0",
"1.6.0",
"1.6.1",
"1.6.2",
"1.6.3",
"1.7.0",
"1.8.0",
"1.9.0",
"1.10.0",
"1.11.0",
"1.11.1",
"1.11.2",
"1.12.0",
"1.13.0",
"1.14.0",
"1.15.0-rc.1",
"1.15.0-rc.2",
"1.15.0",
"1.15.1",
"1.16.0-rc.1",
"1.16.0",
"1.17.0",
"1.18.0",
"1.19.0-rc.1",
"1.19.0",
"1.20.0",
"1.21.0",
"1.22.0",
"1.23.0-rc.1",
"1.23.0",
"1.23.1",
"1.24.0",
"1.25.0",
"1.26.0",
"1.27.0",
"1.28.0",
"1.29.0"
]
}
]
},
{
"field": "traceID",
"offsets": [
{
"offset": null,
"versions": [
"0.1.0",
"0.1.1",
"0.1.2",
"0.2.0",
"0.2.1",
"0.2.2",
"0.2.3",
"0.3.0",
"0.4.0",
"0.4.1",
"0.4.2",
"0.4.3",
"0.5.0",
"0.6.0",
"0.7.0",
"0.8.0",
"0.9.0",
"0.10.0",
"0.11.0",
"0.12.0",
"0.13.0",
"0.14.0",
"0.15.0",
"0.16.0",
"0.17.0",
"0.18.0"
]
},
{
"offset": 0,
"versions": [
"0.19.0",
"0.20.0",
"1.0.0-RC1",
"1.0.0-RC2",
"1.0.0-RC3",
"1.0.0",
"1.0.1",
"1.1.0",
"1.2.0",
"1.3.0",
"1.4.0",
"1.4.1",
"1.5.0",
"1.6.0",
"1.6.1",
"1.6.2",
"1.6.3",
"1.7.0",
"1.8.0",
"1.9.0",
"1.10.0",
"1.11.0",
"1.11.1",
"1.11.2",
"1.12.0",
"1.13.0",
"1.14.0",
"1.15.0-rc.1",
"1.15.0-rc.2",
"1.15.0",
"1.15.1",
"1.16.0-rc.1",
"1.16.0",
"1.17.0",
"1.18.0",
"1.19.0-rc.1",
"1.19.0",
"1.20.0",
"1.21.0",
"1.22.0",
"1.23.0-rc.1",
"1.23.0",
"1.23.1",
"1.24.0",
"1.25.0",
"1.26.0",
"1.27.0",
"1.28.0",
"1.29.0"
]
}
]
Expand Down
Loading
Loading