Skip to content

[routing/connector] Invalid configuration when using context other than resource #37410

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

Closed
vlaborie opened this issue Jan 22, 2025 · 3 comments · Fixed by #37411
Closed

[routing/connector] Invalid configuration when using context other than resource #37410

vlaborie opened this issue Jan 22, 2025 · 3 comments · Fixed by #37411
Assignees
Labels
bug Something isn't working connector/routing

Comments

@vlaborie
Copy link
Contributor

Component(s)

connector/routing

What happened?

Description

The collector crash with in invalid configuration error when a request context is used with routing/connector.

Steps to Reproduce

Use a routing connector with request context.

Expected Result

No configuration error.

Actual Result

Collector crash with invalid configuration error.

Collector version

0.118.0

Environment information

Environment

Docker: otel/opentelemetry-collector-contrib:0.118.0

OpenTelemetry Collector configuration

connectors:
      routing/logs:
        default_pipelines: [logs/default]
        table:
          - context: request
            condition: request["x-tenant"] == "tenant-1"
            pipelines: [logs/tenant-1]
      routing/metrics:
        default_pipelines: [metrics/default]
        table:
          - context: request
            condition: request["x-tenant"] == "tenant-1"
            pipelines: [logs/tenant-1]
      routing/traces:
        default_pipelines: [traces/default]
        table:
          - context: request
            condition: request["x-tenant"] == "tenant-1"
            pipelines: [traces/tenant-1]

Log output

Error: invalid configuration: connectors::routing/metrics: invalid context: request
2025/01/22 11:05:04 collector server run finished with error: invalid configuration: connectors::routing/metrics: invalid context: request

Additional context

No response

@vlaborie vlaborie added bug Something isn't working needs triage New item requiring triage labels Jan 22, 2025
Copy link
Contributor

Pinging code owners:

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

@vlaborie
Copy link
Contributor Author

I think the problem appear with PR #37095, there is a fallthrough keyword in routingconnector/config.go which now return to default case.

vlaborie added a commit to vlaborie/opentelemetry-collector-contrib that referenced this issue Jan 22, 2025
@VihasMakwana VihasMakwana removed the needs triage New item requiring triage label Jan 23, 2025
vlaborie added a commit to vlaborie/opentelemetry-collector-contrib that referenced this issue Jan 24, 2025
vlaborie added a commit to vlaborie/opentelemetry-collector-contrib that referenced this issue Jan 24, 2025
vlaborie added a commit to vlaborie/opentelemetry-collector-contrib that referenced this issue Jan 24, 2025
Remove a residual fallthrough keyword

Fixes open-telemetry#37410

Added unit tests for valid request context.

Updated changelog.
vlaborie added a commit to vlaborie/opentelemetry-collector-contrib that referenced this issue Jan 27, 2025
…ource

Fix switch case which validate config context

Fixes open-telemetry#37410

Added unit tests for valid request context.

Updated changelog.
@vlaborie
Copy link
Contributor Author

vlaborie commented Jan 27, 2025

The error also happen with "span", "metric", "datapoint" and "log" context.

@vlaborie vlaborie changed the title [routing/connector] Invalid configuration when using context request [routing/connector] Invalid configuration when using context other than resource Jan 27, 2025
chengchuanpeng pushed a commit to chengchuanpeng/opentelemetry-collector-contrib that referenced this issue Feb 8, 2025
…ource (open-telemetry#37411)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Remove a residual fallthrough keyword which induce a configuration error

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#37410

---------

Co-authored-by: Andrzej Stencel <[email protected]>
zeck-ops pushed a commit to zeck-ops/opentelemetry-collector-contrib that referenced this issue Apr 23, 2025
…ource (open-telemetry#37411)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Remove a residual fallthrough keyword which induce a configuration error

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#37410

---------

Co-authored-by: Andrzej Stencel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working connector/routing
Projects
None yet
2 participants