Skip to content

[receiver/awsxray] Add support for multiple service routing in aws-proxy#45301

Closed
liustve wants to merge 16 commits intoopen-telemetry:mainfrom
liustve:awsproxy-routing-rules
Closed

[receiver/awsxray] Add support for multiple service routing in aws-proxy#45301
liustve wants to merge 16 commits intoopen-telemetry:mainfrom
liustve:awsproxy-routing-rules

Conversation

@liustve
Copy link
Copy Markdown

@liustve liustve commented Jan 8, 2026

Description

  • Current AWS proxy design is limited to a single AWS service because it uses a single ServiceName and AWSEndpoint configuration that applies to all incoming requests. This change adds an optional AdditionalRoutingRules configuration that allows routing specific APIs to different services, with region, role_arn, and c falling back to the top-level proxy configuration when not specified.

Testing

  • Add unit tests to verify and support new configuration behavior
  • E2E testing verified:

Built local collector with the following configuration:

## E2E Test Results

### Config File

```yaml
extensions:
  awsproxy:
    endpoint: 0.0.0.0:2000
    region: us-east-1
    role_arn: "arn:aws:iam::XXXXXXXXXXXX:role/XRayOnlyTestRole"
    additional_routing_rules:
      - paths:
          - slos
        service_name: application-signals
        region: us-west-2
        role_arn: "arn:aws:iam::XXXXXXXXXXXX:role/SLOReadOnlyRole"
        aws_endpoint: "https://application-signals.us-west-2.api.aws"
      - paths:
          - PutLogEvents
          - CreateLogGroup
          - CreateLogStream
          - DescribeLogStreams
          - DescribeLogGroups
        service_name: logs
        region: us-east-1
      - paths:
          - PutMetricData
          - GetMetricData
          - ListMetrics
        service_name: monitoring
        region: us-east-1

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

exporters:
  debug:
    verbosity: detailed

service:
  extensions: [awsproxy]
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [debug]

curl -X POST http://localhost:2000/GetSamplingRules -d '{}'

{"NextToken":null,"SamplingRuleRecords":[{"CreatedAt":0.0,"ModifiedAt":0.0,"SamplingRule":{"Attributes":{},"FixedRate":0.05,"HTTPMethod":"*","Host":"*","Priority":10000,"ReservoirSize":1,"ResourceARN":"*","RuleARN":"arn:aws:xray:us-east-1:XXXXXXXXXXXX:sampling-rule/Default","RuleName":"Default","ServiceName":"*","ServiceType":"*","URLPath":"*","Version":1}}]}

curl -X POST http://localhost:2000/slos -H "Content-Type: application/json" -d '{"MaxResults": 10}'

{"NextToken":null,"SloSummaries":[]}

curl -X POST http://localhost:2000/ListMetrics -H "Content-Type: application/x-www-form-urlencoded" -d "Action=ListMetrics&Version=2010-08-01"

<ErrorResponse xmlns="http://monitoring.amazonaws.com/doc/2010-08-01/">
  <Error>
    <Type>Sender</Type>
    <Code>AccessDenied</Code>
    <Message>User: arn:aws:sts::XXXXXXXXXXXX:assumed-role/XRayOnlyTestRole/1767912500425453504 is not authorized to perform: cloudwatch:ListMetrics because no identity-based policy allows the cloudwatch:ListMetrics action</Message>
  </Error>
</ErrorResponse>

Documentation

Updated awsproxy and awsxrayreceiver docs to show this new feature.

@liustve liustve requested a review from a team as a code owner January 8, 2026 23:22
@liustve liustve requested a review from mwear January 8, 2026 23:22
@github-actions github-actions Bot added the first-time contributor PRs made by new contributors label Jan 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 8, 2026

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@github-actions
Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Jan 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions Bot closed this Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants