artprima / prometheus-metrics-bundle

Symfony 5/6 Prometheus Metrics Bundle
MIT License
133 stars 29 forks source link

Redis connection through Unix socket #13

Closed quentin-st closed 3 years ago

quentin-st commented 4 years ago

The documentation mentions the configuration keys that should be used when connecting to a Redis instance through TCP (host & port). What if we'd like to use a TCP socket for lightning fast local connections?

denisvmedia commented 4 years ago

I never tried it, but it should be possible to use a host parameter for specifying a unix socket (port should be omitted then, or set to NULL). Could you please try and let me know if it works?

quentin-st commented 4 years ago

Thanks for your answer!

I tried setting the port parameter to ~ (null), but I'm getting the following error on cache clear:

Invalid type for path "artprima_prometheus_metrics.redis.port". Expected int, but got NULL.

When omitting this parameter, I'm getting this one at runtime:

php_network_getaddresses: getaddrinfo failed: Name or service not known
denisvmedia commented 4 years ago

Ok, I see. I will fix this, as soon as I get time. Alternatively, you may want to provide a pull request. It should be a small fix.