Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ttessarolo opened this issue Apr 21, 2021 · 1 comment
Open

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

ttessarolo opened this issue Apr 21, 2021 · 1 comment

Comments

@ttessarolo
Copy link

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.

@helio-frota helio-frota self-assigned this Aug 6, 2021
@helio-frota helio-frota removed their assignment Jan 19, 2022
@iamelevich
Copy link

You can check https://github.com/iamelevich/opossum-prometheus if still actual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants