
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
@opentelemetry/baggage-log-record-processor
Advanced tools
The BaggageLogRecordProcessor reads entries stored in Baggage from the parent context and adds the baggage entries' keys and values to the log record as attributes on log emit.
â Warning â ď¸
Do not put sensitive information in Baggage.
To repeat: a consequence of adding data to Baggage is that the keys and values will appear in all outgoing HTTP headers from the application.
Compatible with OpenTelemetry JS API and SDK 1.0+
.
npm install --save @opentelemetry/baggage-log-record-processor
Add to the log record processors that copies all baggage entries during configuration:
import { NodeSDK, logs } from '@opentelemetry/sdk-node';
import { ALLOW_ALL_BAGGAGE_KEYS, BaggageLogRecordProcessor } from '@opentelemetry/baggage-log-record-processor';
const logRecordProcessor = [
new logs.SimpleLogRecordProcessor(
new logs.ConsoleLogRecordExporter()),
new BaggageLogRecordProcessor(ALLOW_ALL_BAGGAGE_KEYS)];
const sdk = new NodeSDK({
serviceName: "example-service",
logRecordProcessor
});
sdk.start();
Alternatively, you can provide a custom baggage key predicate to select which baggage keys you want to copy.
For example, to only copy baggage entries that start with my-key
:
new BaggageLogRecordProcessor((baggageKey: string) => key.startsWith('my-key'))
For example, to only copy baggage entries that matches the regex ^key.+
:
const regex = new RegExp("^key.+")
new BaggageLogRecordProcessor((baggageKey: string) => regex.test(baggageKey))
APACHE 2.0 - See LICENSE for more information.
FAQs
OpenTelemetry Baggage Log Record Processor
The npm package @opentelemetry/baggage-log-record-processor receives a total of 2 weekly downloads. As such, @opentelemetry/baggage-log-record-processor popularity was classified as not popular.
We found that @opentelemetry/baggage-log-record-processor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.