Home / Input Output / iohk-monitoring-framework
Aug 03, 1-2 AM (0)
Aug 03, 2-3 AM (0)
Aug 03, 3-4 AM (0)
Aug 03, 4-5 AM (0)
Aug 03, 5-6 AM (0)
Aug 03, 6-7 AM (0)
Aug 03, 7-8 AM (0)
Aug 03, 8-9 AM (0)
Aug 03, 9-10 AM (0)
Aug 03, 10-11 AM (0)
Aug 03, 11-12 PM (0)
Aug 03, 12-1 PM (0)
Aug 03, 1-2 PM (0)
Aug 03, 2-3 PM (0)
Aug 03, 3-4 PM (1)
Aug 03, 4-5 PM (1)
Aug 03, 5-6 PM (0)
Aug 03, 6-7 PM (0)
Aug 03, 7-8 PM (0)
Aug 03, 8-9 PM (0)
Aug 03, 9-10 PM (0)
Aug 03, 10-11 PM (0)
Aug 03, 11-12 AM (0)
Aug 04, 12-1 AM (0)
Aug 04, 1-2 AM (0)
Aug 04, 2-3 AM (0)
Aug 04, 3-4 AM (0)
Aug 04, 4-5 AM (0)
Aug 04, 5-6 AM (0)
Aug 04, 6-7 AM (0)
Aug 04, 7-8 AM (0)
Aug 04, 8-9 AM (0)
Aug 04, 9-10 AM (0)
Aug 04, 10-11 AM (1)
Aug 04, 11-12 PM (1)
Aug 04, 12-1 PM (0)
Aug 04, 1-2 PM (0)
Aug 04, 2-3 PM (0)
Aug 04, 3-4 PM (0)
Aug 04, 4-5 PM (0)
Aug 04, 5-6 PM (0)
Aug 04, 6-7 PM (0)
Aug 04, 7-8 PM (0)
Aug 04, 8-9 PM (0)
Aug 04, 9-10 PM (0)
Aug 04, 10-11 PM (0)
Aug 04, 11-12 AM (0)
Aug 05, 12-1 AM (0)
Aug 05, 1-2 AM (0)
Aug 05, 2-3 AM (0)
Aug 05, 3-4 AM (0)
Aug 05, 4-5 AM (0)
Aug 05, 5-6 AM (0)
Aug 05, 6-7 AM (2)
Aug 05, 7-8 AM (0)
Aug 05, 8-9 AM (0)
Aug 05, 9-10 AM (0)
Aug 05, 10-11 AM (0)
Aug 05, 11-12 PM (0)
Aug 05, 12-1 PM (0)
Aug 05, 1-2 PM (0)
Aug 05, 2-3 PM (0)
Aug 05, 3-4 PM (0)
Aug 05, 4-5 PM (0)
Aug 05, 5-6 PM (0)
Aug 05, 6-7 PM (0)
Aug 05, 7-8 PM (0)
Aug 05, 8-9 PM (0)
Aug 05, 9-10 PM (0)
Aug 05, 10-11 PM (0)
Aug 05, 11-12 AM (0)
Aug 06, 12-1 AM (0)
Aug 06, 1-2 AM (0)
Aug 06, 2-3 AM (0)
Aug 06, 3-4 AM (0)
Aug 06, 4-5 AM (0)
Aug 06, 5-6 AM (0)
Aug 06, 6-7 AM (0)
Aug 06, 7-8 AM (0)
Aug 06, 8-9 AM (0)
Aug 06, 9-10 AM (0)
Aug 06, 10-11 AM (0)
Aug 06, 11-12 PM (0)
Aug 06, 12-1 PM (0)
Aug 06, 1-2 PM (0)
Aug 06, 2-3 PM (0)
Aug 06, 3-4 PM (0)
Aug 06, 4-5 PM (0)
Aug 06, 5-6 PM (0)
Aug 06, 6-7 PM (0)
Aug 06, 7-8 PM (0)
Aug 06, 8-9 PM (0)
Aug 06, 9-10 PM (0)
Aug 06, 10-11 PM (0)
Aug 06, 11-12 AM (0)
Aug 07, 12-1 AM (0)
Aug 07, 1-2 AM (0)
Aug 07, 2-3 AM (0)
Aug 07, 3-4 AM (0)
Aug 07, 4-5 AM (0)
Aug 07, 5-6 AM (0)
Aug 07, 6-7 AM (0)
Aug 07, 7-8 AM (0)
Aug 07, 8-9 AM (0)
Aug 07, 9-10 AM (0)
Aug 07, 10-11 AM (0)
Aug 07, 11-12 PM (0)
Aug 07, 12-1 PM (0)
Aug 07, 1-2 PM (0)
Aug 07, 2-3 PM (0)
Aug 07, 3-4 PM (0)
Aug 07, 4-5 PM (0)
Aug 07, 5-6 PM (0)
Aug 07, 6-7 PM (0)
Aug 07, 7-8 PM (0)
Aug 07, 8-9 PM (0)
Aug 07, 9-10 PM (0)
Aug 07, 10-11 PM (0)
Aug 07, 11-12 AM (0)
Aug 08, 12-1 AM (0)
Aug 08, 1-2 AM (0)
Aug 08, 2-3 AM (0)
Aug 08, 3-4 AM (0)
Aug 08, 4-5 AM (0)
Aug 08, 5-6 AM (0)
Aug 08, 6-7 AM (0)
Aug 08, 7-8 AM (0)
Aug 08, 8-9 AM (0)
Aug 08, 9-10 AM (0)
Aug 08, 10-11 AM (0)
Aug 08, 11-12 PM (0)
Aug 08, 12-1 PM (0)
Aug 08, 1-2 PM (0)
Aug 08, 2-3 PM (0)
Aug 08, 3-4 PM (0)
Aug 08, 4-5 PM (0)
Aug 08, 5-6 PM (0)
Aug 08, 6-7 PM (0)
Aug 08, 7-8 PM (0)
Aug 08, 8-9 PM (0)
Aug 08, 9-10 PM (0)
Aug 08, 10-11 PM (0)
Aug 08, 11-12 AM (0)
Aug 09, 12-1 AM (0)
Aug 09, 1-2 AM (0)
Aug 09, 2-3 AM (0)
Aug 09, 3-4 AM (0)
Aug 09, 4-5 AM (0)
Aug 09, 5-6 AM (0)
Aug 09, 6-7 AM (0)
Aug 09, 7-8 AM (0)
Aug 09, 8-9 AM (0)
Aug 09, 9-10 AM (0)
Aug 09, 10-11 AM (0)
Aug 09, 11-12 PM (0)
Aug 09, 12-1 PM (0)
Aug 09, 1-2 PM (0)
Aug 09, 2-3 PM (0)
Aug 09, 3-4 PM (0)
Aug 09, 4-5 PM (0)
Aug 09, 5-6 PM (0)
Aug 09, 6-7 PM (0)
Aug 09, 7-8 PM (0)
Aug 09, 8-9 PM (0)
Aug 09, 9-10 PM (0)
Aug 09, 10-11 PM (0)
Aug 09, 11-12 AM (0)
Aug 10, 12-1 AM (0)
Aug 10, 1-2 AM (0)
6 commits this week Aug 03, 2020 - Aug 10, 2020
Merge #574
574: CAD-1208: Prometheus JSON output. r=denisshevchenko a=denisshevchenko

description
-----------

Previously Prometheus' output was ini-like formatted, for example:

```
...
rts_gc_gc_wall_ms 38
cardano_node_metrics_Mem_resident_int 17748
rts_gc_mutator_cpu_ms 316
rts_gc_peak_megabytes_allocated 50
...
```

Now the output is in JSON-format which is easier to parse. An example:

```
[
  {
    "metrics": [
      {
        "value": 0,
        "name": "par_max_bytes_copied",
        "type": "int"
      },
      {
        "value": 0,
        "name": "par_avg_bytes_copied",
        "type": "int"
      },
      {
        "value": 1,
        "name": "init_cpu_ms",
        "type": "int"
      },
      {
        "value": 7308376,
        "name": "bytes_allocated",
        "type": "int"
      },
      {
        "value": 6,
        "name": "num_bytes_usage_samples",
        "type": "int"
      },
      {
        "value": 105264,
        "name": "current_bytes_slop",
        "type": "int"
      },
      {
        "value": 105264,
        "name": "max_bytes_slop",
        "type": "int"
      },
      {
        "value": 0,
        "name": "par_tot_bytes_copied",
        "type": "int"
      },
      {
        "value": 3068968,
        "name": "cumulative_bytes_used",
        "type": "int"
      },
      {
        "value": 13,
        "name": "gc_wall_ms",
        "type": "int"
      },
      {
        "value": 34,
        "name": "cpu_ms",
        "type": "int"
      }
    ],
    "namespace": "rts.gc"
  }
  ...
]
```

Please note that only `rts.gc`-metrics are grouped in one group `"rts.gc"`. All other metrics can have different names and we can not make any assumptions about the format of these names. So all other metrics are grouped in `"common"` group. An example:

```
{
    "metrics": [
      {
        "value": 0.1,
        "name": "iohk-monitoring version",
        "type": "real"
      },
      {
        "value": 26.30240838783037,
        "name": "complex.random.rr",
        "type": "real"
      },
      {
        "value": 1596470035685,
        "name": "ekg.server_timestamp_ms",
        "type": "int"
      },
      {
        "value": 37.711116781794196,
        "name": "complex.#aggregation.complex.random.ewma.rr.rr.avg",
        "type": "real"
      }
    ],
    "namespace": "common"
  }
```  

Please note that it's possible to choose a format using this option:

```
CM.setTextOption c "prometheusOutput" "json"  -- Prometheus' output in JSON-format
```

If this option is not specified in the configuration - an old format will be used.

checklist
---------

- [x] compiles (`cabal v2-build` or `stack build`)
- [x] tests run successfully (`cabal v2-test` or `stack test`)
- [ ] documentation added
- [x] link to an issue
- [ ] add milestone (the current sprint)


Co-authored-by: Denis Shevchenko <[email protected]>