Automatically wrap a Shiny app, adding metrics for the current session count and the duration of reactive flushes, and then expose them on a /metrics endpoint.

The endpoint will check the METRICS_HTTP_AUTHORIZATION environment variable, and if present will use it as the expected Authorization header of the request to the /metrics endpoint. This can be used to implement basic HTTP authentication for access to runtime metrics.

register_shiny_metrics(app, registry = openmetrics::global_registry())

Arguments

app

An object created with shiny::shinyApp().

registry

A Registry object. See registry().

Value

A modified Shiny app object.