Class PipelineMetricRegistry
java.lang.Object
org.graylog.plugins.pipelineprocessor.processors.PipelineMetricRegistry
A metric registry for processing pipelines, stages, and rules.
The registry simplifies metrics management by automatically applying metric name prefixes to metric registration and removal. It also applies the correct name pattern for metrics.
-
Method Summary
Modifier and TypeMethodDescriptionstatic PipelineMetricRegistrycreate(com.codahale.metrics.MetricRegistry metricRegistry, String pipelinesPrefix, String rulesPrefix) Creates a new pipeline metric registry.com.codahale.metrics.MeterregisterGlobalRuleMeter(String ruleId, String name) Registers a new global rule meter for the given rule ID and name.com.codahale.metrics.MeterregisterLocalRuleMeter(String pipelineId, int stage, String ruleId, String name) Registers a new local rule meter for the given pipeline ID, stage, rule ID, and name.com.codahale.metrics.MeterregisterPipelineMeter(String pipelineId, String name) Registers a new pipeline meter for the given pipeline ID and name.com.codahale.metrics.MeterregisterStageMeter(String pipelineId, int stage, String name) Registers a new stage meter for the given pipeline ID, stage, and name.voidremovePipelineMetrics(String pipelineId) Removes all pipeline metrics for the given pipeline ID from the registry.voidremoveRuleMetrics(String ruleId) Removes all rule metrics for the given rule ID from the registry.
-
Method Details
-
create
public static PipelineMetricRegistry create(com.codahale.metrics.MetricRegistry metricRegistry, String pipelinesPrefix, String rulesPrefix) Creates a new pipeline metric registry.- Parameters:
metricRegistry- metric registry to register the metrics withpipelinesPrefix- metric name prefix for pipelines and stagesrulesPrefix- metric name prefix for rules- Returns:
- the new pipeline metric registry instance
-
registerPipelineMeter
Registers a new pipeline meter for the given pipeline ID and name.- Parameters:
pipelineId- the pipeline IDname- the meter name- Returns:
- the new pipeline meter
- Throws:
IllegalArgumentException- if pipelineId or name are blank
-
registerStageMeter
Registers a new stage meter for the given pipeline ID, stage, and name.- Parameters:
pipelineId- the pipeline IDstage- the stage numbername- the meter name- Returns:
- the new stage meter
- Throws:
IllegalArgumentException- if pipelineId or name are blank
-
registerLocalRuleMeter
public com.codahale.metrics.Meter registerLocalRuleMeter(String pipelineId, int stage, String ruleId, String name) Registers a new local rule meter for the given pipeline ID, stage, rule ID, and name.A local meter name includes the pipeline ID and stage number to track metrics for the rule in a specific pipeline and stage.
- Parameters:
pipelineId- the pipeline IDstage- the stage numberruleId- the rule IDname- the meter name- Returns:
- the new local rule meter
- Throws:
IllegalArgumentException- if pipelineId, ruleId or name are blank
-
registerGlobalRuleMeter
Registers a new global rule meter for the given rule ID and name.A global meter name only includes the rule ID to track metrics for the rule overall.
- Parameters:
ruleId- the rule IDname- the meter name- Returns:
- the new local rule meter
- Throws:
IllegalArgumentException- if ruleId or name are blank
-
removePipelineMetrics
Removes all pipeline metrics for the given pipeline ID from the registry.- Parameters:
pipelineId- the pipeline ID- Throws:
IllegalArgumentException- if pipelineId is blank
-
removeRuleMetrics
Removes all rule metrics for the given rule ID from the registry.- Parameters:
ruleId- the rule ID- Throws:
IllegalArgumentException- if ruleId is blank
-