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

docker log flooded with warning: instance variable @all_labels_preset not initialized #190

Closed
JonJagger opened this issue May 26, 2020 · 7 comments

Comments

@JonJagger
Copy link

Hi,

My dockerized rack-server's entrypoint is

readonly MY_DIR="$(cd "$(dirname "${0}")" && pwd)"
export RUBYOPT='-W2'
rackup \
  --env production \
  --port ${PORT}   \
  --server puma    \
  --warn           \
    ${MY_DIR}/config.ru

And my config.ru, copied directly from the README.md, has

require 'prometheus/middleware/collector'
require 'prometheus/middleware/exporter'
use Prometheus::Middleware::Collector
use Prometheus::Middleware::Exporter
...

Unfortunately this floods my docker log with the following warning:

warning: instance variable @all_labels_preset not initialized

This comes from
lib/prometheus/client/metric.rb:91

I'd really appreciate it anyone could help me by either,
telling me how to avoid this warning at 2.0.0, or
doing a new release that fixes the problem.

Thanks

@dmagliola
Copy link
Collaborator

Hello,
What version of Ruby are you using?

@JonJagger
Copy link
Author

ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-musl]
Sorry, should have mentioned that.

@dmagliola
Copy link
Collaborator

dmagliola commented May 26, 2020

Thank you for the report!
Turns out, we're running our tests with warning off, so we're missing a bunch.

I've opened PR #191 to fix this warning you reported and a few others.
There's also PR #188 which fixes another deprecation warning.

Once we merge both of those, i'll cut a new version of the gem.

Thanks!

@JonJagger
Copy link
Author

Thanks. I look forward to the new gem. Till then I have a horrible work around!

@JonJagger
Copy link
Author

Hi again,
its been a month and I'm really hoping for that new gem...
The current gem is basically unusable for any user that sets their warnings on... :(

@dmagliola
Copy link
Collaborator

Sorry about that! We've now merged all the relevant PRs, and we're pushing the new version to Rubygems today!

@JonJagger
Copy link
Author

Thanks :-)

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

2 participants