discourse / prometheus_exporter

A framework for collecting and aggregating prometheus metrics
MIT License
537 stars 155 forks source link

Failed to send message Address #162

Open rcclemente opened 3 years ago

rcclemente commented 3 years ago

I am trying to use this with kubernetes and I created 2 deployments 1 For the Rails application that boots this via the initializer 1 For the Promethues exporter

The rails application logs shows this error


Prometheus Exporter, failed to send message Address not available - connect(2) for "localhost" port 9394
Prometheus Exporter, failed to send message Address not available - connect(2) for "localhost" port 9394
Prometheus Exporter, failed to send message Address not available - connect(2) for "localhost" port 9394

Should i instead run this as a sidecar?

SamSaffron commented 3 years ago

probably, either that or you need to figure out how to address the exporter process from the rails app. At a minimum it has to be in the same pod.

dpetersen commented 3 years ago

FWIW we run the exporter as a sidecar, but also have a dedicated single-pod Deployment for application-global metrics like sidekiq queue lengths and any custom collector that uses the database for metrics. The sidecar container runs the same docker image as the main container, but starts with bundle exec prometheus_exporter --bind 0.0.0.0 and has different health checks and resource requirements.

mildred commented 1 year ago

Is there a way to quiet this error, it is flooding my log when I run migrations.

Unfortunately, docker-compose run does not respect the network settings in the compose file and the migration container do not have access to the sane network as the prometheus exporter. I'd like to quiet the repetition of these errors in that case.