View source: R/telemetry_otel_conversion.R
| convert_otel_spans_to_events | R Documentation |
Converts OpenTelemetry Protocol (OTLP) span data to the bidux telemetry event schema.
This enables transparent compatibility with existing friction detection algorithms.
This function is called automatically by bid_telemetry() and bid_ingest_telemetry()
when OTLP data is detected - you rarely need to call it directly.
Automatic Format Detection: When you pass OTLP JSON or SQLite to bid_telemetry(),
this conversion happens automatically. The same UX friction detection algorithms work
seamlessly on both shiny.telemetry events and OpenTelemetry spans.
Span to Event Mapping:
session_start -> login
output -> output
reactive, observe -> input
reactive_update -> synthetic timing events
Error span events -> error
convert_otel_spans_to_events(spans_df)
spans_df |
Data frame of OTLP spans with columns:
|
Tibble with bidux event schema columns:
timestamp: POSIXct event timestamp
session_id: character session identifier
event_type: character event type (login, input, output, error)
input_id: character input identifier (NA for non-input events)
value: character/numeric value (NA for most otel spans)
error_message: character error message (NA for non-error events)
output_id: character output identifier (NA for non-output events)
navigation_id: character navigation identifier (NA for otel spans)
bid_telemetry() for high-level telemetry analysis (automatic format detection)
bid_ingest_telemetry() for legacy telemetry workflows
vignette("otel-integration") for complete OTEL setup guide
## Not run:
# Typically you don't need to call this directly - use bid_telemetry() instead:
issues <- bid_telemetry("otel_spans.json")
# Manual conversion (advanced use case):
# After reading otlp json file
spans <- read_otel_json("spans.json")
events <- convert_otel_spans_to_events(spans)
# Verify schema compatibility
names(events)
# [1] "timestamp" "session_id" "event_type" "input_id" "value" "error_message"
# [7] "output_id" "navigation_id"
# Now use standard friction detection
issues <- detect_telemetry_issues(events)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.