Config-Driven Observability for Go. Events In, Telemetry Out.

Bridge capitan events to OpenTelemetry logs, metrics, and traces with declarative YAML configuration. Change what you observe without recompiling.

Get Started
import "github.com/zoobz-io/aperture"

// Create aperture with OTEL providers
ap, _ := aperture.New(cap, logProvider, meterProvider, traceProvider)

// Apply a schema — events become telemetry
ap.Apply(aperture.Schema{
    Logs: aperture.LogSchema{
        Whitelist: []string{"order.created", "order.failed"},
    },
    Metrics: []aperture.MetricSchema{
        {Signal: "order.created", Type: "counter", Name: "orders_total"},
        {Signal: "order.completed", Type: "histogram", Name: "order_duration_ms", Field: "duration"},
    },
    Traces: []aperture.TraceSchema{
        {Start: "order.started", End: "order.completed", Name: "process_order", Correlation: "order_id"},
    },
})

// Direct OTEL access when needed
logger := ap.Logger("checkout")
meter := ap.Meter("checkout")
tracer := ap.Tracer("checkout")
89%Test Coverage
A+Go Report

Why Aperture?

Separate domain events from observability configuration entirely.

Three Signals, One Stream

A single capitan event becomes OTEL logs, metrics, and traces based on schema rules. No instrumentation in application code.

Schema-Driven Configuration

Define what gets observed in YAML or JSON. Change observability rules without recompiling — pair with flux for live reload.

Automatic Trace Correlation

Pair start and end events by correlation key into complete spans. Handles out-of-order delivery using emission timestamps.

Whitelist Log Filtering

Default logs everything; whitelist mode narrows to specific signals. Event fields become log attributes automatically.

Four Metric Instruments

Counter, gauge, histogram, and up-down counter. Map any event field to the right instrument type declaratively.

Context Extraction

Pull request-scoped values from context.Context into attributes. User ID, tenant, region — available across all three signal types.

Capabilities

Transform domain events into production-grade telemetry with declarative configuration.

FeatureDescriptionLink
Log TransformationEvents become OTEL log records with automatic attribute mapping. Whitelist filtering and custom type JSON serialization.Logs
Metric CollectionCounter increments, gauge snapshots, histogram distributions, and bidirectional counting from event fields.Metrics
Trace CorrelationStart/end event pairs linked by correlation key become complete spans. Configurable timeout with out-of-order support.Traces
Context ValuesExtract context.Context values as OTEL attributes with cardinality-aware registration across logs, metrics, and traces.Context
Schema ConfigurationFile-based YAML/JSON configuration with validation. Hot-reload via Apply() for atomic observability updates.Schema
Testing UtilitiesIn-memory OTEL exporters for verifying log records, metric data points, and span attributes in unit tests.Testing

Articles

Browse the full aperture documentation.

OverviewConfig-driven capitan-to-OTEL bridge for Go applications

Learn

QuickstartGet aperture running in five minutes
ConceptsCore concepts and mental model
ArchitectureInternal design and implementation details

Guides

MetricsConfigure signal-to-metric transformations
TracesConfigure signal pair correlation into spans
LogsConfigure event-to-log transformations
Context ExtractionEnrich signals with context values
Schema ConfigurationFile-based configuration with hot-reload support
TestingTest your aperture configurations

Cookbook

HTTP Server ObservabilityInstrument an HTTP server with aperture
Background Worker ObservabilityInstrument background workers and job queues

Reference

API ReferenceComplete API documentation
Testing ReferenceTesting utilities API reference