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

[routing/connector] Invalid configuration when using context request #37410

Open
vlaborie opened this issue Jan 22, 2025 · 2 comments · May be fixed by #37411
Open

[routing/connector] Invalid configuration when using context request #37410

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

Comments

@vlaborie
Copy link

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
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.
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