Skip to content

feat(nrawssdk): Entity Relationship AWS update#1120

Open
cade-conklin wants to merge 9 commits intodevelopfrom
cconklin/entity-relationship-mapping
Open

feat(nrawssdk): Entity Relationship AWS update#1120
cade-conklin wants to merge 9 commits intodevelopfrom
cconklin/entity-relationship-mapping

Conversation

@cade-conklin
Copy link
Contributor

@cade-conklin cade-conklin commented Feb 12, 2026

Links

Details

Covered in this PR

Entity Relationships for Elastic/Open Search

  • Added additional Span attribute for Opensearch/elastic search endpoint

Entity Relationships, AWS account information config

  • Accept NEW_RELIC_CLOUD_AWS_ACCOUNT_ID as env var
  • Config.CloudAWS.AccountID and Config.CloudAWS.AccountDecoding.Enabled configurable via config options (ConfigCloudAWSAccountID and ConfigCloudAWSAccountDecodingEnabled
  • Config.CloudAWS.AccountDecoding.Enabled enabled by default
  • Function validateAWSAccountID added to check when accountID is set in env or by config options
  • InitializeMiddleware function added to nrawssdk-v2. Contains logic to retrieve credentials from awsConfig and use them to resolve accountID (with Config setting given priority) and then add existing middlewares to be used in AWS requests
  • AppendMiddlewares given a note that it is deprecated. It will not add the accountID as a span attribute
  • accountID added as a span attribute in serializeMiddlewares
  • Example updated to reflect new changes in InitializeMiddleware. It is no longer passed in as an optional function, but rather after the awsConfig is resolved. Still an option to pass InitializeMiddleware as an optional function as detailed in comments for InitializeMiddleware description and in comments in example
  • Interface added for accountID resolver to make mocking for tests easier

Entity Relationships, decoding AWS account ID

  • accountID added as field in nrMiddleware struct
  • function to decode the access key into an account ID as detailed here

@github-actions github-actions bot requested a review from mirackara February 12, 2026 00:35
@cade-conklin cade-conklin changed the base branch from master to develop February 12, 2026 00:35
@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.99%. Comparing base (e91301f) to head (5e67221).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1120      +/-   ##
===========================================
- Coverage    79.08%   78.99%   -0.10%     
===========================================
  Files          159      159              
  Lines        14935    15019      +84     
===========================================
+ Hits         11812    11864      +52     
- Misses        2711     2737      +26     
- Partials       412      418       +6     

see 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e91301f...5e67221. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cade-conklin cade-conklin force-pushed the cconklin/entity-relationship-mapping branch 4 times, most recently from c24338f to 561da80 Compare February 12, 2026 00:42
MaxSamplesStored int
}

CloudAWS struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should notate why we have this config option with a good comment

*apiOptions = append(*apiOptions, m.serializeMiddleware)
}

func NRAppendMiddlewares(apiOptions *[]func(*smithymiddle.Stack) error, ctx context.Context, awsConfig aws.Config) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we differentiating our AppendMiddlewares vs. NRAppendMiddlewares enough here? What purpose does the older one still serve & is it something we can remove/combine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should leave more comments here, but I put in a different function since it takes in different parameters! I can discuss the purpose/parameters passed into this function since I think its a bit clunky as it stands

Copy link
Contributor

Choose a reason for hiding this comment

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

Note from mobbing: can we have the old function just call this new function?

Copy link
Contributor

Choose a reason for hiding this comment

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

Note from mobbing: can we just pass in one awsConfig aws.Config instead of aws.Config.apiOptions + aws.Config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mirackara I am keeping it the same way because we still keep the option to inject our middleware into specific client requests. The mismatching typing for the structs contains apiOptions from the client and the awsConfig prevent a good way to just pass one type in

@cade-conklin cade-conklin changed the title feat(nrawssdk): Entity Relationship Mapping update feat(nrawssdk): Entity Relationship AWS update Feb 25, 2026

mask := uint64(0x7fffffffff80)

num := (bigEndian & mask) >> 7 // apply mask and get rid of last 7 bytes from mask
Copy link
Contributor

Choose a reason for hiding this comment

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

bits?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thank you!

@cade-conklin cade-conklin force-pushed the cconklin/entity-relationship-mapping branch from 0ef89ed to ef3787c Compare February 25, 2026 16:02
@cade-conklin cade-conklin force-pushed the cconklin/entity-relationship-mapping branch from ef3787c to 5e67221 Compare March 3, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants