housepower / clickhouse_sinker

Easily load data from kafka to ClickHouse
https://housepower.github.io/clickhouse_sinker
Apache License 2.0
516 stars 118 forks source link

打开普罗米修斯监控,出现unknown #45

Closed ycg closed 4 years ago

ycg commented 4 years ago

clickhouse_sinker_parse_timespan{instance="unknown",job="clickhouse_sinker",task="rta_11",quantile="0.5"} 4.34e-07

主机是阿里云ECS,这个可以解决吗

ycg commented 4 years ago

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:16:3e:16:c5:c3 brd ff:ff:ff:ff:ff:ff inet 192.168.0.XXX/24 brd 192.168.0.255 scope global dynamic eth0 valid_lft 312342259sec preferred_lft 312342259sec

if ip4 := ip.To4(); ip4 != nil {
    switch {
    case ip4[0] == 10:
        return false
    case ip4[0] == 172 && ip4[1] >= 16 && ip4[1] <= 31:
        return false
    case ip4[0] == 192 && ip4[1] == 168:
        return false
    default:
        return true
    }
}

我看代码是吧192.168给排除掉了,是这个意思吗

ycg commented 4 years ago

case ip4[0] == 192 && ip4[1] == 168: return false

目前注释这两行,然后编译解决,😄

sundy-li commented 4 years ago

因为排除了本地网卡