diff --git a/404.html b/404.html index 018ed991f..365c64d7b 100644 --- a/404.html +++ b/404.html @@ -33,7 +33,7 @@ diff --git a/CONTRIBUTING.html b/CONTRIBUTING.html index 533d35a08..6f59e5560 100644 --- a/CONTRIBUTING.html +++ b/CONTRIBUTING.html @@ -17,7 +17,7 @@ diff --git a/LICENSE-text.html b/LICENSE-text.html index f5de1b62b..e96201b12 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -17,7 +17,7 @@ diff --git a/README-npm.html b/README-npm.html index be3d5e4a1..e6405fcde 100644 --- a/README-npm.html +++ b/README-npm.html @@ -17,7 +17,7 @@ diff --git a/TODO-promises.html b/TODO-promises.html index d0db95cbb..5f6b58a80 100644 --- a/TODO-promises.html +++ b/TODO-promises.html @@ -17,7 +17,7 @@ diff --git a/authors.html b/authors.html index 88788fc4d..b8202e1d7 100644 --- a/authors.html +++ b/authors.html @@ -17,7 +17,7 @@ @@ -188,20 +188,20 @@
Chang W, Cheng J, Allaire J, Sievert C, Schloerke B, Aden-Buie G, Xie Y, Allen J, McPherson J, Dipert A, Borges B (2025). shiny: Web Application Framework for R. -R package version 1.12.1, https://shiny.posit.co/. +R package version 1.12.0.9000, https://shiny.posit.co/.
@Manual{,
title = {shiny: Web Application Framework for R},
author = {Winston Chang and Joe Cheng and JJ Allaire and Carson Sievert and Barret Schloerke and Garrick Aden-Buie and Yihui Xie and Jeff Allen and Jonathan McPherson and Alan Dipert and Barbara Borges},
year = {2025},
- note = {R package version 1.12.1},
+ note = {R package version 1.12.0.9000},
url = {https://shiny.posit.co/},
}
diff --git a/index.html b/index.html
index f9e1f5ed8..de9e2d631 100644
--- a/index.html
+++ b/index.html
@@ -34,7 +34,7 @@
diff --git a/news/index.html b/news/index.html
index 0208f2021..42a91682e 100644
--- a/news/index.html
+++ b/news/index.html
@@ -17,7 +17,7 @@
@@ -44,17 +44,15 @@
OpenTelemetry code attributes now include both the preferred attribute names (code.file.path, code.line.number, code.column.number) and the deprecated names (code.filepath, code.lineno, code.column) to follow OpenTelemetry semantic conventions while maintaining backward compatibility. The deprecated names will be removed in a future release after Logfire supports the preferred names. (#4325)
Timer tests are now skipped on CRAN. (#4327)
withOtelCollect() and localOtelCollect() functions to temporarily control OpenTelemetry collection levels during reactive expression creation. These functions allow you to enable or disable telemetry collection for specific modules or sections of code where reactive expressions are being created. (#4333)code.file.path, code.line.number, code.column.number) and deprecated (code.filepath, code.lineno, code.column) attribute names to follow OpenTelemetry semantic conventions while maintaining backward compatibility. The deprecated names will be removed in a future release after Logfire supports the preferred names. (#4325)R/extended-task.R
+ Source: R/extended-task.R
ExtendedTask.RdwithOtelCollect() temporarily sets the OpenTelemetry collection level for
+the duration of evaluating expr. localOtelCollect() sets the collection
+level for the remainder of the current function scope.
These functions are useful for temporarily controlling telemetry collection +during reactive expression creation. Only the following levels are allowed:
"none" - No telemetry data collected
"reactivity" - Collect reactive execution spans (includes session and
+reactive update events)
"all" - All available telemetry (currently equivalent to "reactivity")
Note that "session" and "reactive_update" levels are not permitted as
+these are runtime-specific levels that should only be set permanently via
+options(shiny.otel.collect = ...) or the SHINY_OTEL_COLLECT environment
+variable, not temporarily during reactive expression creation.
withOtelCollect(collect, expr)
+
+localOtelCollect(collect, envir = parent.frame())Character string specifying the OpenTelemetry collection level.
+Must be one of "none", "reactivity", or "all".
Expression to evaluate with the specified collection level
+(for withOtelCollect()).
Environment where the collection level should be set
+(for localOtelCollect()). Defaults to the parent frame.
withOtelCollect() returns the value of expr.
localOtelCollect() is called for its side effect and returns the previous
+collect value invisibly.
These functions are designed to perform sweeping changes to telemetry +collection, such as enabling or disabling OpenTelemetry for an entire module +or section of code where reactive expressions are being created:
+# Enable telemetry for an entire module
+withOtelCollect("all", {
+ my_result <- my_module("my_id")
+})
+
+# Disable telemetry for expensive development-only reactives
+withOtelCollect("none", {
+ debug_reactive <- reactive({ expensive_debug_computation() })
+})While using withOtelCollect() as a pipe-able method, it is not recommended due to the use case where the reactive object is created before the withOtelCollect() call. In such cases, the reactive object will not inherit the intended OpenTelemetry settings.
Therefore, to avoid this hard-to-debug situation, we recommend that you only create your reactive objects within the withOtelCollect() call or after setting the local collection level with localOtelCollect().
# Technically works, but not recommended
+x <- reactive({ ... }) %>% withOtelCollect(collect = "all")
+x <- reactive({ ... }) |> withOtelCollect(collect = "all")
+# Equivalent to:
+x <- withOtelCollect("all", reactive({ ... }))
+
+# Does NOT work as intended
+x <- reactive({ ... })
+# `x` was created outside of `withOtelCollect()`,
+# therefore no OTel settings are applied
+x_no_otel <- withOtelCollect("all", x)
+
+# Best practice: Create the reactive object within `expr=`
+withOtelCollect("all", {
+ x_with_otel <- reactive({ ... })
+ y_with_otel <- reactive({ ... })
+})See the shiny.otel.collect option within shinyOptions. Setting
+this value will globally control OpenTelemetry collection levels.
if (FALSE) { # \dontrun{
+# Temporarily disable telemetry collection
+withOtelCollect("none", {
+ # Code here won't generate telemetry
+ reactive({ input$x + 1 })
+})
+
+# Collect reactivity telemetry but not other events
+withOtelCollect("reactivity", {
+ # Reactive execution will be traced
+ observe({ print(input$x) })
+})
+
+# Use local variant in a function
+my_function <- function() {
+ localOtelCollect("none")
+ # Rest of function executes without telemetry
+ reactive({ input$y * 2 })
+}
+} # }
+
+