Instrument the service with structured logging, Prometheus metrics, and distributed tracing. Build Grafana dashboards showing evaluation rate, cache hit rate, rule matching patterns, and flag usage. By the end, you have full visibility into flag behavior.
← Back to Module 07 overviewInstall: npm install pino pino-pretty
Create src/logger.ts:
import pino from 'pino';
const logger = pino({
level: process.env.LOG_LEVEL || 'info',
transport: {
target: 'pino-pretty',
options: { colorize: true, translateTime: 'SYS:standard' }
}
});
export default logger;