mirror of
https://github.com/alexbers/mtprotoproxy.git
synced 2026-03-22 02:25:49 +00:00
do not export proxy links by default
This commit is contained in:
@@ -232,6 +232,9 @@ def init_config():
|
|||||||
# prometheus scrapers whitelist
|
# prometheus scrapers whitelist
|
||||||
conf_dict.setdefault("METRICS_WHITELIST", ["127.0.0.1", "::1"])
|
conf_dict.setdefault("METRICS_WHITELIST", ["127.0.0.1", "::1"])
|
||||||
|
|
||||||
|
# export proxy link to prometheus
|
||||||
|
conf_dict.setdefault("METRICS_EXPORT_LINKS", False)
|
||||||
|
|
||||||
# allow access to config by attributes
|
# allow access to config by attributes
|
||||||
config = type("config", (dict,), conf_dict)(conf_dict)
|
config = type("config", (dict,), conf_dict)(conf_dict)
|
||||||
|
|
||||||
@@ -1623,10 +1626,12 @@ async def handle_metrics(reader, writer):
|
|||||||
metrics.append(["handshake_timeouts", "counter", "number of timed out handshakes",
|
metrics.append(["handshake_timeouts", "counter", "number of timed out handshakes",
|
||||||
stats["handshake_timeouts"]])
|
stats["handshake_timeouts"]])
|
||||||
|
|
||||||
for link in proxy_links:
|
if config.METRICS_EXPORT_LINKS:
|
||||||
link_as_metric = link.copy()
|
for link in proxy_links:
|
||||||
link_as_metric["val"] = 1
|
link_as_metric = link.copy()
|
||||||
metrics.append(["proxy_link_info", "counter", "the proxy link info", link_as_metric])
|
link_as_metric["val"] = 1
|
||||||
|
metrics.append(["proxy_link_info", "counter",
|
||||||
|
"the proxy link info", link_as_metric])
|
||||||
|
|
||||||
user_metrics_desc = [
|
user_metrics_desc = [
|
||||||
["user_connects", "counter", "user connects", "connects"],
|
["user_connects", "counter", "user connects", "connects"],
|
||||||
|
|||||||
Reference in New Issue
Block a user