Giter Club home page Giter Club logo

Comments (13)

brian-brazil avatar brian-brazil commented on May 14, 2024

Any parameters would go via the configuration file, as the urls would get too crazy otherwise.

Right now you'd have to use the tcp module, but I'd accept a PR to add generic proxy functionality. This should probably also consider the possibility of socks proxies for tcp etc.

from blackbox_exporter.

lausser avatar lausser commented on May 14, 2024

Would this one be the right way to go?
https://github.com/lausser/blackbox_exporter/commit/9a04f098bac0872adfeb89497f34454c78b7e379
Tested with http- and socks-proxies, seems fine so far. When you say "generic proxy functionality", would this mean, that copying the socks part to tcp.go and introducing the proxy-config-settinh for tcp is enough?

from blackbox_exporter.

brian-brazil avatar brian-brazil commented on May 14, 2024

That's the basic idea. Prometheus also has a proxy option, so this logic and the naming should be shared.

from blackbox_exporter.

poblin-orange avatar poblin-orange commented on May 14, 2024

Any update on proxy support ?

from blackbox_exporter.

pj42 avatar pj42 commented on May 14, 2024

I couldn't get the HTTP_PROXY environment variables to be used by blackbox_exporter myself even though Jean-Daniel's opening comment says that he was able to use them?

I managed to fix this for myself by adding http.ProxyFromEnvironment into client.Transport in http.go, i.e. line 125 now reads:

    client.Transport = &http.Transport{
            TLSClientConfig: tlsconfig,
            Dial:            dial,
            Proxy:           http.ProxyFromEnvironment,
    }

from blackbox_exporter.

Jean-Daniel avatar Jean-Daniel commented on May 14, 2024

@pj42 In fact, I never tried to use HTTP_PROXY. This was just an hypothetical workaround suggestion.
I'm using a patched version that support proxy configuration. My patch is tailored for my specific need and is not generic enough to become a PR though. That'w why I never proposed it.

from blackbox_exporter.

pj42 avatar pj42 commented on May 14, 2024

Ok well support for HTTP_PROXY (and NO_PROXY) now working well for me. Commit is here:

pj42@a07d586

from blackbox_exporter.

pj42 avatar pj42 commented on May 14, 2024

My pull request for this now merged in the main code-base.

1b3a6db

Can now do:

HTTP_PROXY="http://proxy-host:8080" NO_PROXY=".mydomain" ./blackbox_exporter

Enjoy :-)

from blackbox_exporter.

tux21b avatar tux21b commented on May 14, 2024

I have needed a similar setting and created #129 . Feel free to continue from there or let me know if I should change something.

from blackbox_exporter.

pj42 avatar pj42 commented on May 14, 2024

Hey.

This pull request is not necessary, http_proxy support has been added to blackbox_exporter since v0.4.0

See notes at top of https://github.com/prometheus/blackbox_exporter/releases/tag/v0.4.0

[FEATURE] HTTP support taking proxy from enviroment

Cheers,
Paul.

from blackbox_exporter.

tux21b avatar tux21b commented on May 14, 2024

@pj42 This pull requests builds on the functionality from the v0.4.0 branch and adds an additional http_proxy setting to the http probe config to specify a proxy server that takes precedence over the environment variables if specified.

My current use-cases requires me to monitor most of the services directly (no proxy) as well as several proxy servers (different proxy settings).

from blackbox_exporter.

pj42 avatar pj42 commented on May 14, 2024

Ah ok then yes makes sense if you require more than one different proxy server to be used by a single running blackbox exporter.

from blackbox_exporter.

brian-brazil avatar brian-brazil commented on May 14, 2024

This was just added.

from blackbox_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.