Skip to content

[server][pubsub] PubSub health foundation: core types, config keys, metric dimension - #2929

Open
misyel wants to merge 2 commits into
linkedin:mainfrom
misyel:mkwong/pubsub-health-foundation
Open

[server][pubsub] PubSub health foundation: core types, config keys, metric dimension#2929
misyel wants to merge 2 commits into
linkedin:mainfrom
misyel:mkwong/pubsub-health-foundation

Conversation

@misyel

@misyel misyel commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

First of a stacked series splitting the PubSub Health Monitoring feature (#2534) into smaller reviewable chunks. This PR introduces only the foundational, behavior-free building blocks — no wiring, no call sites, all default-off.

What's included

New pubsub health types (venice-common):

  • PubSubHealthStatus (HEALTHY / UNHEALTHY)
  • PubSubHealthCategory (BROKER / METADATA_SERVICE) — also a metric dimension
  • PubSubHealthSignalProvider — pluggable detection interface
  • PubSubHealthChangeListener — state-transition callback interface

New config keys (all default-off) + VeniceServerConfig parsing:

Key Default
server.pubsub.health.monitor.enabled false
server.pubsub.partition.pause.enabled false
server.pubsub.health.probe.interval.seconds 30
server.pubsub.health.probe.topic ""

New OTel dimension VENICE_PUBSUB_HEALTH_CATEGORY (required by PubSubHealthCategory) + dimension unit tests.

Stack

This is PR 1 of a series that decomposes #2534:

  1. This PR — foundation (types, config, dimension)
  2. PubSub health OTel metric entity
  3. Monitor core (PubSubHealthMonitor + signal provider + stats)
  4. Ingestion integration: pause on outage
  5. Resume on recovery + server wiring + integration/E2E tests

How was this PR tested?

  • Compiles independently (venice-common, venice-client-common, da-vinci-client).
  • VeniceMetricsDimensionsTest, PubSubHealthCategoryTest pass.
  • No call sites yet; no behavior change.

Does this PR introduce any user-facing or breaking changes?

  • No.

…etric

dimension

First of a stacked series splitting the PubSub Health Monitoring feature
(linkedin#2534) into reviewable chunks. Introduces only the foundational,
behavior-free building blocks — no wiring, all default-off.

- New pubsub health types (venice-common):
  - PubSubHealthStatus (HEALTHY/UNHEALTHY)
  - PubSubHealthCategory (BROKER/METADATA_SERVICE) as a metric dimension
  - PubSubHealthSignalProvider (pluggable detection interface)
  - PubSubHealthChangeListener (state-transition callback interface)
- New config keys (all default-off) + VeniceServerConfig parsing:
  - server.pubsub.health.monitor.enabled
  - server.pubsub.partition.pause.enabled
  - server.pubsub.health.probe.interval.seconds
  - server.pubsub.health.probe.topic
- New OTel dimension VENICE_PUBSUB_HEALTH_CATEGORY (required by
  PubSubHealthCategory) + dimension unit tests.

No call sites yet; compiles and tests independently.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 20:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Introduces foundational (behavior-free) building blocks for upcoming PubSub Health Monitoring work: core health types, server config keys + parsing, and a new OpenTelemetry metric dimension to tag health category.

Changes:

  • Added core PubSub health enums/interfaces (PubSubHealthStatus, PubSubHealthCategory, PubSubHealthSignalProvider, PubSubHealthChangeListener) in venice-common.
  • Introduced new server config keys in ConfigKeys and parsed/exposed them via VeniceServerConfig getters (all default-off).
  • Added new OTel dimension VENICE_PUBSUB_HEALTH_CATEGORY plus unit tests covering dimension naming and enum-to-dimension behavior.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/venice-common/src/main/java/com/linkedin/venice/pubsub/PubSubHealthStatus.java Adds enum for HEALTHY/UNHEALTHY status.
internal/venice-common/src/main/java/com/linkedin/venice/pubsub/PubSubHealthSignalProvider.java Adds pluggable interface for providing PubSub health signals.
internal/venice-common/src/main/java/com/linkedin/venice/pubsub/PubSubHealthChangeListener.java Adds callback interface for health state transitions.
internal/venice-common/src/main/java/com/linkedin/venice/pubsub/PubSubHealthCategory.java Adds enum for health categories and binds it to an OTel dimension.
internal/venice-common/src/main/java/com/linkedin/venice/ConfigKeys.java Adds new PubSub health monitoring config keys (default-off).
internal/venice-client-common/src/main/java/com/linkedin/venice/stats/dimensions/VeniceMetricsDimensions.java Adds new OTel dimension constant for PubSub health category.
internal/venice-client-common/src/test/java/com/linkedin/venice/stats/dimensions/VeniceMetricsDimensionsTest.java Extends dimension naming tests to cover the new dimension.
internal/venice-client-common/src/test/java/com/linkedin/venice/stats/dimensions/PubSubHealthCategoryTest.java Adds tests for PubSubHealthCategory implementing the dimension interface.
clients/da-vinci-client/src/main/java/com/linkedin/davinci/config/VeniceServerConfig.java Parses and exposes new PubSub health-related server configs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


/**
* A pluggable provider of health signals for PubSub targets. The PubSub health monitor
* aggregates signals from all registered providers to determine overall broker health.
configs

Covers the diffCoverage gate for da-vinci-client: exercises the new
pubsub-health config getters and both sides of the
`pubSubHealthMonitorEnabled && ...` short-circuit in partition-pause
resolution (monitor-on honors pause, monitor-off gates it off), plus the
default values.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 23:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

internal/venice-common/src/main/java/com/linkedin/venice/pubsub/PubSubHealthSignalProvider.java:6

  • The class-level Javadoc says the monitor "determine[s] overall broker health", but this provider API is for PubSub targets across categories (including METADATA_SERVICE). The wording should be target/category-neutral to avoid misleading future implementers.
 * A pluggable provider of health signals for PubSub targets. The PubSub health monitor
 * aggregates signals from all registered providers to determine overall broker health.
 *

Comment on lines +191 to +192
/** {@link com.linkedin.venice.pubsub.PubSubHealthCategory} */
VENICE_PUBSUB_HEALTH_CATEGORY("venice.pubsub.health.category");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants