Giter Club home page Giter Club logo

Comments (9)

discostur avatar discostur commented on August 24, 2024 18

Got it working by just quoting the whole line (no quotes inside):

args:
        - '--haproxy.scrape-uri=http://user:[email protected]:2200/haproxy/haproxy_stats.php?haproxystats=1;csv'

from haproxy_exporter.

wdauchy avatar wdauchy commented on August 24, 2024

hello @easylo
what is the command line you are using exactly? I cannot reproduce on my side

from haproxy_exporter.

wdauchy avatar wdauchy commented on August 24, 2024

ping @easylo

from haproxy_exporter.

discostur avatar discostur commented on August 24, 2024

@wdauchy i can confirm the but @easylo found; It happend to me today, as i tried to deploy the haproxy_exporter via kubernetes as a deployment:

apiVersion: extensions/v1beta1 
kind: Deployment 
metadata:
  labels:
    app: haproxy-exporter-lb 
  name: haproxy-exporter-lb 
  namespace: kube-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: haproxy-exporter-lb
  template:
    metadata:
      labels:
        app: haproxy-exporter-lb
    spec:
      containers:
      - name: haproxy-exporter-lb
        image: quay.io/prometheus/haproxy-exporter:latest
        ports:
        - containerPort: 9101
          hostPort: 9101
        args:
        - --haproxy.scrape-uri="http://user:[email protected]:2200/haproxy/haproxy_stats.php?haproxystats=1;csv"

shows the following output:

time="2018-01-22T11:08:04Z" level=info msg="Starting haproxy_exporter (version=, branch=, revision=)" source="haproxy_exporter.go:495" 
time="2018-01-22T11:08:04Z" level=info msg="Build context (go=go1.9.2, user=, date=)" source="haproxy_exporter.go:496" 
time="2018-01-22T11:08:04Z" level=fatal msg="parse \"http://user:[email protected]:2200/haproxy/haproxy_stats.php?haproxystats=1;csv\": first path segment in URL cannot contain colon" source="haproxy_exporter.go:500" 

However, if i try to run it simpl via docker (not kubernetes deployment) it is running fine:

docker run -p 9101:9101 -it --rm quay.io/prometheus/haproxy-exporter:latest --haproxy.scrape-uri="http://user:[email protected]:2200/haproxy/haproxy_stats.php?haproxystats=1;csv"

I think the problem is the escaping, which kubernetes does if you pass args to your deployment. When i try to run it with escaping:

docker run -p 9101:9101 -it --rm quay.io/prometheus/haproxy-exporter:latest --haproxy.scrape-uri=\"http://user:[email protected]:2200/haproxy/haproxy_stats.php?haproxystats=1;csv\"

it fails with the same error message as on kubernetes :/

from haproxy_exporter.

discordianfish avatar discordianfish commented on August 24, 2024

Try quoting the whole arg:

args:
  - '--haproxy....'

from haproxy_exporter.

discostur avatar discostur commented on August 24, 2024

@discordianfish doesn't work either:

Deployment:

        args:
        - '--haproxy.scrape-uri="http://user:[email protected]:2200/haproxy/haproxy_stats.php?haproxystats=1;csv"'

Error:

time="2018-01-23T08:00:21Z" level=fatal msg="parse \"http://user:[email protected]:2200/haproxy/haproxy_stats.php?haproxystats=1;csv\": first path segment in URL cannot contain colon" source="haproxy_exporter.go:500" 

from haproxy_exporter.

discordianfish avatar discordianfish commented on August 24, 2024

Meh, was worth a try. Had my fair share of escaping issues with yaml myself. Either way, this isn't a problem with the haproxy-exporter but with the manifest. So I think it makes sense to close this.

from haproxy_exporter.

zimmertr avatar zimmertr commented on August 24, 2024

Thanks for the tip @discostur ! To add another one, don't try and escape any special characters in your password like I was!

from haproxy_exporter.

ngarciaf avatar ngarciaf commented on August 24, 2024

Got it working by just quoting the whole line (no quotes inside):

args:
        - '--haproxy.scrape-uri=http://user:[email protected]:2200/haproxy/haproxy_stats.php?haproxystats=1;csv'

Thanks for the tip!

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