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

Filtering expression involving comparison with unknown symbol generates "This is a bug in the OpenTelemetry Transformation Language" #33048

Closed
tilowiklundSensmetry opened this issue May 14, 2024 · 2 comments · Fixed by #33051
Labels
bug Something isn't working pkg/ottl

Comments

@tilowiklundSensmetry
Copy link

Component(s)

processor/filter

What happened?

Description

Using the filter processor with an expression involving a comparison against an undefined symbol starting with an upper-case letter generates an error message the wording of which suggests a bug in the collector

Error: invalid configuration: processors::filter: unable to parse OTTL condition [...]: no value field set.
This is a bug in the OpenTelemetry Transformation Language

Steps to Reproduce

Run the collector with a filter comparing against an undefined symbol, such as value_double != NaN (NaN is undefined at the time of writing), value_int == IAmUndefined, or IAmUndefined == IAmUndefined.

Note that the behaviour is different for symbols not starting with upper-case letters (which generate either parsing errors or is not a valid path errors).

See attached config for full example.

Expected Result

Error message not indicating the error is a bug in the collector, such the one generated for lower-case symbols

[...] is not a valid path nor a valid OTTL keyword [...]

or mixed case symbols

[...] invalid syntax: 1:29: unexpected token [...]

Actual Result

An error message indicating the issue is due to a bug in the collector

This is a bug in the OpenTelemetry Transformation Language

Collector version

v0.100.0

Environment information

Environment

Precompiled binary with md5sum

41a4690a6ec5834a05a6615a8fdf1494  otelcol-contrib_0.100.0_linux_amd64.tar.gz

OS: Gentoo Linux

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

exporters:
  debug:
    verbosity: detailed

processors:
  filter:
    metrics:
      datapoint:
          - 'value_double != NaN'

service:
  pipelines:
    metrics:
      receivers: [otlp]
      processors: [filter]
      exporters: [debug]

Log output

Error: invalid configuration: processors::filter: unable to parse OTTL condition "value_double != NaN": no value field set. This is a bug in the OpenTelemetry Transformation Language
2024/05/14 16:38:05 collector server run finished with error: invalid configuration: processors::filter: unable to parse OTTL condition "value_double != NaN": no value field set. This is a bug in the OpenTelemetry Transformation Language

Additional context

No response

@tilowiklundSensmetry tilowiklundSensmetry added bug Something isn't working needs triage New item requiring triage labels May 14, 2024
@github-actions github-actions bot added the processor/filter Filter processor label May 14, 2024
Copy link
Contributor

Pinging code owners:

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

Copy link
Contributor

Pinging code owners for pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself.

TylerHelmuth added a commit that referenced this issue May 17, 2024
…33051)

**Description:** 
Fix a bug where a condition like `"foo" = Bar` resulted in the error `no
value field set. This is a bug in the OpenTelemetry Transformation
Language`.

**Link to tracking Issue:** <Issue number if applicable>
Closes
#33048

**Testing:** <Describe what testing was performed and which tests were
added.>
Updated unit tests
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this issue Jul 11, 2024
…pen-telemetry#33051)

**Description:** 
Fix a bug where a condition like `"foo" = Bar` resulted in the error `no
value field set. This is a bug in the OpenTelemetry Transformation
Language`.

**Link to tracking Issue:** <Issue number if applicable>
Closes
open-telemetry#33048

**Testing:** <Describe what testing was performed and which tests were
added.>
Updated unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg/ottl
Projects
None yet
2 participants