-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat: Add metrics for pull query request/response size in bytes #6148
Conversation
@@ -112,6 +118,9 @@ static void handleOldApiResponse(final Server server, final RoutingContext routi | |||
response.end(responseBody); | |||
} | |||
} | |||
pullQueryMetrics |
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.
This is the only place where we have access to the response sent over the wire. That's why I had to pass the pullQueryMetrics
object in here
ksqldb-rest-app/src/main/java/io/confluent/ksql/rest/server/execution/PullQueryExecutor.java
Show resolved
Hide resolved
//Record latency at microsecond scale | ||
final long nowNanos = Time.SYSTEM.nanoseconds(); | ||
final double latency = TimeUnit.NANOSECONDS.toMicros(nowNanos - startTimeNanos); | ||
pullQueryMetrics.get().recordLatency(latency); |
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.
I am not measuring the request/response here since I don't have access to the HttpServerRequest/HttpServerResponse objects here
ksqldb-rest-app/src/main/java/io/confluent/ksql/api/server/ServerVerticle.java
Outdated
Show resolved
Hide resolved
ksqldb-rest-app/src/main/java/io/confluent/ksql/rest/server/KsqlServerEndpoints.java
Show resolved
Hide resolved
...rest-app/src/main/java/io/confluent/ksql/rest/server/execution/PullQueryExecutorMetrics.java
Outdated
Show resolved
Hide resolved
ksqldb-rest-app/src/main/java/io/confluent/ksql/api/server/OldApiUtils.java
Show resolved
Hide resolved
ksqldb-rest-app/src/main/java/io/confluent/ksql/api/impl/QueryEndpoint.java
Outdated
Show resolved
Hide resolved
ksqldb-rest-app/src/main/java/io/confluent/ksql/rest/server/execution/PullQueryExecutor.java
Show resolved
Hide resolved
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.
Just a few last comments.
...rest-app/src/main/java/io/confluent/ksql/rest/server/execution/PullQueryExecutorMetrics.java
Outdated
Show resolved
Hide resolved
...-app/src/test/java/io/confluent/ksql/rest/server/execution/PullQueryExecutorMetricsTest.java
Show resolved
Hide resolved
...rest-app/src/main/java/io/confluent/ksql/rest/server/execution/PullQueryExecutorMetrics.java
Show resolved
Hide resolved
ksqldb-rest-app/src/main/java/io/confluent/ksql/api/server/OldApiUtils.java
Outdated
Show resolved
Hide resolved
55cd6d7
to
db74090
Compare
Description
Add metrics for pull query request/response size in bytes. I added it only to the
StreamedQueryResource
and not theWSQueryEndpoint
since in the latter I don't have access to the vertx objects to measure their size. Also, it's not important to measure the size for queries issued from the UI editor.Testing done
Local testing with issuing pull queries and checking the value of the metrics
Reviewer checklist