Skip to content
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

Add Feast Serving gRPC call metrics #509

Merged
merged 4 commits into from
Mar 9, 2020

Conversation

ashwinath
Copy link
Contributor

What this PR does / why we need it:
Feast Serving does not expose grpc prometheus metrics.

Which issue(s) this PR fixes:
None

Fixes #

Does this PR introduce a user-facing change?:
None

gRPC calls in feast serving now exposes prometheus metrics.

@feast-ci-bot
Copy link
Collaborator

Hi @ashwinath. Thanks for your PR.

I'm waiting for a gojek member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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 kubernetes/test-infra repository.

@ashwinath
Copy link
Contributor Author

/assign @davidheryanto

@woop
Copy link
Member

woop commented Mar 4, 2020

Which issue is this in relation to?

@ashwinath
Copy link
Contributor Author

It was an issue @davidheryanto brought up regarding Feast Serving needing to expose a metric to count erronous requests. As of now, the stats from the gRPC calls were not captured, but rather the methods it invoked were captured; missing out on the gRPC error codes. This PR adds the gRPC codes into the labels of feast_serving_request_latency_ms.

@davidheryanto
Copy link
Collaborator

Yeah currently for Feast Serving these are the metrics we record
https://github.com/gojek/feast/blob/master/serving/src/main/java/feast/serving/util/Metrics.java#L22

But it's missing metric about errors, which is quite important because it may indicate something wrong with Feast serving GRPC servers. So I think we should also include GRPC status code label to the metric https://github.com/grpc/grpc/blob/master/doc/statuscodes.md

So we can identify how many request Feast serving failed to handle due to different reasons.

@ashwinath
Copy link
Contributor Author

ashwinath commented Mar 5, 2020

Hi, I split them into two metrics. Load tested with 20 records

ghz --insecure \
    --call feast.serving.ServingService/GetOnlineFeatures localhost:6566 \
    --concurrency=10 \
    --qps=1000 \
    --total=10000 \
    --connections=1 \
    --data="{
        "'"'"features"'"'": {
          "'"'"project"'"'": "'"'"your_project_name"'"'",
          "'"'"name"'"'": "'"'"city"'"'",
          "'"'"version"'"'": 1
        },
        "'"'"entity_rows"'"'": [
            {
                "'"'"fields"'"'": {
                    "'"'"driver_id"'"'": {
                        "'"'"int64_val"'"'": 1234
                    }
                }
            }
        ]
    }"

Hovering around P95: 4ms, P99: 5ms for both master branch and this PR.

Similar results for 2000 QPS also

@woop
Copy link
Member

woop commented Mar 5, 2020

Looks much better, thanks @ashwinath and @davidheryanto

@ches ches changed the title Add feast serving gRPC calls metrics Add Feast Serving gRPC call metrics Mar 7, 2020
@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ashwinath, woop

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@woop
Copy link
Member

woop commented Mar 9, 2020

/ok-to-test

@woop
Copy link
Member

woop commented Mar 9, 2020

/test test-end-to-end-batch

Copy link
Member

@ches ches left a comment

Choose a reason for hiding this comment

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

A test might be good, but if we feel this looks like overkill for a small metrics interceptor, then I think it'd be nice to mention the method name label in the class Javadoc with an example of what it looks like.

* GrpcMonitoringInterceptor intercepts GRPC calls to provide request latency histogram metrics in
* the Prometheus client.
*/
public class GrpcMonitoringInterceptor implements ServerInterceptor {
Copy link
Member

Choose a reason for hiding this comment

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

Bikeshedding on naming if you'll bear with me… it's more about request/response metrics than monitoring, monitoring would be what you might externally do with the metrics ☺️

Also I wonder if anyone would object to dropping the Grpc prefix, I imagine everything in the interceptors package will be a gRPC interceptor so perhaps it's redundant. What do you think of:

Suggested change
public class GrpcMonitoringInterceptor implements ServerInterceptor {
public class RequestMetricsInterceptor implements ServerInterceptor {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes sounds reasonable to me. I think we need to create a new PR?

Although the sample library for integrating Prometheus with GRPC in Java uses the monitoring term as well :)
https://github.com/grpc-ecosystem/java-grpc-prometheus/tree/master/src/main/java/me/dinowernli/grpc/prometheus

I guess as long as we're consistent.

@woop
Copy link
Member

woop commented Mar 9, 2020

/lgtm

@feast-ci-bot feast-ci-bot merged commit fb2430a into feast-dev:master Mar 9, 2020
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.

5 participants