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

Cloud API #2081

Merged
merged 4 commits into from
Oct 29, 2024
Merged

Cloud API #2081

merged 4 commits into from
Oct 29, 2024

Conversation

meiao
Copy link
Contributor

@meiao meiao commented Oct 1, 2024

Overview

Introduces the Cloud API, which allows cloud account information to be passed to the agent.

This information is required by some instrumentation modules to be able to form cloud resource identifiers which are used to link a monitored application to the cloud resources it uses.

Related Github Issue

Fixes #2003

Checks

  • Your contributions are backwards compatible with relevant frameworks and APIs.
  • Your code does not contain any breaking changes. Otherwise please describe.
  • Your code does not introduce any new dependencies. Otherwise please describe.

@codecov-commenter
Copy link

codecov-commenter commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 70.66667% with 22 lines in your changes missing coverage. Please review.

Project coverage is 70.61%. Comparing base (8308389) to head (989a4ba).
Report is 148 commits behind head on main.

Files with missing lines Patch % Lines
...om/newrelic/agent/cloud/CloudAccountInfoCache.java 70.73% 7 Missing and 5 partials ⚠️
...in/java/com/newrelic/agent/cloud/CloudApiImpl.java 68.75% 5 Missing ⚠️
...ewrelic/agent/cloud/CloudAccountInfoValidator.java 85.71% 1 Missing and 1 partial ⚠️
.../java/com/newrelic/api/agent/CloudAccountInfo.java 0.00% 2 Missing ⚠️
...nt/src/main/java/com/newrelic/agent/AgentImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2081      +/-   ##
============================================
+ Coverage     70.57%   70.61%   +0.03%     
- Complexity     9875     9907      +32     
============================================
  Files           829      833       +4     
  Lines         39945    40036      +91     
  Branches       6078     6091      +13     
============================================
+ Hits          28191    28270      +79     
- Misses         9024     9033       +9     
- Partials       2730     2733       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if (accountInfo != null) {
accountInfo.remove(cloudAccountInfo);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be a short-circuit return here or is it ok to have a cloudAccountInfo with a null value?

Copy link
Contributor Author

@meiao meiao Oct 10, 2024

Choose a reason for hiding this comment

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

yes, it should short circuit.

It is also ok to have null values. But short circuiting prevents some overhead.

Update documentation to inform the behavior
@meiao meiao merged commit ec234dd into main Oct 29, 2024
111 checks passed
@meiao meiao deleted the cloud-api branch October 29, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Enhance Entity Relationships - design new agent API for AWS account ID
4 participants