Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add l2vpn metrics #247

Closed
wants to merge 54 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5b57d09
Merge pull request #13 from anexia/netdev-517/add-interface-type,-pro…
Gaste8 Aug 3, 2023
217da90
add missing anx-ci
Aug 3, 2023
a5e6129
test
Aug 3, 2023
0e478ca
test s3 creds
Aug 3, 2023
54a5de5
test ci
Aug 3, 2023
a8ff09d
test
Aug 3, 2023
aecbd86
test ci
Aug 3, 2023
5241c51
test
Aug 3, 2023
39a4d68
test
Aug 3, 2023
9b3f72f
remove dry-run
Aug 23, 2023
c38681e
remove Test Folder
Aug 23, 2023
c56bac6
fix upload url
Aug 23, 2023
43d52a6
force push so that it will also upload file if already there
Aug 23, 2023
52f9f1f
netdev-786/collect-subscriber-information
Sep 13, 2023
1a6c2fa
Merge branch 'netdev-786/collect-subscriber-information' into 'anx-prod'
Sep 13, 2023
f65453d
now scrapes interface information to include underlying interfaces fo…
Dec 20, 2023
53535c7
Merge pull request #14 from anexia/NETDEV-1189/underlying-interface
fstolba Jan 3, 2024
0eafc3b
Merge branch 'NETDEV-1189/underlying-interface' into test_master
Jan 10, 2024
39dc782
Merge branch 'master' into NETDEV-1189/underlying-interface
Gaste8 Jan 10, 2024
caf9d00
Merge branch 'NETDEV-1189/underlying-interface' of code.anexia.com:ne…
Jan 10, 2024
4b1264a
fix go build version
Jan 10, 2024
dca3717
fix ci
Jan 10, 2024
d22d294
Delete .github/workflows/anx-ci.yml
Gaste8 Jan 17, 2024
3d89b3e
readd ci
Jan 10, 2024
42950ff
update ci
Feb 14, 2024
cf88de4
fix string hyphens
Feb 14, 2024
74e56e8
remove string
Feb 14, 2024
e875c6c
change build to use debian 11 (try to fix glibc version errror)
Feb 14, 2024
805b751
fix ca-certificates
Feb 14, 2024
d08143d
test out docker image
Feb 14, 2024
698e59b
change to pthon bullseye
Feb 14, 2024
4f83a56
remove vcs information to resolve error
Feb 14, 2024
898ac29
fix buildvcs
Feb 14, 2024
0d57e5e
try with CGO_LDFLAGS
Feb 14, 2024
ca98b20
remove ca
Feb 14, 2024
d1fcc1d
use ubuntu 20.04
Feb 14, 2024
852f9b5
delete linking option
Feb 14, 2024
198d905
finalize ci
Feb 14, 2024
45cc0a8
update anx-prod from upstream and fix ci
Feb 14, 2024
eb29055
Merge branch 'NETDEV-1189/underlying-interface' into 'anx-prod'
Feb 14, 2024
8e3a5ab
update anx-prod from upstream
Gaste8 Feb 14, 2024
6a12898
test prod-ci
Feb 15, 2024
1874a14
readd ci tests
Feb 15, 2024
c4a4f43
Merge branch 'czerwonk:main' into anx-prod
Gaste8 Feb 15, 2024
24ffa83
Merge branch 'czerwonk:main' into anx-prod
Gaste8 Jul 10, 2024
fed0574
feat add l2vpn collector
Jul 10, 2024
6d00a53
fix path and remove print
Jul 10, 2024
7d202dd
fix remove duplicate line
Jul 10, 2024
844916d
Add l2vpn metric
Jul 11, 2024
1ccbe10
Merge branch 'add_l2vpn_metric' into 'anx-prod'
Jul 11, 2024
dd1c279
fix: make numbering of L2VPN status continuous
Jul 11, 2024
c022cb4
fix: rename label from instance to routing_instance
Jul 11, 2024
cdf3a25
fix: numbering of L2VPN statuses
Jul 11, 2024
dfb8efb
Merge branch 'anx-prod' into 'add_l2vpn_metric'
Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix path and remove print
  • Loading branch information
Johannes Müller Aguilar authored and Johannes Müller Aguilar committed Jul 10, 2024
commit 6d00a53842fbae04ce04e15e260072acc0775e26
9 changes: 4 additions & 5 deletions pkg/features/l2vpn/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import (
"strings"
"time"

"github.com/czerwonk/junos_exporter/collector"
"github.com/czerwonk/junos_exporter/rpc"
"github.com/czerwonk/junos_exporter/pkg/collector"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down Expand Up @@ -67,6 +66,7 @@ func init() {
type l2vpnCollector struct {
}

// NewCollector creates a new collector
// NewCollector creates a new collector
func NewCollector() collector.RPCCollector {
return &l2vpnCollector{}
Expand All @@ -84,11 +84,11 @@ func (*l2vpnCollector) Describe(ch chan<- *prometheus.Desc) {
}

// Collect collects metrics from JunOS
func (c *l2vpnCollector) Collect(client *rpc.Client, ch chan<- prometheus.Metric, labelValues []string) error {
func (c *l2vpnCollector) Collect(client collector.Client, ch chan<- prometheus.Metric, labelValues []string) error {
return c.collectl2vpnMetrics(client, ch, labelValues)
}

func (c *l2vpnCollector) collectl2vpnMetrics(client *rpc.Client, ch chan<- prometheus.Metric, labelValues []string) error {
func (c *l2vpnCollector) collectl2vpnMetrics(client collector.Client, ch chan<- prometheus.Metric, labelValues []string) error {
var x = l2vpnRpc{}
err := client.RunCommandAndParse("show l2vpn connections", &x)
if err != nil {
Expand Down Expand Up @@ -144,6 +144,5 @@ func string_to_date(date string) string {
if err != nil {
return ""
}
println(t.Unix())
return strconv.FormatInt(t.Unix(), 10)
}