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

Set active span on thread instead of stack #917

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshwlewis
Copy link
Member

@joshwlewis joshwlewis commented Feb 27, 2025

WIP!

Alternative to #918. The idea here is to set the active span on the thread so that buildpacks can nest their own spans within the libcnb provided one - extending the waterfall trace from kodon through libcnb and into CNB specific traces.

Usage within a buildpack might look like this:

let tracer = global::tracer("my-buildpack");
tracer.in_span("download-go", |ctx| {
    let s = ctx.span();
    s.set_attribute(KeyValue::new("go_version", go_version.to_string()));
    do_the_download();
    s.add_event("downloaded")
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request libcnb
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants