platforms / heroku / integrations / dyno-runtime-metrics

Heroku Dyno Runtime Metrics Integration

When you enable the Heroku log runtime metrics feature for your Heroku application you'll automatically get dyno resource usage samples. Timber classifies these as normalized events across all platforms. Specifically, you'll get:

You'll Get
Resource sample event

How to use it

In your shell run this command:

heroku labs:enable log-runtime-metrics -a <app-name>

How it works

By enabling this feature Heroku will begin to log CPU and memory sample events periodically. For example:

source=web.1 dyno=heroku.2808254.d97d0ea7-cf3d-411b-b453-d2943a50b456 sample#memory_total=21.00MB sample#memory_rss=21.22MB sample#memory_cache=0.00MB sample#memory_swap=0.00MB sample#memory_pgpgin=348836pages sample#memory_pgpgout=343403pages

Timber will recognize this event, parse it, and classify it as a resource_sample event with a memory sub-document.

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
27
28
{
  "level": "debug",
  "message": "source=web.1 dyno=heroku.2808254.d97d0ea7-cf3d-411b-b453-d2943a50b456 sample#memory_total=21.00MB sample#memory_rss=21.22MB sample#memory_cache=0.00MB sample#memory_swap=0.00MB sample#memory_pgpgin=348836pages sample#memory_pgpgout=343403pages",
  "context": {
    "platform": {
      "heroku": {
        "dyno_type": "web",
        "dyno_id": 1,
        "source": "heroku"
      }
    },
    "system": {
      "hostname": "heroku.2808254.d97d0ea7-cf3d-411b-b453-d2943a50b456"
    }
  },
  "event": {
    "resource_sample": {
      "memory": {
        "cache_mb": 0.0,
        "pgpgin": 348836.0,
        "pgpgout": 343403.0,
        "rss_mb": 21.22,
        "swap_mb": 0.0,
        "total_mb": 21.0
      }
    }
  }
}
Questions?

Chat with us, just click the talk button in the bottom right of this page.

Chat with us
Sign Up

Log better and solve problems faster, today. Install in under a minute.

Sign Up