-
Notifications
You must be signed in to change notification settings - Fork 86
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
[all] OpenTelemetry metrics integration in venice-router #1303
Conversation
...enice-common/src/main/java/com/linkedin/venice/stats/dimensions/VeniceMetricsDimensions.java
Outdated
Show resolved
Hide resolved
Should the PR title (and commit message) change |
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 did one pass of this. Super excited for this. Great job 🚀
...ce-client-common/src/main/java/com/linkedin/venice/stats/StatsSupplierMetricsRepository.java
Outdated
Show resolved
Hide resolved
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsConfig.java
Outdated
Show resolved
Hide resolved
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsConfig.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
services/venice-router/src/main/java/com/linkedin/venice/router/RouterServer.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/api/VeniceResponseAggregator.java
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
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.
I finished a first pass on this PR... There may be some comments that we choose to not address, or maybe not address yet, but that we still want to get to later. Please take a look and LMK what you think.
internal/venice-client-common/src/main/java/com/linkedin/venice/read/RequestType.java
Outdated
Show resolved
Hide resolved
...nal/venice-client-common/src/main/java/com/linkedin/venice/stats/AbstractVeniceAggStats.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/StatsSupplierVeniceMetricsRepository.java
Outdated
Show resolved
Hide resolved
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsConfig.java
Outdated
Show resolved
Hide resolved
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsConfig.java
Outdated
Show resolved
Hide resolved
...ommon/src/main/java/com/linkedin/venice/stats/dimensions/VeniceRequestValidationOutcome.java
Outdated
Show resolved
Hide resolved
services/venice-router/src/main/java/com/linkedin/venice/router/RouterServer.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
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.
Another quick pass on the latest update... thanks for iterating!
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsConfig.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
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.
I'm excited for this change to go in.
...nal/venice-client-common/src/main/java/com/linkedin/venice/stats/AbstractVeniceAggStats.java
Outdated
Show resolved
Hide resolved
...al/venice-client-common/src/test/java/com/linkedin/venice/stats/VeniceMetricsConfigTest.java
Outdated
Show resolved
Hide resolved
...common/src/test/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepositoryTest.java
Outdated
Show resolved
Hide resolved
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsConfig.java
Outdated
Show resolved
Hide resolved
...al/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsRepository.java
Outdated
Show resolved
Hide resolved
...al/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsRepository.java
Outdated
Show resolved
Hide resolved
...al/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsRepository.java
Outdated
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.
One more pass. I think this is moving in the right direction! Thanks for iterating!
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/MetricEntity.java
Outdated
Show resolved
Hide resolved
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/MetricEntity.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
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.
Thanks for the reviews @nisargthakkar @FelixGV @KaiSernLim. Addressed some of the changes and left some replies.
...al/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsRepository.java
Outdated
Show resolved
Hide resolved
...common/src/test/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepositoryTest.java
Outdated
Show resolved
Hide resolved
...al/venice-client-common/src/test/java/com/linkedin/venice/stats/VeniceMetricsConfigTest.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
...ommon/src/main/java/com/linkedin/venice/stats/dimensions/VeniceRequestValidationOutcome.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsConfig.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
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.
One more round... Thanks for continuing to refine this PR. I think it would be good to meet, which might help speed up iterations.
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
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.
Thanks for the continuous feedback. Addressed some comments.
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
...al/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsRepository.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/StatsSupplierVeniceMetricsRepository.java
Outdated
Show resolved
Hide resolved
services/venice-router/src/main/java/com/linkedin/venice/router/RouterServer.java
Outdated
Show resolved
Hide resolved
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsConfig.java
Outdated
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.
Leaving some comments. But I still need to go through the changes
services/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterMetricEntities.java
Outdated
Show resolved
Hide resolved
...enice-common/src/main/java/com/linkedin/venice/stats/dimensions/VeniceMetricsDimensions.java
Outdated
Show resolved
Hide resolved
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsConfig.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
...common/src/main/java/com/linkedin/venice/stats/dimensions/VeniceRequestRetryAbortReason.java
Outdated
Show resolved
Hide resolved
.../venice-client-common/src/main/java/com/linkedin/venice/stats/metrics/AllMetricEntities.java
Outdated
Show resolved
Hide resolved
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/metrics/MetricUnit.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
Show resolved
Hide resolved
...nal/venice-client-common/src/main/java/com/linkedin/venice/stats/AbstractVeniceAggStats.java
Outdated
Show resolved
Hide resolved
services/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterMetricEntities.java
Outdated
Show resolved
Hide resolved
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/VeniceMetricsConfig.java
Outdated
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.
Thanks Manoj. Just finished one more pass on the latest diff...
I think the most important thing to fix/refactor now is the enum carrying static mutable state. Besides this, it seems we are pretty close to merging for v1 of this project.
...nal/venice-client-common/src/main/java/com/linkedin/venice/stats/AbstractVeniceAggStats.java
Outdated
Show resolved
Hide resolved
...nal/venice-client-common/src/main/java/com/linkedin/venice/stats/AbstractVeniceAggStats.java
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
...rnal/venice-test-common/src/integrationTest/java/com/linkedin/venice/endToEnd/TestBatch.java
Outdated
Show resolved
Hide resolved
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
Show resolved
Hide resolved
2. rename HISTOGRAM_WITHOUT_BUCKETS 3. remove modifying input argument in createInstrument 4. removed AllMetricEntities.java and moved RouterMetricEntities.java to router sub module
f746f2d
to
3b13435
Compare
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.
One more round... getting closer and closer! Thanks for continuing to iterate!
...ent-common/src/main/java/com/linkedin/venice/stats/VeniceOpenTelemetryMetricsRepository.java
Outdated
Show resolved
Hide resolved
...ommon/src/main/java/com/linkedin/venice/stats/dimensions/HttpResponseStatusCodeCategory.java
Show resolved
Hide resolved
...lient-common/src/main/java/com/linkedin/venice/stats/dimensions/RequestRetryAbortReason.java
Outdated
Show resolved
Hide resolved
...ient-common/src/main/java/com/linkedin/venice/stats/dimensions/RequestValidationOutcome.java
Outdated
Show resolved
Hide resolved
...-common/src/main/java/com/linkedin/venice/stats/dimensions/VeniceResponseStatusCategory.java
Outdated
Show resolved
Hide resolved
.../venice-client-common/src/main/java/com/linkedin/venice/stats/metrics/MetricEntityState.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
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.
Thanks Felix, for the reviews.
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
Show resolved
Hide resolved
.../venice-client-common/src/main/java/com/linkedin/venice/stats/metrics/MetricEntityState.java
Outdated
Show resolved
Hide resolved
...lient-common/src/main/java/com/linkedin/venice/stats/dimensions/RequestRetryAbortReason.java
Outdated
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.
I think we're good to go! Thanks for all the effort going into this first milestone of OTel integration! Looking forward to the next steps!
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
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.
Thanks @FelixGV for the review. Addressed the last nit comments.
...ommon/src/main/java/com/linkedin/venice/stats/dimensions/HttpResponseStatusCodeCategory.java
Show resolved
Hide resolved
...ces/venice-router/src/main/java/com/linkedin/venice/router/stats/RouterHttpRequestStats.java
Outdated
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.
Nice, thanks Manoj!
Summary
Initial integration of
openTelemetry
invenice-router
.Changes:
MetricsRepository
holdingMetricsConfig
was passed around from service creation throughout the service code to carrying the config and the metrics. IntroducedVeniceMetricsRepository
to extendMetricsRepository
and also holdVeniceOpenTelemetryMetricsRepository
. IntroducedVeniceMetricsConfig
to includetehuti
'sMetricConfig
and Otel config. EitherMetricsRepository
orVeniceMetricsRepository
can be passed in during router service creation and ifVeniceMetricsRepository
is used and if otel configs are enabled, otel metrics will be used along with tehuti metrics.VeniceOpenTelemetryMetricsRepository
holdshistogramMap
andcounterMap
to create a counter only once regardless for multiple request types and store name: Those should be dimensions instead.otel.venice.enabled
=> To enable/disable opentelemetry in veniceotel.venice.export.to.log
=> Export the metrics to logs, for debug purposesotel.venice.export.to.endpoint
=> Export metrics to the configured endpointotel.venice.metrics.naming.format
=>VeniceOpenTelemetryMetricNamingFormat
=> snake_case (default), pascal_case, camel_caseotel.venice.custom.dimensions.map
=> Can be configured to pass in custom dimensions or system dimensions.It also uses existing otel configs to configure the endpoints like below and other opentelemetry supported configs
Optimizations in line for the next iteration:
record()
MetricEntityState
to not have to do a lookup of tehuti metric everytime record() is calledmaxScale
andmaxBuckets
configrecord()
for pre aggregations in code. For instance: ifstoreName
istotal
ortotal.<clusterName>
How was this PR tested?
unit tests
Does this PR introduce any user-facing changes?
Introduces
OpenTelemetry
metrics into theVenice
world.Tehuti
Instrumentation will work as it is and if Otel is enabled, Otel metrics will also be emitted as per config on top of the existing tehuti metrics.