shiny.telemetry
Easy logging of users activity and session events of your Shiny App
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.6%) to scientific vocabulary
Keywords
Repository
Easy logging of users activity and session events of your Shiny App
Basic Info
- Host: GitHub
- Owner: Appsilon
- Language: R
- Default Branch: main
- Homepage: https://appsilon.github.io/shiny.telemetry/
- Size: 5.09 MB
Statistics
- Stars: 70
- Watchers: 24
- Forks: 15
- Open Issues: 22
- Releases: 7
Topics
Metadata Files
README.md
shiny.telemetry 
Easy logging of users activity and session events of your Shiny App
The shiny.telemetry R package tracks events occurring on a user session,
such as input changes and session duration, and stores them in a local or remote database.
It provides developers with the tools to help understand how users interact with Shiny dashboards and answer questions such as: which tabs/pages are more often visited, which inputs users are changing, what is the average length of a session, etc.
Install
The shiny.telemetry package can be installed from GitHub by using the remotes package:
R
remotes::install_github("Appsilon/shiny.telemetry", dependencies = TRUE)
With dependencies = TRUE the suggested packages (required to run some examples)
will be installed in addition to mandatory dependencies.
How to use in a Shiny Dashboard?
shiny.telemetry allows for a minimal setup with only 3 commands
that can track some information about the session:
- When session starts and ends
- The browser version used by the client
- Changes in the inputs (doesn't track values by default)
The code below runs a minimal example of a Shiny application that uses shiny.telemetry.
The package will keep track of the session information and all changes to the numericInput.
Note: When using the dashboard nothing is happening from the user's perspective as all operation run in the background (either in the server or in Javascript).
```r library(shiny) library(shiny.telemetry)
telemetry <- Telemetry$new() # 1. Initialize telemetry with default options
shinyApp( ui = fluidPage( usetelemetry(), # 2. Add necessary javascript to Shiny numericInput("n", "n", 1), plotOutput('plot') ), server = function(input, output) { telemetry$startsession() # 3. Minimal setup to track events output$plot <- renderPlot({ hist(runif(input$n)) }) } ) ```
When inspecting the code above, we can breakdown the 3 lines of code by:
- Global
Telemetryobject that is used across the different sessions - Add necessary Javascript to the UI by calling
use_telemetry(). It is used to track browser version. - Initialize the session-specific tracking
by calling method
start_session()of theTelemetryobject.
How to access the data?
The developers and administrators of the dashboard can access the data that is gathered by shiny.telemetry via a Telemetry object or directly from DataStorage via the appropriate provider.
```R
After running the instrumented app
shiny.telemetry::Telemetry$new()$datastorage$readevent_data("2020-01-01", "2050-01-01")
Default provider and path for Telemetry$new()
shiny.telemetry::DataStorageSQLite$new(dbpath = "telemetry.sqlite")$readevent_data("2020-01-01", "2050-01-01") ```
The package includes an analytics dashboard to view the data.
It is located at inst/examples/app/analytics and it should be modified
so that it references the correct DataStorage provider and configuration.
Data providers
There are 3 different types of data providers that can range from local filesystem storage to a remote Plumber REST API instance.
- Local file:
- SQLite using
DataStorageSQLiteclass - Plain text file using
DataStorageLogFileclass
- SQLite using
- Remote SQL database:
- MariaDB using
DataStorageMariaDBclass - PostgreSQL using
DataStoragePostgreSQLclass - MS SQL Server using
DataStorageMSSQLServerclass
- MariaDB using
- Plumber REST API using
DataStoragePlumberclass- In turn, the Plumber data provider will use one of the other classes above as the method of data storage.
The setup for plumber requires a valid Plumber instance running on the network and the communication can be protected. See Plumber deployment documentation for more information.
Debugging the Telemetry calls
The package uses the logger package internally with the shiny.telemetry namespace.
To debug the shiny.telemetry calls in the dashboard,
change the threshold of this namespace to DEBUG:
r
logger::log_threshold("DEBUG", namespace = "shiny.telemetry")
note: This command can be run before the Shiny call or by adding it to the .Rprofile.
Contributing
See CONTRIBUTING.
Appsilon
Appsilon is a Posit (formerly RStudio) Full Service Certified Partner.
Learn more at appsilon.com.
Get in touch opensource@appsilon.com
Explore the Rhinoverse - a family of R packages built around Rhino!
Owner
- Name: Appsilon
- Login: Appsilon
- Kind: organization
- Email: hello@appsilon.com
- Location: Warsaw, Poland
- Website: https://appsilon.com
- Repositories: 129
- Profile: https://github.com/Appsilon
We're hiring! https://appsilon.com/careers
GitHub Events
Total
- Create event: 6
- Release event: 1
- Issues event: 8
- Watch event: 3
- Delete event: 4
- Member event: 1
- Issue comment event: 2
- Push event: 33
- Pull request review event: 12
- Pull request review comment event: 10
- Pull request event: 10
- Fork event: 3
Last Year
- Create event: 6
- Release event: 1
- Issues event: 8
- Watch event: 3
- Delete event: 4
- Member event: 1
- Issue comment event: 2
- Push event: 33
- Pull request review event: 12
- Pull request review comment event: 10
- Pull request event: 10
- Fork event: 3
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| André Veríssimo | 2****o | 274 |
| Recle E. Vibal | r****l@a****m | 132 |
| Kamil Zyla | k****l@a****m | 20 |
| Tymoteusz Makowski | t****i@a****m | 16 |
| Jakub Nowicki | k****a@a****m | 15 |
| Krystian Igras | k****7@g****m | 9 |
| Graeme West | g****t@a****k | 8 |
| Jakub Stepniak | j****t@g****m | 5 |
| Filip Stachura | f****p@a****m | 1 |
| Paweł Przytuła | p****l@a****m | 1 |
| Tomasz Gieorgijewski | t****i@a****m | 1 |
| renovate[bot] | 2****] | 1 |
| whitesource-bolt-for-github[bot] | 4****] | 1 |
| Jakub Stepniak | n****n | 1 |
| Graeme West | c****h | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 98
- Total pull requests: 93
- Average time to close issues: 8 months
- Average time to close pull requests: 16 days
- Total issue authors: 19
- Total pull request authors: 15
- Average comments per issue: 0.57
- Average comments per pull request: 0.55
- Merged pull requests: 83
- Bot issues: 1
- Bot pull requests: 2
Past Year
- Issues: 7
- Pull requests: 9
- Average time to close issues: 3 months
- Average time to close pull requests: about 2 months
- Issue authors: 4
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.11
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- averissimo (32)
- kamilzyla (30)
- krystian8207 (9)
- nbbn (4)
- dokato (3)
- erikrenz88 (2)
- emillykkejensen (2)
- Gotfrid (2)
- vibalre (2)
- cwilligv (2)
- jakubnowicki (2)
- teofiln (1)
- vgilbart (1)
- f-meister (1)
- zilch42 (1)
Pull Request Authors
- averissimo (53)
- arunkodati77 (10)
- jakubnowicki (9)
- vibalre (8)
- WahiduzzamanKhan (7)
- kamilzyla (6)
- Gotfrid (5)
- nbbn (3)
- sankhadeepdutta (2)
- whatIsACommit (2)
- capncodewash (2)
- TymekDev (1)
- mend-bolt-for-github[bot] (1)
- Nerwosolek (1)
- renovate[bot] (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 401 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 5
- Total maintainers: 1
cran.r-project.org: shiny.telemetry
'Shiny' App Usage Telemetry
- Homepage: https://appsilon.github.io/shiny.telemetry/
- Documentation: http://cran.r-project.org/web/packages/shiny.telemetry/shiny.telemetry.pdf
- License: LGPL-3
-
Latest release: 0.3.2
published 6 months ago
