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

fix: Status setting on guard_parse traces #889

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ruiciroT
Copy link

@ruiciroT ruiciroT commented Jul 8, 2024

Added a simple try clause to set the status of guard_parse calls to either "OK or ERROR" using OTEL standards as they previously where never set when creating a new span.

Comment on lines +121 to +131
try:
if is_parent:
# Inject the current context
self.inject_current_context()
for attribute in attributes:
span.set_attribute(attribute[0], attribute[1])

span.set_status(trace.Status(trace.StatusCode.OK))
except Exception as e:
logging.error("An error occured during sopan creation: " + str(e))
span.set_status(trace.Status(trace.StatusCode.ERROR))
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is in Hub telemetry utils - the anonymized data collected by Guardrails when the enviornment is configured to send data over. Please see telemetry_utils.py for the telemetry taht's not collected by guardrails

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.

2 participants