Skip to content

Add conditinal support for logging errors in observation Span #1441

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

Closed

Conversation

tzolov
Copy link
Contributor

@tzolov tzolov commented Sep 30, 2024

  • Useful for not Web apps.
  • Introduce ErrorLoggingObservationHandler for tracing errors across various AI contexts
  • Add error logging configuration option to ChatObservationProperties
  • Include ErrorLoggingObservationHandler bean in ChatObservationAutoConfiguration

Resolves #1440

 - Useful for not Web apps.
 - Introduce ErrorLoggingObservationHandler for tracing errors across various AI contexts
 - Add error logging configuration option to ChatObservationProperties
 - Include ErrorLoggingObservationHandler bean in ChatObservationAutoConfiguration

 Resolves spring-projects#1440
@tzolov tzolov marked this pull request as ready for review September 30, 2024 11:56
@tzolov tzolov added this to the 1.0.0-M3 milestone Sep 30, 2024
/**
* Whether to include error logging in the observations.
*/
private boolean includeErrorLogging = false;
Copy link
Member

Choose a reason for hiding this comment

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

i'll add this to observability/index.adoc

@markpollack markpollack self-assigned this Oct 4, 2024
havingValue = "true")
public ErrorLoggingObservationHandler errorLoggingObservationHandler(Tracer tracer) {
return new ErrorLoggingObservationHandler(tracer,
List.of(EmbeddingModelObservationContext.class, ImageModelObservationContext.class,
Copy link
Member

Choose a reason for hiding this comment

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

is it ok for the property pring.ai.chat.observations.include-error-logging to apply to all these context's as compared to the chatmodel one, e.g. embedding?

@markpollack
Copy link
Member

merged in d6dc2b2

@markpollack markpollack closed this Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow observation to log errors in tracer's spans for non-web applications
2 participants