pulsar
pulsar copied to clipboard
[feat][misc] PIP-264: Add OpenTelemetry authentication and token metrics
Motivation
Adds authentication and token metrics, as currently described here, to the OpenTelemetry pipeline.
Modifications
- Adds the metrics described in https://github.com/apache/pulsar-site/pull/937 to the collector runs. These metrics are not tied strictly to the broker, and can be used in other places as well (such as the proxy, for instance).
- Added override method
org.apache.pulsar.broker.authentication.AuthenticationProvider#initialize(org.apache.pulsar.broker.ServiceConfiguration, io.opentelemetry.api.OpenTelemetry), giving the authentication plugin access to the OpenTelemetry instance. - Added class
org.apache.pulsar.broker.authentication.AuthenticationProviderBase, used to initialize and maintain theAuthenticationMetricsobject. This class can be further used by the providers, simplifying development. - Removed unused static method
AuthenticationMetrics.authenticateSuccess
Verifying this change
- [x] Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
- Added test class
org.apache.pulsar.broker.stats.OpenTelemetryAuthenticationStatsTestcovering 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
- [x] The metrics: As described in https://github.com/apache/pulsar-site/pull/937
- [ ] Anything that affects deployment
Documentation
- [ ]
doc - [x]
doc-requiredhttps://github.com/apache/pulsar-site/pull/937 - [ ]
doc-not-needed - [ ]
doc-complete
Matching PR in forked repository
PR in forked repository: https://github.com/dragosvictor/pulsar/pull/22