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

[schematic-230] propagate user ids as attribute to spans #1568

Merged
merged 12 commits into from
Jan 17, 2025

Conversation

linglp
Copy link
Contributor

@linglp linglp commented Jan 15, 2025

Problem

When looking into a trace on Signoz, currently we have trace down user id in init span. This PR is to make sure that user id can be propagated to the top level span and also most of other span.

example screen shots that demonstrate the problem:

Here you could see "user id" contained a random string
Screenshot 2025-01-15 at 11 22 19 AM

And spans such as "query file view" do not contain a user id
Screenshot 2025-01-15 at 11 23 59 AM

Note: if a span has already ended we cannot add user id back to it. As an example, ManifestGenerator::create_manifests has two children, one is DataModelParser::parse_model, and another one is ManifestGenerator::create_single_manifest. We could propagate user id back to ManifestGenerator::create_manifests, but not DataModelParser::parse_model since this step happened before and ended by the time that the user id is available.

Solution

Borrowed attribute propagation function here to propagate attributes from parent to child, and when the span ends, propagate attribute from back to parent.

Now the user id attribute can be shown in most of the spans.

Screenshot 2025-01-16 at 3 39 34 PM

schematic/__init__.py Outdated Show resolved Hide resolved
@linglp linglp marked this pull request as ready for review January 16, 2025 22:08
@linglp linglp requested a review from a team as a code owner January 16, 2025 22:08
@linglp linglp changed the title [schematic-230] propagate user ids as attribute to all spans [schematic-230] propagate user ids as attribute to spans Jan 16, 2025
schematic/__init__.py Outdated Show resolved Hide resolved
schematic/__init__.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@BryanFauble BryanFauble left a comment

Choose a reason for hiding this comment

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

LGTM!

@linglp linglp merged commit 6a9601b into develop Jan 17, 2025
8 checks passed
@linglp linglp deleted the develop-schematic-230 branch January 17, 2025 21:34
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.

3 participants