-
Notifications
You must be signed in to change notification settings - Fork 177
Connector and Model Tracing #4004
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
Connector and Model Tracing #4004
Conversation
22b888d
to
2ddfc2d
Compare
@@ -0,0 +1,175 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need this anymore?
Signed-off-by: chrislai <chrlaii@amazon.com>
Signed-off-by: chrislai <chrlaii@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, left a few comments
MLConnectorTracer.resetForTest(); | ||
MLConnectorTracer.initialize(NoopTracer.INSTANCE, mlFeatureEnabledSetting); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is required to avoid IllegalStateException from MLConnectorTracer.getInstance calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But in this file I don't see any usage of this tracer?
* </ul> | ||
*/ | ||
@Log4j2 | ||
public class MLConnectorTracer extends MLTracer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to separate MLConnectorTracer and MLModelTracer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MLModelTracer added
public static void handleSpanError(Span span, String errorMessage, Exception e) { | ||
log.error(errorMessage, e); | ||
span.setError(e); | ||
getInstance().endSpan(span); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: i see lot of these methods handleSpanError() and they do the same thing, do u think it's possible to move this to the MLTracer itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately no, since getInstance only exists in specific classes (MLAgentTracer / MLConnectorTracer) so the method can't be moved to MLTracer
RestStatus.FORBIDDEN | ||
) | ||
); | ||
predictSpan.setError(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this need to be set before the listener.onFailure()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! addressed
Signed-off-by: chrislai <chrlaii@amazon.com>
Signed-off-by: chrislai <chrlaii@amazon.com>
* If null, tracing will be disabled. | ||
*/ | ||
public static synchronized void initialize(Tracer tracer, MLFeatureEnabledSetting mlFeatureEnabledSetting) { | ||
initialize(tracer, mlFeatureEnabledSetting, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this ever null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
d7d0781
into
opensearch-project:feature/agent-tracing
Description
Adds tracing to all CRUD operations of the connector component as well as model prediction and execution.
Related Issues
Resolves #3971
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.