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

chore(weave): allow otel style ids for calls #3946

Merged
merged 4 commits into from
Mar 25, 2025
Merged

Conversation

zbirenbaum
Copy link
Contributor

Description

  • Fixes WB-23975

Modify regex matching on frontend to match any ID with or without dashes to support OTEL style ID strings. Change validation of call IDs and trace IDs to include OTEL style ID strings.

@zbirenbaum zbirenbaum requested a review from a team as a code owner March 24, 2025 22:09
@circle-job-mirror
Copy link

circle-job-mirror bot commented Mar 24, 2025

@zbirenbaum zbirenbaum force-pushed the zach/otel-trace-server branch from 9957695 to 026bb33 Compare March 24, 2025 22:20
return validation_util.require_uuid(s)
try:
return validation_util.require_otel_span_id(s)
except:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need more explicit except here. What are you catching?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Logically this is similar to require_otel_span_id(s) or require_uuid(s). The exceptions raised in the require methods cause execution to halt so this just checks if it is an OTEL UUID before allowing the require_uuid to throw.

I agree its a bit messy, I guess I could modify the original require_uuid to also check for otel format IDs if that's better, or return either a string or error from the requires and throw if it's an instance of error

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you want to be super general then you can do except Exception which will catch most things. Bare except is dangerous because it will also catch stuff like KeyboardInterrupt which you probably dont want

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated it to catch the specific exception. I still think there are other ways of doing this that are cleaner but not sure its high priority and would have slightly higher footprint for sure

@zbirenbaum zbirenbaum merged commit 248e5ca into master Mar 25, 2025
130 checks passed
@zbirenbaum zbirenbaum deleted the zach/otel-trace-server branch March 25, 2025 16:36
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants