observability
Observability module exports.
Remarks
Re-exports all observability components:
- PinoLogger and createLogger for structured logging
- PrometheusMetrics and createMetrics for Prometheus metrics
- initTelemetry and shutdownTelemetry for OpenTelemetry SDK
- Tracer utilities for distributed tracing
- Prometheus registry for /metrics endpoint
Example
// Import all observability components
import {
initTelemetry,
PinoLogger,
PrometheusMetrics,
withSpan,
prometheusRegistry,
} from './observability/index.js';
// Initialize telemetry at application startup
initTelemetry({ serviceName: 'chive-appview' });
// Create logger and metrics
const logger = new PinoLogger({ level: 'info' });
const metrics = new PrometheusMetrics();
// Use in application
logger.info('Server started', { port: 3000 });
metrics.incrementCounter('requests_total', { method: 'GET' });
// Trace operations
await withSpan('processRequest', async () => {
// ... processing
});
Classes
Interfaces
Variables
- databaseMetrics
- DEFAULT_HISTOGRAM_BUCKETS
- firehoseMetrics
- httpMetrics
- MAX_CARDINALITY
- metricsContentType
- preprintMetrics
- prometheusRegistry
- SpanAttributes
- TRACER_NAME
- TRACER_VERSION