githubEdit

Stdout Exporter

The stdout exporter outputs flow records directly to the console (standard output), making it ideal for development, debugging, and initial testing of Mermin.

Overview

While OTLP export is used for production observability, the stdout exporter provides immediate, human-readable visibility into captured flows without requiring an external collector.

Configuration

export "traces" {
  stdout = "text_indent"
}

Configuration Option

stdout

Type: String (enum) or null Default: null (disabled)

Output format for stdout exporter.

Valid Values:

  • "text_indent": Human-readable, indented text format (recommended)

  • null: Disable stdout export

Examples:

Enable stdout exporter:

Disable stdout exporter:

Output Format

Text Indent Format

The text_indent format provides structured, readable output:

Use Cases

Development and Testing

Use stdout during initial development:

Benefits:

  • No external dependencies

  • Immediate feedback

  • Easy debugging

  • Simple setup

Debugging Flow Issues

Enable stdout temporarily to debug flow capture:

Workflow:

  1. Enable stdout exporter

  2. Deploy or reload configuration

  3. View logs: kubectl logs -f <pod-name>

  4. Inspect flow records

  5. Disable stdout when done

Quick Start and Demos

Use stdout for quick demonstrations:

Pipeline Validation

Verify flow generation before setting up full OTLP pipeline:

Combined with OTLP

You can enable both stdout and OTLP exporters simultaneously:

When to use both:

  • Debugging export issues

  • Comparing local vs. exported data

  • Validating flow enrichment

  • Troubleshooting transformations

Viewing Stdout Output

Kubernetes

View logs from Mermin pods:

Docker (Bare Metal)

View logs from Docker container:

Systemd

View logs from systemd service:

Filtering Stdout Output

Using grep

Filter flows by criteria:

Using jq (if JSON format available)

While Mermin currently supports text_indent format, future JSON support would enable:

Performance Considerations

Log Volume

Stdout output can generate significant log volume:

Typical flow rate: 1,000 flows/second Text indent size: ~500 bytes per flow Log rate: ~500 KB/second = ~1.8 GB/hour

Recommendations:

  • Use stdout only for development/debugging

  • Disable for production environments

  • Configure log rotation if enabled long-term

CPU Impact

Formatting flow records for stdout has minimal CPU overhead:

  • Text formatting: < 1% CPU

  • Logging I/O: < 2% CPU

Enable stdout without significant performance impact for debugging.

Log Rotation

Configure log rotation to prevent disk filling:

Docker:

Kubernetes:

Troubleshooting

No Output Visible

Symptoms: Stdout exporter enabled but no flow records in logs

Solutions:

  1. Verify stdout = "text_indent" is set

  2. Check log level includes info: log_level = "info"

  3. Verify flows are being captured: check metrics

  4. Confirm log output destination

Too Much Output

Symptoms: Logs filling up quickly, hard to read

Solutions:

  1. Add flow filters (see Filtering)

  2. Reduce monitored interfaces

  3. Use grep to filter relevant flows

  4. Disable stdout after debugging

Output Format Issues

Symptoms: Truncated or malformed output

Solutions:

  1. Check log collection limits

  2. Verify container logs aren't being truncated

  3. Increase log line length limits if needed

Best Practices

  1. Disable in production: Use OTLP for production environments

  2. Enable temporarily: Turn on only when needed for debugging

  3. Use with filters: Combine with flow filters to reduce volume

  4. Monitor disk space: Ensure adequate disk for logs

  5. Automate cleanup: Configure log rotation

  6. Document usage: Note when/why stdout is enabled

Configuration Examples

Development Only

Debugging with OTLP

Production (Stdout Disabled)

Comparison with OTLP

Feature
Stdout
OTLP

Setup Complexity

None

Requires collector

Storage

Logs/ephemeral

Persistent backend

Query Capability

grep only

Full query language

Production Ready

No

Yes

Resource Usage

Low

Moderate

Scalability

Poor

Excellent

Visualization

None

Dashboards available

Next Steps

Last updated