Skip to content

OpenTelemetry traces on server starting up #4381

@marcosnav

Description

@marcosnav

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)
Image

So there is a ~12s span of things happening in Shiny just after shinyApp is called and the server function is called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: LowLow-impact bug, docs polish, papercut, or unclear low-severity request.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions