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

feat: support uri without port and support uri with path #2224

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jiaorenyu
Copy link

@jiaorenyu jiaorenyu commented Dec 2, 2024

Summary

Make prometheus.server.endpoint support http://host:port/path/to/query instead of schema://host:port

Categorization

  • documentation
  • bugfix
  • new feature
  • refactor
  • security/CVE
  • other

This PR resolves #1917 .

throw new IllegalArgumentException();
}
String endpointWithScheme = endpoint.startsWith("http") ? endpoint : "http://" + endpoint;
URIBuilder uriBuilder = new URIBuilder(endpointWithScheme);
Copy link
Author

Choose a reason for hiding this comment

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

For "http://example.com/path/to/query", its port is -1 in uriBuilder, but its default port is 80.

And IMO we don't need to verify if the port is >= 0, it is a common sense for software engineer.

@jiaorenyu jiaorenyu marked this pull request as draft December 4, 2024 05:58
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.

VictoriaMetrics as prometheus.server.endpoint
1 participant