Skip to content

Metrics not being reported by pm2 show x #123

@camway

Description

@camway

I feel as though I'm just misusing this package somehow, but I can't figure out what I'm doing wrong.

I've setup 4 different trackers for my app that is run on pm2, but only one of them appears to be reporting any data. 3 of them are meters and 1 of them is a counter. Only 1 of the meters is reporting anything, and I question whether it's correct.

I've tried multiple variations, but this is the current state (obfuscated):

const probe = require('pmx').init({ http: true, errors: true, custom_probes: true, network: true, ports: true }).probe()

probe.counter({ name: "a" })
probe.meter({ name: "b", samples: 60 })
probe.meter({ name: "c", samples: 60 })
probe.meter({ name: "d", samples: 60 })

The meters I've also tried passing agg_type: 'sum' and timeframe: 60 * 60 * 60 (as well as several combinations of these and the above)

I also considered that the probe() function may have to be called before each instance is created, so I tried this refactor:

const pmx = require('pmx').init({ http: true, errors: true, custom_probes: true, network: true, ports: true })

pmx.probe().counter({ name: "a" })
pmx.probe().meter({ name: "b", samples: 60 })
pmx.probe().meter({ name: "c", samples: 60 })
pmx.probe().meter({ name: "d", samples: 60 })

I'm unsure if it matters, but I'm importing the pmx package in a require, and then exporting 4 objects that are each meter/counter instance. Those are then imported in various areas of the project where they are actually incremented/marked.

Is there some kind of pitfall that I'm hitting here? Or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions