Skip to content

Commit

Permalink
feat: Remove agentIdentifier argument from agent constructors (#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellisong authored Jan 29, 2025
1 parent c711d23 commit cb866e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/loaders/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ import { globalScope } from '../common/constants/runtime'
export class Agent extends AgentBase {
/**
* @param {Object} options Options to initialize agent with
* @param {string} [agentIdentifier] Optional identifier of agent
*/
constructor (options, agentIdentifier) {
super(agentIdentifier)
constructor (options) {
super()

if (!globalScope) {
// We could not determine the runtime environment. Short-circuite the agent here
Expand Down
4 changes: 2 additions & 2 deletions src/loaders/micro-agent-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { generateRandomHexString } from '../common/ids/unique-id'
export class MicroAgentBase {
agentIdentifier

constructor (agentIdentifier = generateRandomHexString(16)) {
this.agentIdentifier = agentIdentifier
constructor () {
this.agentIdentifier = generateRandomHexString(16)
}

/**
Expand Down
5 changes: 2 additions & 3 deletions src/loaders/micro-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ const nonAutoFeatures = [
export class MicroAgent extends MicroAgentBase {
/**
* @param {Object} options - Specifies features and runtime configuration,
* @param {string=} agentIdentifier - The optional unique ID of the agent.
*/
constructor (options, agentIdentifier) {
super(agentIdentifier)
constructor (options) {
super()

this.features = {}
setNREUMInitializedAgent(this.agentIdentifier, this)
Expand Down

0 comments on commit cb866e5

Please sign in to comment.