Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When '%' in my uri ,the marathon_exporter can't running. #26

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

sober-wang
Copy link

When '%' in my uri ,the marathon_exporter can't running.
So , I fix the bug.

README.md Outdated
@@ -36,6 +36,11 @@ Usage of marathon_exporter:
-marathon.uri string
URI of Marathon (default "http://marathon.mesos:8080")
Note: Supply HTTP Basic Auth (i.e. user:[email protected])
If you URI inclube '%' ,you should used marathon.username and marathon.password
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo fixes: "if your URI include '%', you should use...."

Also, about your PR, you have the issue when you have % in your password for instance right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fix it.

README.md Outdated
-marathon.username string
marathon author username ,(default "")
-marathon.password string
marathon author password ,(default "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove both unnecessary ','
Also, change 'author' -> 'user' to be clearer for the user.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fix it.

go.mod Outdated
@@ -0,0 +1,19 @@
module marathon_exporter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you propose a different PR to switch to go modules please?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just remove go modules.

scraper.go Outdated
@@ -31,11 +31,17 @@ func (s *scraper) Scrape(path string) ([]byte, error) {
},
}

response, err := client.Get(fmt.Sprintf("%v/%s", s.uri, path))
//response, err := client.Get(fmt.Sprintf("%v/%s", s.uri, path))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove the comment if we don't use it anymore

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just remove the comment.

main.go Outdated
config.HTTPBasicAuthUser = uri.User.Username()
}
}
config.HTTPBasicAuthUser = *marathonUserName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, user is not able to specify its marathon user and password in the URL anymore? It would be ncie to be able to do both for retro compatibility

@Lqp1
Copy link
Contributor

Lqp1 commented Sep 25, 2020

I tested with your branch, and even with your last commits, the scrapper does not authenticate properly when using the user/pass provided in the URI and can't fetch all metrics.
You can have a look at this PR, someone already did something similar: #16
Also, note that with fairly recent version of marathon, there's already a prometheus exporter and this node might not be needed anymore: https://mesosphere.github.io/marathon/docs/metrics.html

@sober-wang
Copy link
Author

I tested with your branch, and even with your last commits, the scrapper does not authenticate properly when using the user/pass provided in the URI and can't fetch all metrics.
You can have a look at this PR, someone already did something similar: #16
Also, note that with fairly recent version of marathon, there's already a prometheus exporter and this node might not be needed anymore: https://mesosphere.github.io/marathon/docs/metrics.html

oh, I used marathon v1.14.x ,it not have prometheus exporter URL path.
Are you build code's ?
I can run the binary file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants