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

Gateway need a new Constructor #718

Open
love19862003 opened this issue Jun 17, 2024 · 0 comments
Open

Gateway need a new Constructor #718

love19862003 opened this issue Jun 17, 2024 · 0 comments

Comments

@love19862003
Copy link

some times we use gateway address is like "https://pushgateway.address.com/service_a/xxx/"
so need a new Constructor function like

`Gateway::Gateway(const std::string& url, const std::string& jobname,
const Labels& labels, const std::string& username,
const std::string& password) {
curlWrapper_ = std::make_uniquedetail::CurlWrapper(username, password);

std::stringstream jobUriStream;
jobUriStream << url << "/metrics/job/" << jobname;
jobUri_ = jobUriStream.str();

std::stringstream labelStream;
for (auto& label : labels) {
labelStream << "/" << label.first << "/" << label.second;
}
labels_ = labelStream.str();
}`

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

No branches or pull requests

1 participant