Skip to content
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][broker] PIP-264: Add schema registry metrics #22624

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

dragosvictor
Copy link
Contributor

PIP-264

Motivation

Exposes the current Schema Registry metrics described in the doc using OpenTelemetry.

Modifications

Modified SchemaRegistryStats to expose metrics pulsar.broker.request.schema_registry.duration and pulsar.broker.operation.schema_registry.compatibility_check.count. A full description of these metrics can be found in the documentation PR: apache/pulsar-site#892. Unlike the former approach, this records request latencies irrespective of the response type (success/failure), thus simplifying the design.

Modified SchemaRegistryStats to not be a singleton. This fits better with the OpenTelemetry design and allows for easier testing, as resources are not shared across tests. It broke parameterized test class SimpleSchemaTest, which had to be fixed by reordering the test based on the test instance object first. This way, no two instances of the same metric co-exist, as expected by the OpenTelemetry SDK.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Extended tests SchemaServiceTest#testSchemaRegistryMetrics and SchemaServiceTest#checkIsCompatible to validate the new metrics

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
  • The metrics: As described above
  • Anything that affects deployment

Documentation

Matching PR in forked repository

PR in forked repository: dragosvictor#19

@dragosvictor dragosvictor marked this pull request as ready for review May 1, 2024 06:49
@github-actions github-actions bot added the doc-required Your PR changes impact docs and you will update later. label May 1, 2024
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@nodece
Copy link
Member

nodece commented May 5, 2024

/pulsarbot rerun-failure-checks

@lhotari
Copy link
Member

lhotari commented May 20, 2024

@dragosvictor please resolve the merge conflicts in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-required Your PR changes impact docs and you will update later.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants