-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Goal: Provide context managers and decorators for user control over OTel collection.
Tasks
- Create
shiny/otel/_decorators.pywith:otel_collect(level)- Context manager to temporarily set collection level@otel_collect(level)- Decorator version for functions- Support both string and enum levels
- Export public API in
shiny/otel/__init__.py:otel_collectCollectLevelshould_collect
- Export at top-level in
shiny/__init__.py:- Add
from .otel import otel_collect, CollectLevel - Update
__all__
- Add
Acceptance Criteria
- Users can use
with otel_collect("none"):to disable telemetry in a block - Decorator
@otel_collect("reactivity")works on functions - Environment variable
SHINY_OTEL_COLLECTsets default level - Context manager overrides take precedence over env var
- Can import as
from shiny import otel_collectorfrom shiny.otel import otel_collect - Nested context managers work correctly
Files to Create
shiny/otel/_decorators.py
Files to Modify
shiny/otel/__init__.pyshiny/__init__.py
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request