Skip to content

External prom-client up-to-date library #47

@ttessarolo

Description

@ttessarolo

I had serious problems using this library by interfacing it with an existing implementation of prom-client (v13.1.0) using the default client and registry:

const client = require("prom-client");
const register = client.register;

In summary, the opossum-prometheus library logs to a separate prom-client registry/client than the main one, probably because it uses its own internal instance of prom-client, so the logs are not recorded in the main registry/client.

The solution to this problem is simple: add the ability to pass the client in the library options:

  this._registry = options.registry || options.client.register || client.register;
  this._client = options.client || client;

In this way passing the external client everything works perfectly.

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