Skip to content

Commit

Permalink
[processor/metricsgeneration] Remove "experimental_" prefix (open-tel…
Browse files Browse the repository at this point in the history
…emetry#35821)

The processor now has to be defined as `metricsgeneration` instead of
`experimental_metricsgeneration` in OTel collector configuration files.

Fixes
open-telemetry#35426
  • Loading branch information
dmitryax authored Oct 16, 2024
1 parent 71d2939 commit ca26982
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 37 deletions.
27 changes: 27 additions & 0 deletions .chloggen/remove-experimental-metrics-generator-prefix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: processor/metricsgeneration

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove "experimental_" prefix from metrics generator processor name.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35426]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
6 changes: 3 additions & 3 deletions processor/metricsgenerationprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

## Description

The metrics generation processor (`experimental_metricsgenerationprocessor`) can be used to create new metrics using existing metrics following a given rule. This processor currently supports the following two rule types for creating a new metric.
The metrics generation processor (`metricsgenerationprocessor`) can be used to create new metrics using existing metrics following a given rule. This processor currently supports the following two rule types for creating a new metric.

1. `calculate`: It can create a new metric from two existing metrics by applying one of the following arithmetic operations: add, subtract, multiply, divide, or percent. One use case is to calculate the `pod.memory.utilization` metric like the following equation-
`pod.memory.utilization` = (`pod.memory.usage.bytes` / `node.memory.limit`)
Expand All @@ -42,8 +42,8 @@ match the given metric names and apply the specified operation to those metrics.

```yaml
processors:
# processor name: experimental_metricsgeneration
experimental_metricsgeneration:
# processor name: metricsgeneration
metricsgeneration:

# specify the metric generation rules
rules:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion processor/metricsgenerationprocessor/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type: experimental_metricsgeneration
type: metricsgeneration

status:
class: processor
Expand Down
2 changes: 1 addition & 1 deletion processor/metricsgenerationprocessor/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ func TestGoldenFileMetrics(t *testing.T) {
factory := NewFactory()
cfg := factory.CreateDefaultConfig()

sub, err := cm.Sub(fmt.Sprintf("%s/%s", "experimental_metricsgeneration", testCase.name))
sub, err := cm.Sub(fmt.Sprintf("%s/%s", "metricsgeneration", testCase.name))
require.NoError(t, err)
require.NoError(t, sub.Unmarshal(cfg))

Expand Down
16 changes: 8 additions & 8 deletions processor/metricsgenerationprocessor/testdata/config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
experimental_metricsgeneration:
metricsgeneration:
rules:
- name: new_metric
unit: percent
Expand All @@ -13,55 +13,55 @@ experimental_metricsgeneration:
scale_by: 1000
operation: multiply

experimental_metricsgeneration/invalid_generation_type:
metricsgeneration/invalid_generation_type:
rules:
- name: new_metric
type: invalid # invalid generation type
metric1: metric1
metric2: metric2
operation: percent

experimental_metricsgeneration/invalid_operation:
metricsgeneration/invalid_operation:
rules:
- name: new_metric
type: calculate
metric1: metric1
metric2: metric2
operation: invalid # invalid operation type

experimental_metricsgeneration/missing_new_metric:
metricsgeneration/missing_new_metric:
rules:
# missing name
- type: calculate
metric1: metric1
metric2: metric2
operation: percent

experimental_metricsgeneration/missing_operand1:
metricsgeneration/missing_operand1:
rules:
# missing operand1 metric
- name: new_metric
type: calculate
metric2: metric2
operation: percent

experimental_metricsgeneration/missing_operand2:
metricsgeneration/missing_operand2:
rules:
# missing operand2 metric
- name: new_metric
type: calculate
metric1: metric1
operation: percent

experimental_metricsgeneration/missing_scale_by:
metricsgeneration/missing_scale_by:
rules:
# missing scale_by
- name: new_metric
type: scale
metric1: metric1
operation: multiply

experimental_metricsgeneration/missing_type:
metricsgeneration/missing_type:
rules:
# missing generation type
- name: new_metric
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
experimental_metricsgeneration/sum_gauge_metric:
metricsgeneration/sum_gauge_metric:
rules:
- name: system.filesystem.capacity
unit: bytes
type: calculate
metric1: system.filesystem.usage
metric2: system.filesystem.utilization
operation: divide
experimental_metricsgeneration/sum_gauge_metric_match_attrs:
metricsgeneration/sum_gauge_metric_match_attrs:
rules:
- name: system.filesystem.capacity
unit: bytes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
experimental_metricsgeneration/match_attributes_disabled:
metricsgeneration/match_attributes_disabled:
rules:
- name: new_metric
metric1: capacity.total
metric2: capacity.used
operation: add
type: calculate
experimental_metricsgeneration/match_attributes_enabled:
metricsgeneration/match_attributes_enabled:
rules:
- name: new_metric
metric1: capacity.total
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
experimental_metricsgeneration/metric2_zero_add:
metricsgeneration/metric2_zero_add:
rules:
- name: new_metric
metric1: capacity.total
metric2: capacity.used
operation: add
type: calculate
experimental_metricsgeneration/metric2_zero_subtract:
metricsgeneration/metric2_zero_subtract:
rules:
- name: new_metric
metric1: capacity.total
metric2: capacity.used
operation: subtract
type: calculate
experimental_metricsgeneration/metric2_zero_multiply:
metricsgeneration/metric2_zero_multiply:
rules:
- name: new_metric
metric1: capacity.total
metric2: capacity.used
operation: multiply
type: calculate
experimental_metricsgeneration/metric2_zero_divide:
metricsgeneration/metric2_zero_divide:
rules:
- name: new_metric
metric1: capacity.total
metric2: capacity.used
operation: divide
type: calculate
experimental_metricsgeneration/metric2_zero_percent:
metricsgeneration/metric2_zero_percent:
rules:
- name: new_metric
metric1: capacity.total
Expand Down
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
experimental_metricsgeneration/add_sum_sum:
metricsgeneration/add_sum_sum:
rules:
- name: new_metric
unit: percent
type: calculate
metric1: sum
metric2: sum
operation: add
experimental_metricsgeneration/add_gauge_gauge:
metricsgeneration/add_gauge_gauge:
rules:
- name: new_metric
unit: percent
type: calculate
metric1: gauge
metric2: gauge
operation: add
experimental_metricsgeneration/add_gauge_sum:
metricsgeneration/add_gauge_sum:
rules:
- name: new_metric
unit: percent
type: calculate
metric1: gauge
metric2: sum
operation: add
experimental_metricsgeneration/add_sum_gauge:
metricsgeneration/add_sum_gauge:
rules:
- name: new_metric
unit: percent
type: calculate
metric1: sum
metric2: gauge
operation: add
experimental_metricsgeneration/multiply_gauge_sum:
metricsgeneration/multiply_gauge_sum:
rules:
- name: new_metric
unit: percent
type: calculate
metric1: gauge
metric2: sum
operation: multiply
experimental_metricsgeneration/multiply_sum_gauge:
metricsgeneration/multiply_sum_gauge:
rules:
- name: new_metric
unit: percent
type: calculate
metric1: sum
metric2: gauge
operation: multiply
experimental_metricsgeneration/divide_gauge_sum:
metricsgeneration/divide_gauge_sum:
rules:
- name: new_metric
unit: percent
type: calculate
metric1: gauge
metric2: sum
operation: multiply
experimental_metricsgeneration/divide_sum_gauge:
metricsgeneration/divide_sum_gauge:
rules:
- name: new_metric
unit: percent
type: calculate
metric1: sum
metric2: gauge
operation: divide
experimental_metricsgeneration/subtract_gauge_sum:
metricsgeneration/subtract_gauge_sum:
rules:
- name: new_metric
unit: percent
type: calculate
metric1: gauge
metric2: sum
operation: subtract
experimental_metricsgeneration/subtract_sum_gauge:
metricsgeneration/subtract_sum_gauge:
rules:
- name: new_metric
unit: percent
type: calculate
metric1: sum
metric2: gauge
operation: subtract
experimental_metricsgeneration/percent_gauge_sum:
metricsgeneration/percent_gauge_sum:
rules:
- name: new_metric
unit: percent
type: calculate
metric1: gauge
metric2: sum
operation: percent
experimental_metricsgeneration/percent_sum_gauge:
metricsgeneration/percent_sum_gauge:
rules:
- name: new_metric
unit: percent
Expand Down
2 changes: 1 addition & 1 deletion reports/distributions/contrib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ components:
- cumulativetodelta
- deltatocumulative
- deltatorate
- experimental_metricsgeneration
- filter
- geoip
- groupbyattrs
- groupbytrace
- k8sattributes
- metricsgeneration
- metricstransform
- probabilistic_sampler
- redaction
Expand Down

0 comments on commit ca26982

Please sign in to comment.