Skip to content

Support additional context in metrics prefix #1789

@asifsmohammed

Description

@asifsmohammed

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());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions