-
Notifications
You must be signed in to change notification settings - Fork 67
feat: Prepare agent to utilize v2 harvests for MFE registrations #1495
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
Merged
Merged
Changes from 37 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
36358c2
basics in place
metal-messiah 436aa15
fix jest tests
metal-messiah 7530c53
clean up
metal-messiah 4dbf3c0
basic changes in place
metal-messiah 03c217a
fixing tests
metal-messiah 4258391
fix tests
metal-messiah a0bf6dc
Merge branch 'main' into mfe-refactor
metal-messiah cb6ba74
fix for firefox and safari
metal-messiah b40e76a
fix for all browsers
metal-messiah 9d78f33
fix jest tests
metal-messiah a8a1281
Merge branch 'main' into mfe-refactor
metal-messiah 0cc29eb
report SM when event buffer is exceeded
metal-messiah 4ddaa4e
fix merge conflicts
metal-messiah 4a05827
apply changes to match new specs
metal-messiah 467423f
add exp.
metal-messiah 34800dd
support endpoint version 2
metal-messiah 6955682
add tests for version 2
metal-messiah 19359cc
format payloads to fit v2 spec
metal-messiah 691a94f
fix merge conflicts
metal-messiah 305d756
cleanup
metal-messiah f4b859c
add mechanisms to prevent issues before consumer GA
metal-messiah ef139cb
Merge branch 'main' into mfe-refactor
metal-messiah 2baf639
Merge branch 'main' into mfe-refactor
metal-messiah bad82e7
Merge branch 'main' into mfe-refactor
metal-messiah 1f7599e
fix jest tests after merge conflicts
metal-messiah 70dacd7
add retry where advised
metal-messiah 405c80f
stabilize tests
metal-messiah 71522e4
fix merge conflicts
metal-messiah 4bfa4c5
Fix types test
metal-messiah fe3b075
Merge branch 'main' into mfe-refactor
metal-messiah d18c923
fix broken test
metal-messiah 05209f4
add feature flag system
metal-messiah 645ba33
Merge branch 'main' into mfe-refactor
metal-messiah 249a05f
add feature flag controls
metal-messiah 816693e
add boosted tests
metal-messiah 04cce98
fix test
metal-messiah a10d95d
clarify test checks
metal-messiah 99a3219
update server constants to match agent defaults
metal-messiah 173e57d
fix merge conflicts
metal-messiah 911ea8a
address pr comments
metal-messiah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /** | ||
| * Copyright 2020-2025 New Relic, Inc. All rights reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /** | ||
| * @param {Object} [target] - the target to be validated | ||
| * @returns {boolean} | ||
| */ | ||
| export function isValidMFETarget (target = {}) { | ||
| return !!(target.id && target.name) | ||
| } | ||
|
|
||
| /** | ||
| * When given a valid target, returns an object with the MFE payload attributes. Returns an empty object otherwise. | ||
| * @param {Object} [target] the registered target | ||
| * @param {AggregateInstance} [aggregateInstance] the aggregate instance calling the method | ||
| * @returns {{'mfe.id': *, 'mfe.name': String}|{}} returns an empty object if args are not supplied or the aggregate instance is not supporting version 2 | ||
| */ | ||
| export function getVersion2Attributes (target, aggregateInstance) { | ||
| if (aggregateInstance?.harvestEndpointVersion !== 2) return {} | ||
| const containerAgentEntityGuid = aggregateInstance.agentRef.runtime.appMetadata.agents[0].entityGuid | ||
| if (!isValidMFETarget(target)) { | ||
| return { | ||
| 'entity.guid': containerAgentEntityGuid | ||
| } | ||
| } | ||
| return { | ||
| 'mfe.id': target.id, // these field names may change as the schema is finalized | ||
| 'mfe.name': target.name, // these field names may change as the schema is finalized | ||
| eventSource: 'MicroFrontendBrowserAgent', // these field names may change as the schema is finalized | ||
| 'parent.id': containerAgentEntityGuid | ||
|
metal-messiah marked this conversation as resolved.
Outdated
|
||
| } | ||
| } | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.