Skip to content

[Resources.AWS] Ensure ECS cluster ARN is always in correct ARN format#4160

Merged
martincostello merged 3 commits into
open-telemetry:mainfrom
ysolomchenko:ECS-cluster-ARN-normalization-removed,-leaving-raw-cluster-name
Apr 21, 2026
Merged

[Resources.AWS] Ensure ECS cluster ARN is always in correct ARN format#4160
martincostello merged 3 commits into
open-telemetry:mainfrom
ysolomchenko:ECS-cluster-ARN-normalization-removed,-leaving-raw-cluster-name

Conversation

@ysolomchenko

Copy link
Copy Markdown
Contributor

Fixes # N/A
Design discussion issue # N/A

Found by Codex analysis

Changes

Fix ECS Metadata V4 cluster ARN normalization when the Cluster field returns a cluster name instead of an ARN.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@github-actions github-actions Bot added the comp:resources.aws Things related to OpenTelemetry.Resources.AWS label Apr 20, 2026
@ysolomchenko
ysolomchenko marked this pull request as ready for review April 20, 2026 13:04
@ysolomchenko
ysolomchenko requested a review from a team as a code owner April 20, 2026 13:04
@codecov

codecov Bot commented Apr 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.98%. Comparing base (77ad374) to head (7eac6b0).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4160      +/-   ##
==========================================
+ Coverage   73.83%   73.98%   +0.14%     
==========================================
  Files         466      458       -8     
  Lines       18314    18279      -35     
==========================================
  Hits        13523    13523              
+ Misses       4791     4756      -35     
Flag Coverage Δ
unittests-Instrumentation.Cassandra ?
unittests-Resources.AWS 74.49% <100.00%> (+0.61%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/OpenTelemetry.Resources.AWS/AWSECSDetector.cs 92.30% <100.00%> (+0.55%) ⬆️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


if (!clusterArn.StartsWith("arn:", StringComparison.Ordinal))
{
var baseArn = containerArn.Substring(0, containerArn.LastIndexOf(':'));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't validate that clusterArn contains a :.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7eac6b0

@github-actions
github-actions Bot requested review from normj and srprash April 21, 2026 06:43
@martincostello
martincostello added this pull request to the merge queue Apr 21, 2026
Merged via the queue into open-telemetry:main with commit 45273c0 Apr 21, 2026
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:resources.aws Things related to OpenTelemetry.Resources.AWS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants