feat(newrelic): APM application id can be looked up by name#361
Open
3bbbeau wants to merge 4 commits intoargoproj:masterfrom
Open
feat(newrelic): APM application id can be looked up by name#3613bbbeau wants to merge 4 commits intoargoproj:masterfrom
3bbbeau wants to merge 4 commits intoargoproj:masterfrom
Conversation
063b8d4 to
2d77a47
Compare
crenshaw-dev
requested changes
Mar 7, 2025
Member
|
Hey @3bbbeau could you please address comments? |
0613604 to
cb85658
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #361 +/- ##
==========================================
+ Coverage 55.41% 60.12% +4.71%
==========================================
Files 46 48 +2
Lines 4125 3742 -383
==========================================
- Hits 2286 2250 -36
+ Misses 1511 1131 -380
- Partials 328 361 +33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This is intended to be a quality of life addition to allow `ApplicationSet` resources to minimize boilerplate when dealing with NewRelic APM resources across multiple environments. - An application programmatically [uses the NR SDK to report to NewRelic](https://github.com/newrelic/go-agent/blob/master/v3/examples/server/main.go#L267-L274) - NewRelic APM Application ID has to then be retrieved following the first run of an application from the NR Dashboard and added to an ArgoCD `Application` via the annotation, across multiple environments. Using ArgoCD `ApplicationSet` resources, the annotation can be either provided via app_id, or by name, e.g. `MyApp-{{ .values.env }}` If `dest.Recipient` can be parsed to an int, then app_id is provided and logic remains as before. If `dest.Recipient` cannot be parsed to an integer, then it was passed by name and we call `/v2/applications.json` to query using `filter[name]` If `/v2/applications.json` returns multiple application IDs then an error is returned, as we can't determine which app_id to use to place the deployment marker. Signed-off-by: 3bbbeau <0x3bb@3bb.io>
Signed-off-by: 3bbbeau <0x3bb@3bb.io>
Guard against potential injection from appName Signed-off-by: 3bbbeau <0x3bb@3bb.io>
cb85658 to
eedfe1e
Compare
- error wrapping %w - http.NoBody over nil - unused parameter 'r' - assert errors with require Signed-off-by: 3bbbeau <0x3bb@3bb.io>
eedfe1e to
1582b2f
Compare
Author
|
@pasha-codefresh Hey, I've addressed all but #361 (comment) which I'm not sure I understand broader implementation details |
pasha-codefresh
approved these changes
Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is intended to be a quality of life feature to allow ArgoCD
ApplicationSetresources to minimize boilerplate when dealing with NewRelic APM resources across multiple environments.Currently
Applicationvia the annotation, across multiple environments.Desired
Using ArgoCD
ApplicationSetresources, the annotation can be either provided via the application id as the above example, or instead by name, e.g.MyApp-{{ .values.env }}:Logic
If
dest.Recipientcan be parsed to an int, then the application id was directly provided and logic remains as before.If
dest.Recipientcannot be parsed to an integer, then it was passed by name (since all NewRelic APM IDs are defined as integers within the schema) and we call/v2/applications.jsonto query usingfilter[name]If
/v2/applications.jsonreturns multiple application IDs then an error is returned, as we can't determine which application id to use to place the deployment marker.