Skip to content

Included Prometheus interceptor support for gRPC streaming#1858

Merged
RobertSamoilescu merged 6 commits intoSeldonIO:masterfrom
RobertSamoilescu:fix/metrics-streaming
Jul 15, 2024
Merged

Included Prometheus interceptor support for gRPC streaming#1858
RobertSamoilescu merged 6 commits intoSeldonIO:masterfrom
RobertSamoilescu:fix/metrics-streaming

Conversation

@RobertSamoilescu
Copy link
Copy Markdown
Contributor

@RobertSamoilescu RobertSamoilescu commented Jul 12, 2024

This PR includes Prometheus interceptor support for gRPC streaming. Currently for gRPC streaming, we have to set "metrics_endpoint": null, thus Prometheus logs cannot be scraped. It also updates docs and test for Prometheus interceptor.

@RobertSamoilescu RobertSamoilescu requested a review from sakoush July 12, 2024 14:41
Copy link
Copy Markdown
Contributor

@sakoush sakoush left a comment

Choose a reason for hiding this comment

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

LGTM. I left some minor comments.

)

interceptors = []
self._interceptors = []
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why are we changing it, was that a bug?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was not a bug. Just needed a way to access the interceptors list for testing.

@@ -0,0 +1,129 @@
import pytest
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for adding these tests. ideally we also should test other metrics / errors but can happen as a follow up PR.

async def get_stream_request(request):
yield request

# send 10 requests
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
# send 10 requests
# send 1 requests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That should be 10, but I forgot to update the num_request var.

num_words = len(request_text.split())

assert int(counted_requests) == num_requests
assert int(counted_requests) * num_words == int(counted_responses)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: how are we actually counting the actual words in the responses?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The model used is a dummy text one which split words by white space. Each word is going to be streamed back by the model.

@RobertSamoilescu RobertSamoilescu merged commit ce93346 into SeldonIO:master Jul 15, 2024
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