-
Notifications
You must be signed in to change notification settings - Fork 836
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
allow custom metrics export via metrics
method for predict_raw
-based nodes
#4863
base: master
Are you sure you want to change the base?
Conversation
Hi @tandav. Thanks for your PR. I'm waiting for a SeldonIO or todo member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the jenkins-x/lighthouse repository. |
def metrics
method for predict_raw
-based nodesmetrics
method for predict_raw
-based nodes
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.
Hey @tandav ,
As far as I understand, you can return anything you want from the predict_raw
method. Therefore, why would you have a meta
field there in the first place?
@@ -102,6 +102,7 @@ def predict( | |||
if hasattr(user_model, "predict_raw"): | |||
try: | |||
response = user_model.predict_raw(request) | |||
client_custom_metrics(user_model, seldon_metrics, PREDICT_METRIC_METHOD_TAG, []) |
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.
As it is, this would double count metrics on both client_custom_metrics
and handle_raw_custom_metrics
.
@adriangonz, if I understand correctly, currently there is only one way to write custom metrics to Seldon's metrics server when using Here are the two locations in the source code where custom metrics are handled:
As stated in the original PR description, the Considering your comment about the potential issue of double-counting metrics, I would like to propose the following solutions:
|
Hey @tandav , Thanks for that clarification - I can see the point of your use case now and why it would make sense. Based on what you describe, it probably makes sense to stick with option To make it more clear though - and to be aligned with non-raw - I would add a couple changes to the existing PR:
|
|
What this PR does / why we need it:
This PR adds support for using custom metrics export via the
def metrics
method forpredict_raw
-based inference nodes and not add['meta']['metrics']
key in response.My current project requires exact response schema and extra fields like
meta
are forbidden. Unfortunately the only way to use custom metrics in current seldon-core code is via['meta']['metrics']
field in response.INCLUDE_METRICS_IN_CLIENT_RESPONSE=false
environment variable does not help because it only deletesmeta.metrics
key, but keepsmeta
.One more possible solution: run one more metrics webserver using custom_service. But custom_service usage is undocumented and will require to add 2 metrics endpoints to prometheus scraper instead of 1. (Because variable
seldon_metrics
is not accessible globally (from other thread)) and you can't write/merge metrics to sameSeldonMetrics
container.So this PR fixes this. Basically I just added parsing metrics from
metrics
topredict_raw
if
branch.