Skip to content

otel: Value Updates and Logging #2136

@schloerke

Description

@schloerke

Goal: Log reactive value updates as OTel log events.

Tasks

  • Add logging helper to shiny/otel/_core.py:
    • emit_log(body, severity, attributes) - Emit OTel log record
  • Modify Value._set() to log value updates
  • Store value name at creation time for logging
  • Include session ID in log attributes

Acceptance Criteria

  • Value updates logged when SHINY_OTEL_COLLECT >= reactivity
  • Logs include value name (e.g., "Set reactiveVal myValue")
  • Logs include session.id attribute
  • No logs when collection level insufficient
  • No-op when OTel SDK not configured

Files to Modify

  • shiny/otel/_core.py
  • shiny/reactive/_reactives.py (line ~180)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions