Comments (7)
Hmm, maybe this is a bad example. The fact that both exporter_exporter and snmp_exporter use a module
query-string argument is confusing.
EDIT: raised separately as #23
from exporter_exporter.
The point about error responses still stands. You can demonstrate it by missing a mandatory query string arg on snmp_exporter:
# curl -v localhost:9999/proxy?module=snmp
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9999 (#0)
> GET /proxy?module=snmp HTTP/1.1
> Host: localhost:9999
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Sat, 19 Oct 2019 09:41:44 GMT
< Content-Length: 103
<
An error has occurred while serving metrics:
text format parsing error in line 1: invalid metric name
* Connection #0 to host localhost left intact
In this case, tcpdump shows that the response from snmp_exporter was:
HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Sat, 19 Oct 2019 09:43:05 GMT
Content-Length: 37
'target' parameter must be specified
from exporter_exporter.
Thanks for the report. We should be able to handle this better.
from exporter_exporter.
I've added support for reporting an error. Unfortunately, some of the internals mean that we cannot simply reforwarded all errors. As it stands, we should now at least report there is an error and not just report a parsing failure. Hopefully this helps a bit.
from exporter_exporter.
Great, thanks for that.
from exporter_exporter.
Aside: since at that point resp.Body has not been touched, presumably it would be possible to read (say) the first 1024 bytes and include it in the error message?
from exporter_exporter.
The problem is that it's promhttp.handler that calls the gatherer, so it's that that passes back the response. I could put a chunk of the Body in the error I give back to the promhttp handler, but that would be even uglier output than what we currently do.
from exporter_exporter.
Related Issues (20)
- ed25519 HOT 4
- Limit queries by IP HOT 1
- ARM Release HOT 4
- build info missing from `--version`
- utf-8 encoded labels
- Better use 2048bit for the TLS-certificate-example
- http without any restriction is always open HOT 2
- github.com/prometheus/common/log is deprecated
- Verify does not work with OpenMetrics HOT 2
- Client sent an HTTP request to an HTTPS server HOT 1
- curl: (52) Empty reply from server HOT 6
- Transition option to keep the route for a default module HOT 6
- Support info metric type HOT 2
- Question - how to understand/debug verify issue HOT 3
- push latest tagged version to docker hub HOT 2
- Return multiple module data in one call HOT 4
- 0.5.0 binary depends on recent GLIBC HOT 7
- build problems on ubuntu 20 LTS HOT 1
- HTTP Config does not allow setting RootCAs? HOT 2
- Convert to using exporter-toolkit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exporter_exporter.