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

Refine the hostname backlist in MetricsPrometheus #6784

Merged
merged 6 commits into from
Feb 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion dbms/src/Server/MetricsPrometheus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,16 @@ std::string getInstanceValue(const Poco::Util::AbstractConfiguration & conf)
if (service_addr.empty())
return getHostName();
// "0.0.0.0", "127.x.x.x", "locallhost", "0:0:0:0:0:0:0:0", "0:0:0:0:0:0:0:1", "::", "::1", ":${port}"
SeaRise marked this conversation as resolved.
Show resolved Hide resolved
static const std::vector<std::string> blacklist{"0.0.0.0", "127.", "locallhost", "0:0:0:0:0:0:0", ":"};
static const std::vector<std::string> blacklist{
// ivp4
"0.0.0.0",
"127.",
"locallhost",
SeaRise marked this conversation as resolved.
Show resolved Hide resolved
Lloyd-Pottiger marked this conversation as resolved.
Show resolved Hide resolved
// ipv6
"0:0:0:0:0:0:0",
"[0:0:0:0:0:0:0",
":",
"[:"};
for (const auto & prefix : blacklist)
{
if (startsWith(service_addr, prefix))
Expand Down