Git Product home page Git Product logo

Comments (2)

paul-dsh-ct avatar paul-dsh-ct commented on July 17, 2024

Hey,

I had the same issue, I wanted to scrape gotenberg metrics which default endpoint is /prometheus/metrics. I managed to add a new flag in the pushprox client entrypoint by adding the following code in cmd/client/main.go:

In the variables declaration part:
endpoint = kingpin.Flag("endpoint", "Override metrics endpoint (default is /metrics)").String()

In the doScrape function:

if *endpoint != "" {
        request.URL.Path = *endpoint
    }

Then you just have to add the following flag to your client entrypoint: --endpoint=/another/metrics/path

Hope it can help you

from pushprox.

peekjef72 avatar peekjef72 commented on July 17, 2024

Hey,

I had the same issue, I wanted to scrape gotenberg metrics which default endpoint is /prometheus/metrics. I managed to add a new flag in the pushprox client entrypoint by adding the following code in cmd/client/main.go:

In the variables declaration part: endpoint = kingpin.Flag("endpoint", "Override metrics endpoint (default is /metrics)").String()

In the doScrape function:

if *endpoint != "" {
        request.URL.Path = *endpoint
    }

Then you just have to add the following flag to your client entrypoint: --endpoint=/another/metrics/path

Hope it can help you

Hi,
Sorry, but like it was mentionned in #58, the path is not hardcoded: pushproxy is a proxy so it sends the exact query that is set by the client to the final target.

You can test it manually with curl shell cmd:

to reach node_exporter landing page on "client" host

curl -v --proxy http://pushproxy:8080 \
    -H "X-Prometheus-Scrape-Timeout-Seconds: 5" \
    http://client:9100/

to reach node_exporter status page

curl -v --proxy http://pushproxy:8080 \
    -H "X-Prometheus-Scrape-Timeout-Seconds: 5" \
    http://client:9100/status

to reach node_exporter metrics page

curl -v --proxy http://pushproxy:8080 \
    -H "X-Prometheus-Scrape-Timeout-Seconds: 5" \
    http://client:9100/metrics

So if you have trouble to reach the target, it is not the proxy but the config in prometheus !

from pushprox.

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.