Skip to content

Commit

Permalink
add instrumentation metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
metal-messiah committed Oct 7, 2024
1 parent 3ece5e5 commit 71b5279
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/features/logging/aggregate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ export class Aggregate extends AggregateBase {
common: {
/** Attributes in the `common` section are added to `all` logs generated in the payload */
attributes: {
'instrumentation.provider': 'browser',
'instrumentation.version': this.#agentRuntime.version,
'instrumentation.name': this.#agentRuntime.loaderType,
'entity.guid': this.#agentRuntime.appMetadata?.agents?.[0]?.entityGuid, // browser entity guid as provided from RUM response
session: this.#agentRuntime?.session?.state.value || '0', // The session ID that we generate and keep across page loads
hasReplay: this.#agentRuntime?.session?.state.sessionReplayMode === 1, // True if a session replay recording is running
Expand Down
3 changes: 3 additions & 0 deletions tests/components/logging/aggregate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ describe('payloads', () => {
body: [{
common: {
attributes: {
'instrumentation.name': 'browser-test',
'instrumentation.provider': 'browser',
'instrumentation.version': expect.any(String),
'entity.guid': runtime.appMetadata.agents[0].entityGuid,
session: runtime.session.state.value,
hasReplay: false,
Expand Down
3 changes: 3 additions & 0 deletions tests/specs/logging/harvesting.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ describe('logging harvesting', () => {
attributes: {
appId: 42,
agentVersion: expect.any(String),
'instrumentation.provider': 'browser',
'instrumentation.version': expect.any(String),
'instrumentation.name': 'spa',
'entity.guid': expect.any(String),
hasReplay: false,
hasTrace: true,
Expand Down

0 comments on commit 71b5279

Please sign in to comment.