Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 847 Bytes

ambiorix.md

File metadata and controls

40 lines (30 loc) · 847 Bytes
title summary authors
Using titan with ambiorix
How to monitor metrics for ambiorix applications.
John Coene

Ambiorix

Then again, the metrics themselves and their usage does not differ, only the way the metrics are served.

With ambiorix, create a new get method on the /metrics endpoint, and have it return the results of renderMetrics.

library(titan)
library(ambiorix)

# basic counter
c <- Counter$new(
  name = "visits_total", 
  help = "Total visit to the site",
  labels = "path"
)

app <- Ambiorix$new()

app$use(titan())

app$get("/", function(req, res){
  c$inc(path = "/")
  res$send("Using {titan} with {ambiorix}!")
})

app$get("/about", function(req, res){
  c$inc(path = "/about")
  res$send("About {titan} and {ambiorix}!")
})

app$start()