While testing the out-of-the-box features Shiny provides for OTel traces and logs in a few observability tools, I noticed that the very first span Shiny creates is session_start, and with a few more custom instrumentation I noticed there is a gap of time with unknown events between the call to shinyApp(ui, server) and the first session_start event.
There might be valuable information on the events happening while shiny starts up the server.
For example, similar code to the following snippet shows a span of ~12secs that happens just before session_start shows up.
.shiny_startup_span <- otel::start_span("shiny_framework_startup", attributes = list(app.instrumentation = "custom"))
server <- function(input, output) {
otel::end_span(.shiny_startup_span)
# ...
}
shinyApp(ui=ui, server=server)
So there is a ~12s span of things happening in Shiny just after shinyApp is called and the server function is called.
While testing the out-of-the-box features Shiny provides for OTel traces and logs in a few observability tools, I noticed that the very first span Shiny creates is
session_start, and with a few more custom instrumentation I noticed there is a gap of time with unknown events between the call toshinyApp(ui, server)and the firstsession_startevent.There might be valuable information on the events happening while shiny starts up the server.
For example, similar code to the following snippet shows a span of ~12secs that happens just before
session_startshows up.So there is a ~12s span of things happening in Shiny just after
shinyAppis called and theserverfunction is called.