diff --git a/processor/filterprocessor/metrics.go b/processor/filterprocessor/metrics.go index 8efca9df1823..10551d3dd117 100644 --- a/processor/filterprocessor/metrics.go +++ b/processor/filterprocessor/metrics.go @@ -116,7 +116,7 @@ func (fmp *filterMetricProcessor) processMetrics(ctx context.Context, md pmetric return md, nil } - metricCountBeforeFilters := md.MetricCount() + metricDataPointCountBeforeFilters := md.DataPointCount() var errors error md.ResourceMetrics().RemoveIf(func(rmetrics pmetric.ResourceMetrics) bool { @@ -172,8 +172,8 @@ func (fmp *filterMetricProcessor) processMetrics(ctx context.Context, md pmetric return rmetrics.ScopeMetrics().Len() == 0 }) - metricCountAfterFilters := md.MetricCount() - fmp.telemetry.record(triggerMetricsDropped, int64(metricCountBeforeFilters-metricCountAfterFilters)) + metricDataPointCountAfterFilters := md.DataPointCount() + fmp.telemetry.record(triggerMetricDataPointsDropped, int64(metricDataPointCountBeforeFilters-metricDataPointCountAfterFilters)) if errors != nil { fmp.logger.Error("failed processing metrics", zap.Error(errors)) diff --git a/processor/filterprocessor/telemetry.go b/processor/filterprocessor/telemetry.go index 13cb7d586219..43e8db694c92 100644 --- a/processor/filterprocessor/telemetry.go +++ b/processor/filterprocessor/telemetry.go @@ -19,17 +19,17 @@ import ( type trigger int const ( - triggerMetricsDropped trigger = iota + triggerMetricDataPointsDropped trigger = iota triggerLogsDropped triggerSpansDropped ) var ( - typeStr = metadata.Type - processorTagKey = tag.MustNewKey(typeStr) - statMetricsFiltered = stats.Int64("metrics.filtered", "Number of metrics dropped by the filter processor", stats.UnitDimensionless) - statLogsFiltered = stats.Int64("logs.filtered", "Number of logs dropped by the filter processor", stats.UnitDimensionless) - statSpansFiltered = stats.Int64("spans.filtered", "Number of spans dropped by the filter processor", stats.UnitDimensionless) + typeStr = metadata.Type + processorTagKey = tag.MustNewKey(typeStr) + statMetricDataPointsFiltered = stats.Int64("metrics.filtered", "Number of metric data points dropped by the filter processor", stats.UnitDimensionless) + statLogsFiltered = stats.Int64("logs.filtered", "Number of logs dropped by the filter processor", stats.UnitDimensionless) + statSpansFiltered = stats.Int64("spans.filtered", "Number of spans dropped by the filter processor", stats.UnitDimensionless) ) func init() { @@ -42,9 +42,9 @@ func metricViews() []*view.View { return []*view.View{ { - Name: processorhelper.BuildCustomMetricName(typeStr, statMetricsFiltered.Name()), - Measure: statMetricsFiltered, - Description: statMetricsFiltered.Description(), + Name: processorhelper.BuildCustomMetricName(typeStr, statMetricDataPointsFiltered.Name()), + Measure: statMetricDataPointsFiltered, + Description: statMetricDataPointsFiltered.Description(), Aggregation: view.Sum(), TagKeys: processorTagKeys, }, @@ -89,8 +89,8 @@ func newfilterProcessorTelemetry(set processor.CreateSettings) (*filterProcessor func (fpt *filterProcessorTelemetry) record(trigger trigger, dropped int64) { var triggerMeasure *stats.Int64Measure switch trigger { - case triggerMetricsDropped: - triggerMeasure = statMetricsFiltered + case triggerMetricDataPointsDropped: + triggerMeasure = statMetricDataPointsFiltered case triggerLogsDropped: triggerMeasure = statLogsFiltered case triggerSpansDropped: