Google Sign-In Required

Use your company Google account to access the BetterFleet private content.

Back to private home

BetterFleet Support Private
Skip to content
BetterFleet Dev Wiki
0028 - Adopt OpenTelemetry Semantic Conventions for Structured Logging
Initializing search
    bf-dev
    • Home
    • Product Capabilities
    • Process
    • Current Work
    • System Design
    • Software Reference
    • Operations
    bf-dev
    • Home
      • Overview
      • Manage
      • Overview
      • Product Engineering Workflow
      • Product Engineering Delivery
      • Product Engineering Workflow in Linear
        • GitLab Feature Flags
        • In-App Docs Authoring
        • Release Notes
      • Templates
      • Publishing
      • Workflow Companions
      • Overview
      • Active Artifacts
      • Backlog Artifacts
      • Archived Artifacts
      • Overview
      • Microgrid
      • OSCP
        • Challenge
        • Specification
        • Spec
        • Architecture
        • Overview
        • Script Runtime Model
        • Compose Profiles and Modes
        • Repo Topology
        • CI and Release Integration
        • Overview
        • Internal Application Diagrams
          • Overview
          • Web Model
          • Core Model
        • Service Interaction Flows
        • Data and State
          • Index
          • bf-manage-web
          • bf-manage-core
          • bf-manage-connect
          • bf-manage-sitepwrmon
          • bf-manage-incidents
          • bf-telematics
          • bf-depot-sim
          • bf-manage-roaming
          • bf-support-microsite
          • bf-digital-twin
          • bf-schedule-creator
        • Overview
        • Internal Application Diagrams
        • Migration and Flags
        • Simulation Request Lifecycle
          • Index
          • bf-bnl-ui
          • bf-bnl-settings
          • bf-bnl-schedule-analysis-compute
          • bf-route-modelling
          • bf-schedule-creator
          • bf-digital-twin
        • Overview
        • Secrets and Env Strategy
        • Vendors and Local Dependencies
        • ADRs
        • Service Matrix
        • Cloud Dependencies
        • Ports and URLs
      • Onboarding
      • Daily Operations Runbook
        • Overview
        • Staging Hotfix Release
        • Production Hotfix Release
        • Terraform Plan Dry Runs
      • Troubleshooting
      • Testing Guide
    • Status
    • Context
    • Decision
    • Consequences

    0028 - Adopt OpenTelemetry Semantic Conventions for Structured Logging¶

    Status¶

    Proposed

    Context¶

    Our web application's logging is currently unstructured (plain text), making it difficult to search, filter, correlate with requests, or analyze at scale. This leads to manual grep-based debugging, inconsistent formats across services, and poor integration with observability tools. As we standardize other areas like HTTP error responses with RFC 9457, we seek a similar convention-driven approach for logs that aligns with our values: standardization, AI-assisted productivity, writing less custom code, and established conventions over bespoke solutions. OpenTelemetry (OTel) provides a vendor-neutral, open standard for observability signals (logs, traces, metrics). For logging, it defines a Log Record data model with core fields (body, timestamp, severity, attributes, trace_id, span_id) and semantic conventions-stable, agreed-upon attribute names and structures (e.g., http.method, service.name, db.statement). These conventions ensure logs are machine-readable, interoperable across tools, and correlated with traces/metrics without reinventing formats per team or service. Even from unstructured logs, OTel offers a low-disruption path: parse at the collector level, then incrementally structure application logs. This mirrors our RFC 9457 adoption-starting with a standard envelope while allowing domain-specific extensions.

    Decision¶

    We will adopt OpenTelemetry semantic conventions as the standard shape for all application logs across our web app services, processed through an OTel Collector pipeline. Concretely: * All logs will conform to the OTel Log Record model, enriched with semantic attributes for common domains (HTTP, database, service metadata). * New code will use OTel-style structured logging directly where practical; legacy logs may be transformed in the collector as a transitional step. * BetterFleet-specific or domain-specific fields may be included as extension attributes, but standard OTel names should be preferred whenever an equivalent exists. * The logging pipeline should preserve correlation fields such as trace/span IDs so logs align with distributed tracing and future metrics.

    Consequences¶

    Positive: * A consistent, machine-readable log structure across services. * Better compatibility with observability backends, dashboards, and automated tooling. * Easier log querying, correlation, alerting, and AI-assisted analysis. * Lower long-term cost than inventing and maintaining a bespoke logging schema.

    Negative / Trade-offs: * Some initial migration effort will be required to refactor existing logs or introduce collector transforms. * Teams will need discipline to avoid ad hoc field naming that undermines the convention. * OTel conventions may feel verbose in simple cases, but the standardization benefits outweigh that overhead.

    Made with Material for MkDocs