[DISCUSS]PIP-222: Add CommandPartitionedTopicMetadata metrics
Motivation
Currently, there's no way to track CommandPartitionedTopicMetadata requests. There's no metrics that indicate that a broker is handling CommandPartitionedTopicMetadata requests.
Misconfigured clients might flood brokers with CommandPartitionedTopicMetadata requests and cause high CPU consumption.
Goal
- Provide
pulsar_broker_command_execution_latencymetric - Provide
pulsar_broker_command_execution_failedmetric
API Changes
No response
Implementation
-
Initialize a
Histograminstance in ServerCnx.java to record the command execution latencyprivate static final Histogram COMMAND_EXECUTION_LATENCY = Histogram .build("pulsar_broker_command_execution_latency", "-") .unit("ms") .labelNames("command") .buckets(1, 10, 50, 100, 200, 500, 1000, 2000) .register();The instance has the following labels: a. cluster: The name of the cluster b. command: The name of the command
-
Initialize a
Counterinstance in ServerCnx.java to record the command execution failed opsprivate static final Counter COMMAND_EXECUTION_FAILED = Counter .build("pulsar_broker_command_execution_failed", "-") .labelNames("command", "code") .register();The instance has the following labels: a. cluster: The name of the cluster b. command: The name of the command c. code: The command execution failed reason, see ServerError
Alternatives
No response
Anything else?
Related issue link: https://github.com/apache/pulsar/issues/18243