pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[feat][broker] PIP-264: Add replication subscription stats

Open dragosvictor opened this issue 1 year ago • 0 comments

PIP-264

Motivation

Adds replicated subscription metrics, defined here and here, to the OpenTelemetry pipeline.

Modifications

  • Added metrics, as described by https://github.com/apache/pulsar-site/pull/941, to the OpenTelemetry pipeline. Since these metrics expose no high-cardinality attributes, they can be stored as synchronous OpenTelemetry instruments.
  • Instead of the existing Prometheus pulsar_replicated_subscriptions_pending_snapshots counter, opted to expose the number of snapshot operations attempted. The snapshot duration histogram maintains the number of operations completed. Using these values, the number of pending snapshots can be computed at any time.

Verifying this change

  • [x] Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Updated test ReplicatedSubscriptionTest#testReplicatedSubscriptionAcrossTwoRegions to cover the new metric values.

Does this pull request potentially affect one of the following parts:

  • [ ] Dependencies (add or upgrade a dependency)
  • [ ] The public API
  • [ ] The schema
  • [ ] The default values of configurations
  • [ ] The threading model
  • [ ] The binary protocol
  • [ ] The REST endpoints
  • [ ] The admin CLI options
  • [x] The metrics: As described in https://github.com/apache/pulsar-site/pull/941
  • [ ] Anything that affects deployment

Documentation

  • [ ] doc
  • [x] doc-required https://github.com/apache/pulsar-site/pull/941
  • [ ] doc-not-needed
  • [ ] doc-complete

Matching PR in forked repository

PR in forked repository: https://github.com/dragosvictor/pulsar/pull/40

dragosvictor avatar Jul 11 '24 19:07 dragosvictor