mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
Send netid to metrictank
This commit is contained in:
parent
fd20b33064
commit
fedf6cb8e0
|
@ -118,6 +118,14 @@ namespace llarp
|
||||||
if(singleThreaded)
|
if(singleThreaded)
|
||||||
num_nethreads = 0;
|
num_nethreads = 0;
|
||||||
}
|
}
|
||||||
|
else if(!strcmp(key, "netid"))
|
||||||
|
{
|
||||||
|
metricTags["netid"] = val;
|
||||||
|
}
|
||||||
|
else if(!strcmp(key, "nickname"))
|
||||||
|
{
|
||||||
|
metricTags["nickname"] = val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!strcmp(section, "netdb"))
|
if(!strcmp(section, "netdb"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -124,6 +124,10 @@ namespace llarp
|
||||||
absl::StrAppend(&tagStr, ";", tag.first, "=",
|
absl::StrAppend(&tagStr, ";", tag.first, "=",
|
||||||
absl::visit(overloaded, tag.second));
|
absl::visit(overloaded, tag.second));
|
||||||
}
|
}
|
||||||
|
if(!tags.empty())
|
||||||
|
{
|
||||||
|
absl::StrAppend(&tagStr, ";");
|
||||||
|
}
|
||||||
return tagStr;
|
return tagStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,26 +340,6 @@ namespace llarp
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tags.count("user") == 0)
|
|
||||||
{
|
|
||||||
#ifndef _WIN32
|
|
||||||
const char *username = getlogin();
|
|
||||||
if(username != nullptr)
|
|
||||||
{
|
|
||||||
tags["user"] = username;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tags["user"] = "unknown";
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
char username[UNLEN + 1];
|
|
||||||
DWORD username_len = UNLEN + 1;
|
|
||||||
GetUserName(username, &username_len);
|
|
||||||
tags["user"] = username;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
Loading…
Reference in a new issue