Is your feature request related to a problem? Please describe.
Currently PluginMetrics publishes metrics with prefix <pipeline-name>.<plugin-name>.<defined-by-plugins> which adds a restriction to publish any metrics from Data Prepper core peer forwarding or is some cases conditional routing router.
Describe the solution you'd like
Make the pipeline-name component more generic, it can be pipeline name / component-scope. Something like <generic-name>.<component-id>.<defined-metric-name>. So for metrics from core package we could prefix it by <component-scope> instead of a <pipeline-name>.
Examples:
- log-pipeline.buffer.numberOfRecords
- log-pipeline.grok.numberOfRecords
- log-pipeline.opensearch.numberOfRecords
- log-pipeline.router.defined-metric-name
- core.peer-forwarder.defined-metric-name
Pros:
- No need to change any existing code in
PluginMetrics class.
Cons:
- If pipeline name is
core all the metrics will be prefixed with core.
Describe alternatives you've considered (Optional)
An alternative could be <pipeline-name>.<component-scope>.<component-id>.<defined-metric-name>.
Examples:
- log-pipeline.buffer.buffer.numberOfRecords
- log-pipeline.processor.grok.numberOfRecords
- log-pipeline.sink.opensearch.numberOfRecords
- log-pipeline.core.peer-forwarder.defined-metric-name
- log-pipeline.core.router.defined-metric-name
Cons for alternative approach:
- Peer forwarder server side metrics might not be aware of the pipeline name in case of bad requests or if the request contains invalid pipeline name.
Additional context
|
public static PluginMetrics fromNames(final String name, final String pipelineName) { |
|
return new PluginMetrics(new StringJoiner(MetricNames.DELIMITER) |
|
.add(pipelineName) |
|
.add(name).toString()); |
Is your feature request related to a problem? Please describe.
Currently
PluginMetricspublishes metrics with prefix<pipeline-name>.<plugin-name>.<defined-by-plugins>which adds a restriction to publish any metrics from Data Prepper core peer forwarding or is some cases conditional routing router.Describe the solution you'd like
Make the pipeline-name component more generic, it can be pipeline name / component-scope. Something like
<generic-name>.<component-id>.<defined-metric-name>. So for metrics from core package we could prefix it by<component-scope>instead of a<pipeline-name>.Examples:
Pros:
PluginMetricsclass.Cons:
coreall the metrics will be prefixed withcore.Describe alternatives you've considered (Optional)
An alternative could be
<pipeline-name>.<component-scope>.<component-id>.<defined-metric-name>.Examples:
Cons for alternative approach:
Additional context
data-prepper/data-prepper-api/src/main/java/com/amazon/dataprepper/metrics/PluginMetrics.java
Lines 32 to 35 in e3b8a82