Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

dsager/appsignal-metrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

appsignal-metrics

Collection of potentially interesting examples of AppSignal custom metrics.

Examples

An example represents an interesting metric from a typical web application. For each example there's a:

  • brief description of the metric and motivation,
  • code snippet of the measurement within your application (ruby),
  • code snippet of the visualization via dashboard graph (yml),
  • screenshot(s) of the visualization.

Ideally.

session_creation_count

Count whenever a new session is created (i.e. a user logs in).

measurement

Appsignal.increment_counter('session_creation_count', 1)

visualization

-
  title: "Newly created sessions"
  kind: "count"
  format: "throughput"
  fields:
    - session_creation_count

backend_api_call

Record the execution time of each back-end API call.

measurement

time = Benchmark.ms { MyAPI.call(params) }
Appsignal.add_distribution_value('back_end_api_call', time)

visualization

-
  title: 'API call time'
  kind: measurement
  format: duration
  fields:
    - back_end_api_call
-
  title: 'API call throughput'
  kind: measurement
  format: throughput
  fields:
    - back_end_api_call_count

backend_api_error

Count API errors by type (i.e. HTTP response code).

measurement

unless response.success?
  Appsignal.increment_counter("backend_api_error_#{response.code}", 1)
end

visualization

-
  title: 'API errors'
  kind: count
  filter: 'backend_api_error_[0-9]+'
  format: number

Contribute

  • fork this repo,
  • add your example in one single commit,
  • open a pull request
  • thanks!

LICENSE

MIT

About

collection of potentially interesting appsignal custom metric examples

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published