Introduce tracing with OpenTelemetry #1281
Merged
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.
Resolves #39
The intention is the whole Seldon Core v2 ecosystem to have enabled distributed tracing. Currently, MLServer is missing this and this PR tracing features via the OpenTelemetry Python SDK. Other components of the system already have tracing enabled and exporting traces to an OTel collector service. By having it enabled in settings, it will provide transparency on requests, helping us to get a better picture of the journey of a request and identify any potential or already existing bottlenecks.
This PR adds basic tracing functionality by instrumenting both the REST and the gRPC servers on start. And adds a few tests to verify spans are being sent out. This is enough to give us basic information about incoming requests and their life-cycle in MLServer.