Description Usage Arguments Examples
View source: R/prometheusShiny.R
Render the metrics and serve the '/metrics' endpoint in shiny.semantic
1 | prometheusRenderShiny(app, registry)
|
app |
A shiny application as returned by [shiny::shinyApp()]. |
registry |
A registry as returned by [CollectorRegistry]. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | library(shiny)
registry <<- CollectorRegistry$new()
registry$registerGauge(
name = 'test',
help = 'some_gauge',
namespace = "my_space"
)
ui <- fluidPage(
actionButton("click", "Click")
)
server <- function(input, output){
gauge <- registry$getGauge(name = 'test', namespace = "my_space")
observeEvent(input$click, {
gauge$inc()
})
}
app <- shinyApp(ui, server)
if(interactive())
prometheusRenderShiny(app, registry)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.