@fabbahiense/pulsar-pino-transport
v0.1.0
Published
Pino transport for Pulsar observability platform
Downloads
289
Maintainers
Readme
@pulsar/pino-transport
Pino transport for Pulsar — send your application logs to Pulsar in real-time.
Install
npm install @pulsar/pino-transportUsage
import pino from 'pino'
const logger = pino({
transport: {
target: '@pulsar/pino-transport',
options: {
url: 'https://your-pulsar-instance.com',
apiKey: 'psk_your_api_key',
source: 'my-api', // optional, default: 'default'
batchSize: 50, // optional, default: 50
flushInterval: 2000, // optional, default: 2000ms
},
},
})
logger.info('Server started')
logger.error({ traceId: 'abc-123' }, 'Something went wrong')Features
- Batched log delivery (configurable batch size)
- Automatic retry with exponential backoff (3 attempts)
- In-memory queue — no logs lost on temporary network failures
- Zero dependencies (uses native
fetch) - TypeScript types included
- Dual CJS/ESM package
Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| url | string | — | Pulsar server URL (required) |
| apiKey | string | — | API key for authentication (required) |
| source | string | 'default' | Service name in Pulsar |
| batchSize | number | 50 | Logs buffered before flush |
| flushInterval | number | 2000 | Flush interval in ms |
Trace ID
The transport automatically picks up trace IDs from these fields:
traceIdtrace_idrequestIdreq.id
logger.info({ traceId: 'my-trace-id' }, 'Processing request')License
MIT
