Open dlvenable opened 1 year ago
Rather than continuing to include the pipelineName
in the metric name, I think making use of Micrometer tags would allow for better metrics. This would map to Amazon CloudWatch metrics and dimensions.
Metric name:
{componentType}.{metricName}
New tags:
pipelineName={pipelineName}
pluginId={pluginId}
Example:
my-pipeline1:
...
sink:
- opensearch:
- opensearch:
...
my-pipeline2:
...
sink:
- opensearch:
Here are some of the metrics:
Metric Name | tag: pipelineName | tag: pluginId |
---|---|---|
opensearch.documentsSuccess |
my-pipeline1 |
opensearch |
opensearch.documentsSuccess |
my-pipeline1 |
opensearch2 |
opensearch.bulkRequestFailed |
my-pipeline1 |
opensearch |
opensearch.bulkRequestFailed |
my-pipeline1 |
opensearch2 |
opensearch.bulkRequestErrors |
my-pipeline1 |
opensearch |
opensearch.bulkRequestErrors |
my-pipeline1 |
opensearch2 |
opensearch.documentsSuccess |
my-pipeline2 |
opensearch |
opensearch.bulkRequestFailed |
my-pipeline2 |
opensearch |
opensearch.bulkRequestErrors |
my-pipeline2 |
opensearch |
We should also make changes to the metrics to differentiate between the plugin types. This may be done well through the use of a tag to indicate the type.
Background
Data Prepper has an existing metric naming convention of:
The
{metricName}
part is custom to each plugin. The{pipelineName}.{pluginType}
is determined by thePluginMetrics
class and is standard to all Data Prepper metrics.Problems
There are a few problems with this convention:
s3
source and sink now. And there will be akafka
source and sink as well.Proposal
Update our plugin metric naming. I'd like to suggest that we use consistent names for any plugin type. And then we would use tags/dimensions to disambiguate pipelines and pluginIds.
New metric name:
New tags per metric:
The
componentType
is the type of pipeline component represented. This would besource
,sink
,processor
, orbuffer
.The
pluginId
is the plugin Id which would be added by #1025.Expanded Metric Proposal
Also, we currently disallow pipelines to be named
core
ordata-prepper
in order to reserve this.Thus, all Data Prepper metrics will have the following form.
The
scopeIdentifier
can be one of the following:core
data-prepper
source
,processor
.If the
scopeIdentifier
is a pipeline component, then the plugin metric convention above applies. Forcore
anddata-prepper
, the plugin metric convention does not apply and it will depend on the specific metrics.Migration
This new plugin metric definition is a breaking change. Thus, we can offer a flag to enable these metrics and remove it a major version bump.
In
data-prepper-core.yaml
, provide a new property namedmetric_naming
. It will have two options:v1
- The current naming; the defaultv2
- The new naming conventionDependencies
1025
Tasks
PluginMetrics
to an interfacePluginMetrics
depending on the naming convention