GithubHelp home page GithubHelp logo

Comments (7)

candlerb avatar candlerb commented on May 28, 2024

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.

candlerb avatar candlerb commented on May 28, 2024

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.

tcolgate avatar tcolgate commented on May 28, 2024

Thanks for the report. We should be able to handle this better.

from exporter_exporter.

tcolgate avatar tcolgate commented on May 28, 2024

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.

candlerb avatar candlerb commented on May 28, 2024

Great, thanks for that.

from exporter_exporter.

candlerb avatar candlerb commented on May 28, 2024

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.

tcolgate avatar tcolgate commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.