OpenTelemetry support
-
Shiny now supports OpenTelemetry via
{otel}. By default, if
otel::is_tracing_enabled()returnsTRUE, then{shiny}records all
OpenTelemetry spans. See{otelsdk}'s Collecting Telemetry
Data for more details
on configuring OpenTelemetry. (#4269, #4300) -
Supported values for
options(shiny.otel.collect)(or
Sys.getenv("SHINY_OTEL_COLLECT")):"none"- No Shiny OpenTelemetry tracing."session"- Adds session start/end spans."reactive_update"- Spans for any synchronous/asynchronous reactive
update. (Includes"session"features)."reactivity"- Spans for all reactive expressions. (Includes
"reactive_update"features)."all"[default] - All Shiny OpenTelemetry tracing. Currently equivalent
to"reactivity".
-
OpenTelemetry spans are recorded for:
session_start: Wraps the calling of theserver()function. Also
contains HTTP request within the attributes.session_end: Wraps the calling of theonSessionEnded()handlers.reactive_update: Signals the start of when Shiny knows something is to
be calculated. This span ends when there are no more reactive updates
(promises or synchronous) to be calculated.reactive,observe,output: Captures the calculation (including any
async promise chains) of a reactive expression (reactive()), an observer
(observe()), or an output render function (render*()).reactive debounce,reactive throttle: Captures the calculation
(including any async promise chains) of adebounce()d orthrottle()d
reactive expression.reactiveFileReader,reactivePoll: Captures the calculation
(including any async promise chains) of areactiveFileReader()or
reactivePoll().ExtendedTask: Captures the calculation (including any async promise
chains) of anExtendedTask.
-
OpenTelemetry Logs are recorded for:
Set reactiveVal <name>- When areactiveVal()is setSet reactiveValues <name>$<key>- When areactiveValues()element is
set- Fatal or unhandled errors - When an error occurs that causes the session
to end, or when an unhandled error occurs in a reactive context. Contains
the error within the attributes. To unsanitize the error message being
collected, setoptions(shiny.otel.sanitize.errors = FALSE). Set ExtendedTask <name> <value>- When anExtendedTask's respective
reactive value (e.g.,status,value, anderror) is set.<ExtendedTask name> add to queue- When anExtendedTaskis added to
the task queue.
-
All OpenTelemetry logs and spans will contain a
session.idattribute
containing the active session ID.
New features
updateActionButton()andupdateActionLink()now accept values other than
shiny::icon()for theiconargument (e.g.,fontawesome::fa(),
bsicons::bs_icon(), etc). (#4249)
Bug fixes and minor improvements
-
Showcase mode now uses server-side markdown rendering with the
{commonmark}package, providing support for GitHub Flavored Markdown
features (tables, strikethrough, autolinks, task lists). While most existing
README.md files should continue to work as expected, some minor rendering
differences may occur due to the change in markdown processor. (#4202,
#4201) -
debounce(),reactiveFileReader(),reactivePoll(),reactiveValues(),
andthrottle()now attempt to retrieve the assigned name for the default
label if the srcref is available. If a value cannot easily be produced, a
default label is used instead. (#4269, #4300) -
The default label for items described below will now attempt to retrieve the
assigned name if the srcref is available. If a value can not easily be
produced, a default label will be used instead. This should improve the
OpenTelemetry span labels and the reactlog experience. (#4269, #4300)reactiveValues(),reactivePoll(),reactiveFileReader(),debounce(),
throttle(),observe()- Combinations of
bindEvent()andreactive()/observe() - Combination of
bindCache()andreactive()
-
updateActionButton()andupdateActionLink()now correctly render HTML
content passed to thelabelargument. (#4249) -
updateSelectizeInput()no longer creates multiple remove buttons when
options = list(plugins="remove_button")is used. (#4275) -
dateRangeInput()/updateDateRangeInput()now correctly considers the time
zones of date-time objects (POSIXct) passed to thestart,end,minand
maxarguments. (thanks @ismirsehregal, #4318)
Breaking changes
- The return value of
actionButton()andactionLink()now wrapslabel
andiconin an additional HTML container element. This allows
updateActionButton()andupdateActionLink()to distinguish between the
labelandiconwhen making updates, and allows spacing betweenlabel
andiconto be more easily customized via CSS.