[server] Otel integration in server for HeartBeatStat Metrics #2363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Statement
Otel integration in server for HeartBeatStat Metrics
Solution
Current tehuti integration: using heart beat metrics as an example. There are 2 layers
Layer 1: metrics in
HeartbeatStatclass of different types (Rate(),Min(),Max(), etc) are created used local metrics repository, thus can't be exported. These are created for each version availableLayer 2: metrics in
HeartbeatStatReporterclass, all of which areAsyncGauge()which reads from the metrics in layer 1 for the current/future versions. These gets exported.This brings in a complexity where 2 sets of metrics needs to be maintained and the 2nd layer should be always a Gauge leading to the metric name having _min/_min/_avg suffixes to note what its measuring, thus limiting what could be exported. Moving to OpenTelemetry, I want to remove this complexity and make it just a single layer and use a dimension to denote whether it belongs to current/future/other versions and thus could export histograms directly. The new metrics are defined/recorded at
HeartbeatVersionedStatsclass instead where the previous layer 1 metrics are recorded.New Otel metric:
venice.server.ingestion.replication.heartbeat.delay(Histogram)New Dimensions:
venice.replica.type: leader/followervenice.replica.state: ready_to_serve/catching_upvenice.version.type: current/future/otherCode changes
Concurrency-Specific Checks
Both reviewer and PR author to verify
synchronized,RWLock) are used where needed.ConcurrentHashMap,CopyOnWriteArrayList).How was this PR tested?
Does this PR introduce any user-facing or breaking changes?