Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] metricsgeneration/infinite loop #37474

Open
bmiguel-teixeira opened this issue Jan 24, 2025 · 1 comment
Open

[BUG] metricsgeneration/infinite loop #37474

bmiguel-teixeira opened this issue Jan 24, 2025 · 1 comment
Labels
bug Something isn't working needs triage New item requiring triage processor/metricsgeneration Metrics Generation processor

Comments

@bmiguel-teixeira
Copy link
Contributor

bmiguel-teixeira commented Jan 24, 2025

Component(s)

processor/metricsgeneration

What happened?

Description

When using destination and metric1 with equal values (same metric) the processors enters an infinite loop.

Steps to Reproduce

In a perfect scenario, when using the scaling operations, I would like to change the selected metric "in-place". However, if we set metric name equal name, the processor enters in infinite loop.
Config shown below.

  metricsgeneration/scale:
    rules:
    - name: linux_memory_free_percent_percent
      type: scale
      metric1: linux_memory_free_percent_percent
      operation: multiply
      scale_by: 100

This happens because we iterate over the metrics array, and if we find a atching metric, we scale it based on the operation and we "ADD IT" to the ongoing metrics array. If the metrics names are equal this causes never ending loop.

Expected Result

Replace/update metric in-place. If thiscould be a desired behaviour for the config above, I can submit a PR.

Actual Result

Infinite loop in processor.

Collector version

0.118.0

Environment information

Environment

N/A

OpenTelemetry Collector configuration

Log output

Additional context

No response

@bmiguel-teixeira bmiguel-teixeira added bug Something isn't working needs triage New item requiring triage labels Jan 24, 2025
@github-actions github-actions bot added the processor/metricsgeneration Metrics Generation processor label Jan 24, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage processor/metricsgeneration Metrics Generation processor
Projects
None yet
Development

No branches or pull requests

1 participant