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

Could not fetch metrics from squid instance unexpected EOF #80

Open
sarakumap opened this issue Aug 1, 2023 · 5 comments
Open

Could not fetch metrics from squid instance unexpected EOF #80

sarakumap opened this issue Aug 1, 2023 · 5 comments

Comments

@sarakumap
Copy link

sarakumap commented Aug 1, 2023

Describe the bug
getting following error with squid version 5.7 with require-proxy-header set.
squid_exporter is failing to read squid metrics and return the following error:

systemctl status squid_exporter

Aug 01 14:50:03 xxxx.xx.xx.local squid-exporter[3883]: 2023/08/01 14:50:03 Could not fetch metrics from squid instance: unexpected EOF

when I looks at the squid log I see the following error. May be this one is causing this error.

error:transaction-end-before-headers NONE/0.0" 0 0 NONE_NONE:HIER_NONE

logs

curl localhost:19101 where squid exporter is listening. it is missing the squid metrics

HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code.

TYPE promhttp_metric_handler_requests_total counter

promhttp_metric_handler_requests_total{code="200"} 13214
promhttp_metric_handler_requests_total{code="500"} 0
promhttp_metric_handler_requests_total{code="503"} 0

HELP squid_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which squid_exporter was built.

TYPE squid_exporter_build_info gauge

squid_exporter_build_info{branch="HEAD",goversion="go1.13.8",revision="c60ca5a56e34783af00b8d7f959bc18d0d6aefa6",version="1.8.3"} 1

HELP squid_up Was the last query of squid successful?

TYPE squid_up gauge

squid_up{host="localhost"} 0

To Reproduce
Steps to reproduce the behavior:
make a request to destination via squid pproxy using loadbalancer
check the squid exporter log and notice the error:

Expected behavior
A clear and concise description of what you expected to happen.

OS (please complete the following information):

  • OS: Centos
  • Version 7

Additional context
Add any other context about the problem here.

@sarakumap
Copy link
Author

sarakumap commented Aug 2, 2023

error from squid logs:
Aug 03 00:32:33 xxx.xx.xx.local squid[26823]: PROXY protocol error: invalid header from local=127.0.0.1:14101 remote=127.0.0.1:44302 FD 12 flags=1

@sarakumap
Copy link
Author

I got it fixed by adding a separate port for http for exposing metrics for squid_exporter.
http_port 14101 require-proxy-header
http_port 24101

@MaciekLeks
Copy link

Hello @sarakumap, could you share more config parts cause I'm facing the same error.

@boynux
Copy link
Owner

boynux commented Feb 7, 2024

thanks @sarakumap, I really appreciate if you add a sentence or two in FAQ section of the README.md file explaining how to fix this issue. That would hopefully address @MaciekLeks question as well.

@boynux
Copy link
Owner

boynux commented Feb 7, 2024

@MaciekLeks something like the config snippet below should technically work if you have the same issue:

Note: make sure to update ports and IP address of squid-exporter to your requirements

http_port 3128 require-proxy-header
http_port 3129

acl managerAdmin src <exporter IP address>
acl managerPort port 3129
http_access allow localhost managerPort manager
http_access allow managerAdmin managerPort manager
http_access deny manager

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

No branches or pull requests

3 participants