defaultMetadata() function
Parses the default record metadata out of LOGGER_METADATA, expanding %name and %version first.
Signature:
export declare function defaultMetadata(): JsonObject;
Returns:
the parsed metadata, or an empty object when unset
Exceptions
TypeError if the variable is set but not parseable as JSON
Remarks
These fields are attached to every record sent to a transport — a source tag, an environment name, a hostname — and are what makes records from several services distinguishable at the collector. Console output is unaffected.
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.