Skip to content

Commit

Permalink
Merge pull request #22 from tynany/update_go_1_22
Browse files Browse the repository at this point in the history
Update go to 1.22
  • Loading branch information
tynany authored Sep 8, 2024
2 parents 49ac959 + c796205 commit 7f4c6e2
Show file tree
Hide file tree
Showing 835 changed files with 91 additions and 288,693 deletions.
5 changes: 1 addition & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ executors:
golang:
docker:
# Whenever the Go version is updated here, .promu.yml, Dockerfile and line 6 of this file should also be updated.
- image: circleci/golang:1.13
- image: cimg/go:1.22
jobs:
test:
working_directory: /go/src/github.com/tynany/junos_exporter
executor: golang
steps:
- checkout
- run: make test
build:
working_directory: /go/src/github.com/tynany/junos_exporter
executor: golang
steps:
- checkout
Expand All @@ -22,7 +20,6 @@ jobs:
- run: ./promu crossbuild tarballs
- run: ./promu checksum .tarballs
release:
working_directory: /go/src/github.com/tynany/junos_exporter
executor: golang
steps:
- checkout
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.13
go-version: 1.22
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.45.2
version: v1.60.3
2 changes: 1 addition & 1 deletion .promu.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
go:
# Whenever the Go version is updated here, .circle/config.yml should also be updated.
version: 1.13
version: 1.22
repository:
path: github.com/tynany/junos_exporter
build:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROMU_VERSION := 0.6.1
PROMU_VERSION := 0.17.0

setup_promu:
curl -s -L https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).linux-amd64.tar.gz | tar -xvzf -
Expand Down
96 changes: 53 additions & 43 deletions collector/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func getInterfaceDesc(ifaceDescrKeys, ifaceMetricKeys []string) map[string]*prom
ifaceDesc["InterfaceDescription"] = colPromDesc(ifaceSubsystem, "description", "Interface description keys", append([]string{"interface"}, ifaceDescrKeys...))
}
for _, metricKey := range ifaceMetricKeys {
ifaceDesc[metricKey] = colPromDesc(ifaceSubsystem, strings.ToLower(metricKey), "User-defined Metric from Description Key", append([]string{"interface"}))
ifaceDesc[metricKey] = colPromDesc(ifaceSubsystem, strings.ToLower(metricKey), "User-defined Metric from Description Key", []string{"interface"})
}
return ifaceDesc
}
Expand Down Expand Up @@ -203,7 +203,9 @@ func (c *InterfaceCollector) Get(ch chan<- prometheus.Metric, conf Config) ([]er

func (c *BoolIfPresent) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
var v string
d.DecodeElement(&v, &start)
if err := d.DecodeElement(&v, &start); err != nil {
return err
}
*c = true
return nil
}
Expand Down Expand Up @@ -314,7 +316,7 @@ func processIfaceNetconfReply(reply *netconf.RPCReply, ch chan<- prometheus.Metr
if err := json.Unmarshal([]byte(logIface.Description.Text), &allIfaceDescrKeys); err != nil {
allIfaceDescrKeys = nil
}
if logIface.IfConfigFlags.IffUp == true {
if logIface.IfConfigFlags.IffUp {
ch <- prometheus.MustNewConstMetric(ifaceDesc["Up"], prometheus.GaugeValue, 1.0, logIfaceLabels...)
} else {
ch <- prometheus.MustNewConstMetric(ifaceDesc["Up"], prometheus.GaugeValue, 0.0, logIfaceLabels...)
Expand Down Expand Up @@ -667,12 +669,14 @@ type BoolIfPresent bool
type ifaceConfigFlags struct {
IffUp BoolIfPresent `xml:"iff-up"`
}
type ifaceLogicalLocalTrafficStats struct {
InputBytes ifaceText `xml:"input-bytes"`
OutputBytes ifaceText `xml:"output-bytes"`
InputPackets ifaceText `xml:"input-packets"`
OutputPackets ifaceText `xml:"output-packets"`
}

// Leaving the below as it may be implemented in the future
// type ifaceLogicalLocalTrafficStats struct {
// InputBytes ifaceText `xml:"input-bytes"`
// OutputBytes ifaceText `xml:"output-bytes"`
// InputPackets ifaceText `xml:"input-packets"`
// OutputPackets ifaceText `xml:"output-packets"`
// }

type ifaceInOutBytesPkts struct {
InputBytes ifaceText `xml:"input-bytes"`
Expand All @@ -689,16 +693,17 @@ type ifaceInOutBytesPktsV6 struct {
Ipv6TransitStatistics ifaceInOutBytesPkts `xml:"ipv6-transit-statistics"`
}

type ifaceInOutBytesPktsBPSPPS struct {
InputBytes ifaceText `xml:"input-bytes"`
OutputBytes ifaceText `xml:"output-bytes"`
InputPackets ifaceText `xml:"input-packets"`
OutputPackets ifaceText `xml:"output-packets"`
InputBps ifaceText `xml:"input-bps"`
OutputBps ifaceText `xml:"output-bps"`
InputPps ifaceText `xml:"input-pps"`
OutputPps ifaceText `xml:"output-pps"`
}
// Leaving the below as it may be implemented in the future
// type ifaceInOutBytesPktsBPSPPS struct {
// InputBytes ifaceText `xml:"input-bytes"`
// OutputBytes ifaceText `xml:"output-bytes"`
// InputPackets ifaceText `xml:"input-packets"`
// OutputPackets ifaceText `xml:"output-packets"`
// InputBps ifaceText `xml:"input-bps"`
// OutputBps ifaceText `xml:"output-bps"`
// InputPps ifaceText `xml:"input-pps"`
// OutputPps ifaceText `xml:"output-pps"`
// }

type ifaceInOutBytesPktsBPSPPSV6 struct {
InputBytes ifaceText `xml:"input-bytes"`
Expand All @@ -712,13 +717,14 @@ type ifaceInOutBytesPktsBPSPPSV6 struct {
Ipv6TransitStatistics ifaceInOutBytesPkts `xml:"ipv6-transit-statistics"`
}

type ifaceLogicalTrafficStats struct {
InputBytes ifaceText `xml:"input-bytes"`
OutputBytes ifaceText `xml:"output-bytes"`
InputPackets ifaceText `xml:"input-packets"`
OutputPackets ifaceText `xml:"output-packets"`
Ipv6TransitStatistics ifaceInOutBytesPkts `xml:"ipv6-transit-statistics"`
}
// Leaving the below as it may be implemented in the future
// type ifaceLogicalTrafficStats struct {
// InputBytes ifaceText `xml:"input-bytes"`
// OutputBytes ifaceText `xml:"output-bytes"`
// InputPackets ifaceText `xml:"input-packets"`
// OutputPackets ifaceText `xml:"output-packets"`
// Ipv6TransitStatistics ifaceInOutBytesPkts `xml:"ipv6-transit-statistics"`
// }

type ifaceLAGTrafficStats struct {
LagBundle ifaceInOutBytesPktsBPSPPSV6 `xml:"lag-bundle"`
Expand Down Expand Up @@ -749,24 +755,28 @@ type ifaceInputErrorList struct {
InputL2MismatchTimeouts ifaceText `xml:"input-l2-mismatch-timeouts"`
InputFifoErrors ifaceText `xml:"input-fifo-errors"`
}
type ifaceTrafficStats struct {
InputBytes ifaceText `xml:"input-bytes"`
OutputBytes ifaceText `xml:"output-bytes"`
InputPackets ifaceText `xml:"input-packets"`
OutputPackets ifaceText `xml:"output-packets"`
InputBps ifaceText `xml:"input-bps"`
OutputBps ifaceText `xml:"output-bps"`
InputPps ifaceText `xml:"input-pps"`
OutputPps ifaceText `xml:"output-pps"`
Ipv6TransitStatistics ifaceIPv6TransitStats `xml:"ipv6-transit-statistics"`
}

type ifaceIPv6TransitStats struct {
InputBytes ifaceText `xml:"input-bytes"`
OutputBytes ifaceText `xml:"output-bytes"`
InputPackets ifaceText `xml:"input-packets"`
OutputPackets ifaceText `xml:"output-packets"`
}
// Leaving the below as it may be implemented in the future

// type ifaceTrafficStats struct {
// InputBytes ifaceText `xml:"input-bytes"`
// OutputBytes ifaceText `xml:"output-bytes"`
// InputPackets ifaceText `xml:"input-packets"`
// OutputPackets ifaceText `xml:"output-packets"`
// InputBps ifaceText `xml:"input-bps"`
// OutputBps ifaceText `xml:"output-bps"`
// InputPps ifaceText `xml:"input-pps"`
// OutputPps ifaceText `xml:"output-pps"`
// Ipv6TransitStatistics ifaceIPv6TransitStats `xml:"ipv6-transit-statistics"`
// }

// Leaving the below as it may be implemented in the future
// type ifaceIPv6TransitStats struct {
// InputBytes ifaceText `xml:"input-bytes"`
// OutputBytes ifaceText `xml:"output-bytes"`
// InputPackets ifaceText `xml:"input-packets"`
// OutputPackets ifaceText `xml:"output-packets"`
// }

type ifaceText struct {
Text string `xml:",chardata"`
Expand Down
7 changes: 4 additions & 3 deletions collector/power.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ type powerText struct {
Text string `xml:",chardata"`
}

type powerTemp struct {
Temp string `xml:"celsius,attr"`
}
// Leaving the below as it may be implemented in the future
// type powerTemp struct {
// Temp string `xml:"celsius,attr"`
// }
3 changes: 1 addition & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package config

import (
"fmt"
"io/ioutil"
"os"

"golang.org/x/crypto/ssh"
Expand Down Expand Up @@ -73,7 +72,7 @@ func parseConfig(configuration *Configuration, validCollectors []string) error {
}

if configData.SSHKey != "" {
buf, err := ioutil.ReadFile(configData.SSHKey)
buf, err := os.ReadFile(configData.SSHKey)
if err != nil {
return fmt.Errorf("could not open ssh_key %q in %q configuration: %v", configData.SSHKey, name, err)
}
Expand Down
21 changes: 16 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
module github.com/tynany/junos_exporter

go 1.13
go 1.22

require (
github.com/Juniper/go-netconf v0.1.1
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/common v0.10.0
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.3.0
)

require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.1.3 // indirect
github.com/sirupsen/logrus v1.6.0 // indirect
github.com/ziutek/telnet v0.0.0-20180329124119-c3b780dc415b // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.3.0
)
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
Expand Down Expand Up @@ -45,15 +44,13 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand Down Expand Up @@ -91,7 +88,6 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
Expand Down Expand Up @@ -131,7 +127,6 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -156,7 +151,6 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
Expand Down
33 changes: 12 additions & 21 deletions junos_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"io/ioutil"
"net/http"
"os"
"time"

"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -112,7 +112,10 @@ func handler(w http.ResponseWriter, r *http.Request) {
return
}

registry.Register(ne)
if err := registry.Register(ne); err != nil {
log.Errorf("could not register exporter: %s", err)
return
}

gatherers := prometheus.Gatherers{
prometheus.DefaultGatherer,
Expand All @@ -138,7 +141,7 @@ func generateSSHConfig() error {
User: configData.Username,
}
if configData.SSHKey != "" {
buf, err := ioutil.ReadFile(configData.SSHKey)
buf, err := os.ReadFile(configData.SSHKey)
if err != nil {
return fmt.Errorf("could not open ssh key %q: %s", configData.SSHKey, err)
}
Expand Down Expand Up @@ -168,16 +171,12 @@ func getInterfaceDescriptionKeys() {
var globalIfaceDesc []string
if len(interfaceDescriptionKeys) == 0 {
if len(collectorConfig.Global.InterfaceDescKeys) > 0 {
for _, descrKey := range collectorConfig.Global.InterfaceDescKeys {
globalIfaceDesc = append(globalIfaceDesc, descrKey)
}
globalIfaceDesc = append(globalIfaceDesc, collectorConfig.Global.InterfaceDescKeys...)
}
}
for name, configData := range collectorConfig.Config {
if len(configData.InterfaceDescKeys) > 0 {
for _, descrKey := range configData.InterfaceDescKeys {
interfaceDescriptionKeys[name] = append(interfaceDescriptionKeys[name], descrKey)
}
interfaceDescriptionKeys[name] = append(interfaceDescriptionKeys[name], configData.InterfaceDescKeys...)
} else {
interfaceDescriptionKeys[name] = globalIfaceDesc
}
Expand All @@ -188,16 +187,12 @@ func getInterfaceMetricKeys() {
var globalIfaceMetrics []string
if len(interfaceMetricKeys) == 0 {
if len(collectorConfig.Global.InterfaceMetricKeys) > 0 {
for _, descrKey := range collectorConfig.Global.InterfaceMetricKeys {
globalIfaceMetrics = append(globalIfaceMetrics, descrKey)
}
globalIfaceMetrics = append(globalIfaceMetrics, collectorConfig.Global.InterfaceMetricKeys...)
}
}
for name, configData := range collectorConfig.Config {
if len(configData.InterfaceMetricKeys) > 0 {
for _, metricKey := range configData.InterfaceMetricKeys {
interfaceMetricKeys[name] = append(interfaceMetricKeys[name], metricKey)
}
interfaceMetricKeys[name] = append(interfaceMetricKeys[name], configData.InterfaceMetricKeys...)
} else {
interfaceMetricKeys[name] = globalIfaceMetrics
}
Expand All @@ -208,16 +203,12 @@ func getBGPTypeKeys() {
var globalBGPTypeKeys []string
if len(bgpTypeKeys) == 0 {
if len(collectorConfig.Global.BGPTypeKeys) > 0 {
for _, descrKey := range collectorConfig.Global.BGPTypeKeys {
globalBGPTypeKeys = append(globalBGPTypeKeys, descrKey)
}
globalBGPTypeKeys = append(globalBGPTypeKeys, collectorConfig.Global.BGPTypeKeys...)
}
}
for name, configData := range collectorConfig.Config {
if len(configData.BGPTypeKeys) > 0 {
for _, metricKey := range configData.BGPTypeKeys {
bgpTypeKeys[name] = append(bgpTypeKeys[name], metricKey)
}
bgpTypeKeys[name] = append(bgpTypeKeys[name], configData.BGPTypeKeys...)
} else {
bgpTypeKeys[name] = globalBGPTypeKeys
}
Expand Down
Loading

0 comments on commit 7f4c6e2

Please sign in to comment.