-
Notifications
You must be signed in to change notification settings - Fork 416
Guardrails Observability 2nd Pass #986
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dtam
reviewed
Aug 5, 2024
dtam
reviewed
Aug 5, 2024
dtam
reviewed
Aug 5, 2024
zsimjee
approved these changes
Aug 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds an additional span at the Guard level and instruments additional span attributes on all spans collected including the OpenInference format.
We also have some commented out anomaly detection attributes. These are commented out because, with the current implementation, it would require shipping the
all-MiniLM-L6-v2
model with the core package. We should look at other ways to support this or use a setting to turn it on or off.There are also some minor refactors in this PR to avoid circular dependencies.
[EDIT]
In testing I noticed that if we called the default tracer methods (
default_otlp_tracer
ordefault_otel_collector_tracer
) multiple times without refreshing the environment (like running the same notebook cell twice), duplicate span processors would be added to the TracerProvider causing duplicate spans in the output. We get around this by using a singleton pattern for now. I don't think this approach is perfect either since it essentially forces the use of only one resource, but advanced users can work around that by instantiating their own TracerProvider instead of using our lazy defaults.