Skip to content

Instantly share code, notes, and snippets.

@risentveber
Last active November 8, 2021 08:08
Show Gist options
  • Save risentveber/6366e9e04785234183d8f6d8860389d0 to your computer and use it in GitHub Desktop.
Save risentveber/6366e9e04785234183d8f6d8860389d0 to your computer and use it in GitHub Desktop.

Librato cheatsheet

Terms

Report period - how often metric is sent to librato server(defaults to 1 minute).

Chart resolution - time between two sequential points on a chart(depends on chart time range).

Counter

Reported as delta since last report.

# POST payload to librato server
hit.counter # metric name
20 # Delta since last report
  • count - how many times delta was reported(depends on chart resolution additively).
  • max - max delta reported for the report period.
  • min - min delta reported for the report period (sporadic: true - means it won't be zero, since delta equals zero isn't reported).
  • sum - sum of deltas(depends on chart resolution additively).
  • avg - average reported delta for the report period.

Example

One has 100 processes:

  • 98 of them report 10 increments per minute
  • 1 of them report 1 increments per minute
  • 1 of them report 20 increments per minute

At chart with minute resolution:

  • count equals 100
  • max equals 20
  • min equals 1
  • sum equals 98*10 + 1*1 + 1*20 = 1001
  • avg equals sum/count = 1001/100 = 10,01

At chart with hour resolution:

  • count equals count minute*60 = 6000
  • max equals 20
  • min equals 1
  • sum equals sum minute*60 = 1001*60 = 60060
  • avg equals sum minute*60 / (count minute*60) = 1001*60 / (100*60) = 10,01

Gauge

Reported as min, max, sum, count for the report period since last report.

# POST payload to librato server
action.latency # metric name
# describe bunch of measurements in ms
max=10
min=1
sum=80
count=14
  • count - how many times measurement was called(depends on chart resolution additively).
  • max - max measurement for the report period
  • min - min measurement for the report period
  • sum - sum of all measurements during the report period(depends on chart resolution additively)
  • avg - average measurement for the report period

Example

One has 10 processes:

  • 5 of them measure 10 events per minute with static latency 7
  • 3 of them measure 6 events per minute with static latency 10
  • 2 of them measure 2 events per minute with static latency 5

At chart with minute resolution:

  • count equals 10 + 6 + 2 = 18
  • max equals 10
  • min equals 5
  • sum equals 10*7 + 6*10 + 2*5 = 140
  • avg equals sum/count = 140/18 = 7.77

At chart with hour resolution:

  • count equals count minute*60 = 18*60 = 1080
  • max equals 10
  • min equals 5
  • sum equals sum minute*60 = 140*60 = 8400
  • avg equals sum minute*60 / (count minute*60) = 140*60 / (18*60) = 7.77

Chart resolution-independent visualization

Use chart resolution-independent conversion - set x/p as Transform ƒ in chart metric attributes where p is dynamic value for chart resolution in seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment