Skip to content

Commit

Permalink
Merge branch 'surprise30-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
czerwonk committed Feb 19, 2025
2 parents e673222 + 563bd03 commit a632ce5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
7 changes: 5 additions & 2 deletions collectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
package main

import (
"github.com/czerwonk/junos_exporter/pkg/features/poe"
"regexp"

"github.com/czerwonk/junos_exporter/pkg/features/ddosprotection"
"github.com/czerwonk/junos_exporter/pkg/features/poe"

"github.com/czerwonk/junos_exporter/internal/config"
"github.com/czerwonk/junos_exporter/pkg/collector"
"github.com/czerwonk/junos_exporter/pkg/connector"
Expand All @@ -14,7 +16,6 @@ import (
"github.com/czerwonk/junos_exporter/pkg/features/arp"
"github.com/czerwonk/junos_exporter/pkg/features/bfd"
"github.com/czerwonk/junos_exporter/pkg/features/bgp"
"github.com/czerwonk/junos_exporter/pkg/features/ddosprotection"
"github.com/czerwonk/junos_exporter/pkg/features/environment"
"github.com/czerwonk/junos_exporter/pkg/features/firewall"
"github.com/czerwonk/junos_exporter/pkg/features/fpc"
Expand All @@ -28,6 +29,7 @@ import (
"github.com/czerwonk/junos_exporter/pkg/features/lacp"
"github.com/czerwonk/junos_exporter/pkg/features/ldp"
"github.com/czerwonk/junos_exporter/pkg/features/mac"
"github.com/czerwonk/junos_exporter/pkg/features/macsec"
"github.com/czerwonk/junos_exporter/pkg/features/mplslsp"
"github.com/czerwonk/junos_exporter/pkg/features/nat"
"github.com/czerwonk/junos_exporter/pkg/features/nat2"
Expand Down Expand Up @@ -123,6 +125,7 @@ func (c *collectors) initCollectorsForDevices(device *connector.Device, descRe *
c.addCollectorIfEnabledForDevice(device, "macsec", f.MACSec, macsec.NewCollector)
c.addCollectorIfEnabledForDevice(device, "arp", f.ARP, arp.NewCollector)
c.addCollectorIfEnabledForDevice(device, "poe", f.Poe, poe.NewCollector)
c.addCollectorIfEnabledForDevice(device, "ddosprotection", f.DDOSProtection, ddosprotection.NewCollector)
}

func (c *collectors) addCollectorIfEnabledForDevice(device *connector.Device, key string, enabled bool, newCollector func() collector.RPCCollector) {
Expand Down
2 changes: 0 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import (
"go.opentelemetry.io/otel/codes"

log "github.com/sirupsen/logrus"

"github.com/czerwonk/junos_exporter/internal/config"
)

const version string = "0.13.0"
Expand Down
13 changes: 3 additions & 10 deletions pkg/features/macsec/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
package macsec

import (
"strconv"
"strings"

"github.com/czerwonk/junos_exporter/pkg/collector"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
log "github.com/sirupsen/logrus"
"strconv"
"strings"
)

const prefix string = "junos_macsec_"
Expand All @@ -20,14 +21,6 @@ var (
macsecReplayProtectDesc *prometheus.Desc
macsecKeyServerOffsetDesc *prometheus.Desc
macsecEncryptionDesc *prometheus.Desc
//macsecConnectionDesc
macsecTXPacketCountDesc *prometheus.Desc
macsecTXChannelStatusDesc *prometheus.Desc
macsecIncludeSCIDesc *prometheus.Desc
macsecReplayProtectDesc *prometheus.Desc
macsecKeyServerOffsetDesc *prometheus.Desc
macsecEncryptionDesc *prometheus.Desc
//macsecStatsDesc
macsecSecureChannelTXEncryptedPacketsDesc *prometheus.Desc
macsecSecureChannelTXEncryptedBytessDesc *prometheus.Desc
macsecSecureChannelTXProtectedPacketsDesc *prometheus.Desc
Expand Down

0 comments on commit a632ce5

Please sign in to comment.