Skip to content

Commit

Permalink
genconfig.py: handle multi-dc with ipv6 correctly
Browse files Browse the repository at this point in the history
when passing ipv6 addresses to `genconfig.py` with
-dc options, the code was incorrectly picking only
part of address, and it failing to collect metrics
like that

```bash
❯ python3 genconfig.py -s -n -dc eu-west-1:[2a05:d018:12e3:f000:65d7:d0a7:3871:fca4],[2a05:d018:12e3:f000:be9f:dc4c:b0b2:7a0d],[2a05:d018:12e3:f000:7f60:4628:db83:cac0],[2a05:d018:
12e3:f000:b7a6:2245:2a8f:4e3f],[2a05:d018:12e3:f000:705f:58c0:ee63:9a55],[2a05:d018:12e3:f000:7214:6f2f:35e5:8b60]

❯ cat scylla_servers.yml
- labels:
    cluster: my-cluster
    dc: eu-west-1
  targets:
  - '[2a05'
```

(cherry picked from commit 0d67b92)
  • Loading branch information
fruch authored and amnonh committed Aug 5, 2024
1 parent 45b859f commit a2cd120
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion genconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def gen_targets(servers, cluster):
if ':' not in servers:
raise Exception('Server list must contain a dc name')
dcs = servers.split(':')
dcs = servers.split(':', maxsplit=1)
res = {"labels": {"cluster": cluster, "dc": dcs[0]}}
res["targets"] = dcs[1].split(',')
return res;
Expand Down

0 comments on commit a2cd120

Please sign in to comment.