Constructs a new instance of ResourceAttributes with required service information.
Name of the client service. Required. Must match regex ^[a-zA-Z0-9._-]{1,30}$
Version of the client service. Required. Must match regex ^[a-zA-Z0-9._-]{1,30}$
Operating system type of client machine. Defaults to system value.
Operating system version of client machine. Defaults to system value.
Node.js version of the client. Defaults to process.version.
Hostname of client machine. Defaults to system hostname.
Infrastructure on which the software is provided.
Environment the software is running in.
String denoting a user of a client application.
Sets attributes according to key-value pairs passed to this function. Will overwrite existing attributes, unless they are readonly. All values are converted to strings internally.
Object containing attribute key-value pairs. Common attributes include:
serviceName: Name of client serviceserviceVersion: Version of client serviceosType: Operating system type of client machineosVersion: Operating system version of client machinenodeVersion: Node.js version of the clienthostname: Hostname of client machineplatform: Infrastructure on which the software runsenvironment: Environment of the software ("", "test", "development", "staging", "production")userId: String denoting a user of a client applicationAny other keys will be stored in the parameters collection. Complex values (objects, arrays) will be JSON stringified.
The current instance for method chaining.
Represents the configuration for resource attributes used in telemetry.
Manages common attributes initialized at startup and dynamic attributes added thereafter. Provides validation, default value population, and protection for readonly fields.
Remarks
The class enforces specific validation rules:
serviceNameandserviceVersionmust match the regex pattern^[a-zA-Z0-9._-]{1,30}$environmentmust be one of: "", "test", "development", "staging", "production"clientSdkVersion,schemaVersion) cannot be modified after initializationExample