Skip to content

Commit 39dcf1d

Browse files
author
CHamburr
committed
fix(bot): fix prometheus missing cluster
1 parent f0d559e commit 39dcf1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ async def handler(self, request):
287287
def write_targets(self):
288288
data = []
289289

290-
for i in range(len(self.instances)):
291-
data.append({"labels": {"cluster": str(i)}, "targets": [f"localhost:{6100 + i}"]})
292290
data.append({"labels": {"cluster": "0"}, "targets": ["localhost:6100"]})
291+
for i in range(1, len(self.instances) + 1):
292+
data.append({"labels": {"cluster": str(i)}, "targets": [f"localhost:{6100 + i}"]})
293293

294294
with open("targets.json", "w") as file:
295295
json.dump(data, file, indent=2)

0 commit comments

Comments
 (0)