Advances in the Shiny Ecosystem

October 9, 2025

Charlie Gao (Open Source - Posit, PBC)

In this talk



[ 1 ]

Async

[ 2 ]

OpenTelemetry

[1] Async

In the Shiny Context

Email


Scheduled Fetch (pre-mirai)

🔄⏳📩

  • Click on refresh button to check
  • If there is mail, download it from the server

Push Notifications (mirai)

📨

  • Received as soon as email arrives
  • Already waiting in inbox, can open straight away

The mirai Design Philosophy


⚙️ Modern Foundation

  • NNG | IPC / TCP / secure TLS | x-language data format support e.g. Arrow

⚡️ Extreme Performance

  • Scales to millions of tasks | 1,000x efficiency | zero-latency promises

🚀 Production First

  • 100% reliable evaluation model | minimal complexity | no hidden state

🌐 Deploy Everywhere

  • Local, remote (SSH), cluster (Slurm, SGE, LSF, PBC) | modular compute profiles

mirai.r-lib.org


              

[2] OpenTelemetry

OpenTelemetry Tracing - Observability at Scale

  • Performance: reduce span length + reduce span nesting
  • Errors: see where they occur in real use
  • Centralized: aggregate across processes / machines
  • Production use: realtime monitoring

How to Enable

[1]

Install {otel} and {otelsdk}

[2]

Set environment variables

e.g.

OTEL_TRACES_EXPORTER="http"
OTEL_EXPORTER_OTLP_ENDPOINT="https://logfire-eu.pydantic.dev"
OTEL_EXPORTER_OTLP_HEADERS="Authorization=<YOUR-WRITE-TOKEN>"

OpenTelemetry

OpenTelemetry

OpenTelemetry

Performance Workflow

Joe Cheng / Shiny in Production (2019) - updated by Barret Schloerke (2025)

  1. Enable OpenTelemetry to see span durations
  2. For long spans, use {profvis} to see where code is slow
  3. Optimize slow code:
  • Move work out of Shiny server (very often)
  • Make code faster (very often)
  • Use caching (sometimes)
  • Non-blocking reactivity (sometimes)
  1. Repeat!

Thanks

Advances in the Shiny Ecosystem