fix the broker stats with different environments #570
Merged
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.
Motivation
the current state of the master branch does not work for broker stats (they are empty) and collecting is failing with exceptions.
Probably because of the implementation how the
BrokerStatsImp
finds the broker for a specified cluster.Currently, there are multiple problems:
https://brokers.pulsar.internal:8443
found brokers:http://broker01.pulsar.internal:8080
even the brokers are configured with tls. the environment token is then not found for broker01, it matches only brokers.pulsar.internal.tls.enabled
enables not only TLS-Transport-Encryption, it configures TLS Client Auth, which is not in all scenarios needed or wanted. I would like to have TLS Cmmunication and Token-Auth.http://
orhttps://
is scattered.the changes contained in this pull request should sufficiently fix broker metric collection for TLS+TokenAuth (not TLS Client Auth) environments.
Modifications
collectStatsToDB
Verifying this change
./gradlew build
checks.