Skip to content

Commit

Permalink
Turning prom from add to set
Browse files Browse the repository at this point in the history
  • Loading branch information
i3149 committed Nov 8, 2023
1 parent 728f362 commit c631ea8
Show file tree
Hide file tree
Showing 2 changed files with 187 additions and 2 deletions.
185 changes: 185 additions & 0 deletions config/udr.csv
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,191 @@
12,INT64_00,CPU,SNMP Device Metrics
12,i_device_site_name,Site,SNMP Device Metrics
12,i_device_name,Device,SNMP Device Metrics
13,INET_00,Peer IP,Route Updates
13,INT02,AFI,Route Updates
13,INT03,SAFI,Route Updates
13,INT04,Update Type,Route Updates
13,INET_01,Route Prefix,Route Updates
13,INT05,Prefix Length,Route Updates
13,INT06,Origin,Route Updates
13,INET_02,Next Hop IP,Route Updates
13,STR05,Communities,Route Updates
13,STR06,Extended Communities,Route Updates
13,src_bgp_aspath,AS Path,Route Updates
13,INT07,AS Path Length,Route Updates
13,dst_bgp_aspath,AS Path (Cleaned),Route Updates
13,INT08,AS Path Length (Cleaned),Route Updates
13,dst_as,AS Path Hop Number: R0 (Origin ASN),Route Updates
13,dst_nexthop_as,AS Path Hop Number: R1,Route Updates
13,dst_second_asn,AS Path Hop Number: R2,Route Updates
13,dst_third_asn,AS Path Hop Number: R3,Route Updates
13,i_dst_as_name,AS Path Hop Name: R0 (Origin ASN),Route Updates
13,i_dst_nexthop_as_name,AS Path Hop Name: R1,Route Updates
13,i_dst_second_asn_name,AS Path Hop Name: R2,Route Updates
13,i_dst_third_asn_name,AS Path Hop Name: R3,Route Updates
13,src_as,AS Path Hop Number: L0,Route Updates
13,src_nexthop_as,AS Path Hop Number: L1,Route Updates
13,src_second_asn,AS Path Hop Number: L2,Route Updates
13,src_third_asn,AS Path Hop Number: L3,Route Updates
13,i_src_as_name,AS Path Hop Name: L0,Route Updates
13,i_src_nexthop_as_name,AS Path Hop Name: L1,Route Updates
13,i_src_second_asn_name,AS Path Hop Name: L2,Route Updates
13,i_src_third_asn_name,AS Path Hop Name: L3,Route Updates
13,dst_rpki,RPKI Status,Route Updates
13,INT64_03,Announcements,Route Updates
13,INT64_04,Withdrawals,Route Updates
13,INT64_06,RIB Entries,Route Updates
13,INT64_07,State Syncs,Route Updates
14,INT06,Usage Irq,Host CPU Metrics
14,INT04,Usage Nice,Host CPU Metrics
14,INT03,Usage Active,Host CPU Metrics
14,INT07,Usage Softirq,Host CPU Metrics
14,INT08,Usage Steal,Host CPU Metrics
14,INT02,Usage Idle,Host CPU Metrics
14,INT01,Usage System,Host CPU Metrics
14,INT00,Usage User,Host CPU Metrics
14,INT09,Usage Guest,Host CPU Metrics
14,INT64_00,Usage Guest Nice,Host CPU Metrics
14,STR01,Host,Host CPU Metrics
14,STR00,CPU,Host CPU Metrics
14,INT05,Usage Iowait,Host CPU Metrics
15,INT02,Used Percent,Host Memory Metrics
15,INT04,Available Percent,Host Memory Metrics
15,INT64_03,Available,Host Memory Metrics
15,INT64_00,Total,Host Memory Metrics
15,INT64_01,Used,Host Memory Metrics
17,INT64_02,Bits/s Out (Primary Peer),Express Route Metrics
17,INT64_00,Timestamp,Express Route Metrics
17,INT01,Provider Bandwidth (Mbps),Express Route Metrics
17,INT00,Measurement Duration,Express Route Metrics
17,STR02,Express Route Circuit Peering Name,Express Route Metrics
17,INT64_01,Bits/s In (Primary Peer),Express Route Metrics
17,INT64_03,Bits/s In (Secondary Peer),Express Route Metrics
17,STR00,Measurement Name,Express Route Metrics
17,STR01,Express Route Circuit Name,Express Route Metrics
17,INT64_04,Bits/s Out (Secondary Peer),Express Route Metrics
18,INT06,Status,Syngest
18,STR01,Other Health,Syngest
18,INET_00,Dest Ip,Syngest
18,km_float000,Packet Loss,Syngest
18,STR00,Health Data,Syngest
18,STR02,Metadata,Syngest
18,INT64_00,Timestamp,Syngest
18,INT64_01,Agent Id,Syngest
18,INT64_02,Task Id,Syngest
18,INT64_03,Test Id,Syngest
18,INT64_04,Aggregate Interval,Syngest
18,INT64_05,Rolling Avg Latency,Syngest
18,INT64_06,Rolling StdDev Latency,Syngest
18,INT64_07,Rolling Avg Weighted Latency,Syngest
18,INT64_08,Rolling Avg Jitter,Syngest
18,INT64_09,Rolling StdDev Jitter,Syngest
18,INT00,Health Moment Task Type,Syngest
18,INT01,Configured Task Type,Syngest
18,INT02,Avg Latency,Syngest
18,INT03,Avg Weighted Latency,Syngest
18,INT04,Avg Jitter,Syngest
18,INT05,Size,Syngest
18,INT07,Latency Health,Syngest
18,INT08,Packet Loss Health,Syngest
18,INT09,Jitter Health,Syngest
19,INT00,Max Sessions Supportable,Cisco RAS Monitorings
19,INT06,Email Num Sessions,Cisco RAS Monitorings
19,INT07,IPSec Sessions,Cisco RAS Monitorings
19,INT08,L2L Num Sessions,Cisco RAS Monitorings
19,INT09,LB Num Sessions,Cisco RAS Monitorings
19,INT64_00,Num Sessions,Cisco RAS Monitorings
19,INT64_01,Num Users,Cisco RAS Monitorings
19,INT64_02,Num Groups,Cisco RAS Monitorings
19,INT64_03,Global In Packets,Cisco RAS Monitorings
19,INT64_04,Global Out Packets,Cisco RAS Monitorings
19,INT64_05,Global In Octets,Cisco RAS Monitorings
19,INT64_06,Global Out Octets,Cisco RAS Monitorings
19,INT64_07,Global In Drop Packets,Cisco RAS Monitorings
19,INT64_08,Global Out Drop Packets,Cisco RAS Monitorings
19,INT64_09,SVC Num Sessions,Cisco RAS Monitorings
19,INT04,Webvpn Num Sessions,Cisco RAS Monitorings
19,i_device_name,Device Name,Cisco RAS Monitorings
19,INT03,SVC Peak Concurrent Sessions,Cisco RAS Monitorings
19,INT05,Webvpn Peak Concurrent Sessions,Cisco RAS Monitorings
19,INT02,Max Groups Supportable,Cisco RAS Monitorings
19,INT01,Max Users Supportable,Cisco RAS Monitorings
20,INT64_01,Disk Read OPS,AWS EC2 Metrics
20,STR00,Instance ID,AWS EC2 Metrics
20,STR01,Instance Type,AWS EC2 Metrics
20,STR02,Image ID,AWS EC2 Metrics
20,STR03,Auto Scaling Group,AWS EC2 Metrics
20,STR04,Region,AWS EC2 Metrics
20,INT00,CPU,AWS EC2 Metrics
20,INT64_00,Disk Read Bytes,AWS EC2 Metrics
20,INT64_02,Disk Write Bytes,AWS EC2 Metrics
20,INT64_03,Disk Write OPS,AWS EC2 Metrics
20,INT64_04,Metadata No Token,AWS EC2 Metrics
20,INT64_05,Network In,AWS EC2 Metrics
20,INT64_06,Network Out,AWS EC2 Metrics
20,INT64_07,Network Packets In,AWS EC2 Metrics
20,INT64_08,Network Packets Out,AWS EC2 Metrics
20,INT01,Status Check Failed,AWS EC2 Metrics
20,INT02,Status Check Failed Instance,AWS EC2 Metrics
20,INT03,Status Check Failed System,AWS EC2 Metrics
20,INT04,CPU Credit Balance,AWS EC2 Metrics
20,INT05,CPU Credit Usage,AWS EC2 Metrics
20,INT06,CPU Surplus Credit Balance,AWS EC2 Metrics
20,INT07,CPU Surplus Credit Charged,AWS EC2 Metrics
21,INT02,Healthy Host Count Average,AWS ELB Metrics
21,STR00,Load Balancer,AWS ELB Metrics
21,STR01,Availability Zone,AWS ELB Metrics
21,INT01,Latency Maximum,AWS ELB Metrics
21,INT00,Latency Average,AWS ELB Metrics
21,STR03,Service,AWS ELB Metrics
21,STR02,Region,AWS ELB Metrics
21,INT09,Surge Queue Length Maximum,AWS ELB Metrics
21,INT64_00,Backend Connection Errors Sum,AWS ELB Metrics
21,INT64_01,http code backend 2xx Sum,AWS ELB Metrics
21,INT64_02,http code backend 3xx Sum,AWS ELB Metrics
21,INT64_03,http code backend 4xx Sum,AWS ELB Metrics
21,INT64_04,http code backend 5xx Sum,AWS ELB Metrics
21,INT64_05,http code elb 4xx Sum,AWS ELB Metrics
21,INT64_06,http code elb 5xx Sum,AWS ELB Metrics
21,INT03,Healthy Host Count Maximum,AWS ELB Metrics
21,INT04,Unhealthy Host Count Average,AWS ELB Metrics
21,INT05,Unhealthy Host Count Minimum,AWS ELB Metrics
21,INT06,Request Count Sum,AWS ELB Metrics
21,INT07,Desync Mitigation Mode Non Compliant Request Count Sum,AWS ELB Metrics
21,INT08,Spill Over Count Sum,AWS ELB Metrics
22,INT01,Tunnel State Sample Count,AWS VPN Metrics
22,STR00,VPN,AWS VPN Metrics
22,STR01,Tunnel IP Address,AWS VPN Metrics
22,STR02,Region,AWS VPN Metrics
22,INT64_00,Tunnel Data In,AWS VPN Metrics
22,INT64_01,Tunnel Data Out,AWS VPN Metrics
22,INT00,Tunnel State Sum,AWS VPN Metrics
23,INT64_03,Bytes Out To Source,AWS NAT Gateway Metrics
23,STR00,NAT Gateway,AWS NAT Gateway Metrics
23,INT64_04,Packets Drop Count,AWS NAT Gateway Metrics
23,INT00,Active Connection Count,AWS NAT Gateway Metrics
23,INT01,Connection Established Count,AWS NAT Gateway Metrics
23,INT64_05,Packets In From Destination,AWS NAT Gateway Metrics
23,INT02,Connection Attempt Count,AWS NAT Gateway Metrics
23,INT03,Error Port Allocation,AWS NAT Gateway Metrics
23,INT04,Idle Timeout Count,AWS NAT Gateway Metrics
23,INT64_00,Bytes In From Destination,AWS NAT Gateway Metrics
23,INT64_01,Bytes In From Source,AWS NAT Gateway Metrics
23,INT64_02,Bytes Out To Destination,AWS NAT Gateway Metrics
23,STR01,Region,AWS NAT Gateway Metrics
23,INT64_08,Packets Out To Source,AWS NAT Gateway Metrics
23,INT64_07,Packets Out To Destination,AWS NAT Gateway Metrics
23,INT64_06,Packets In From Source,AWS NAT Gateway Metrics
24,INT64_07,Packet Drop Count Blackhole,AWS Transit Gateway Metrics
24,INT64_06,Packet Drop Count No Route,AWS Transit Gateway Metrics
24,INT64_05,Bytes Drop Count Blackhole,AWS Transit Gateway Metrics
24,INT64_04,Bytes Drop Count No Route,AWS Transit Gateway Metrics
24,INT64_03,Packets Out,AWS Transit Gateway Metrics
24,INT64_02,Packets In,AWS Transit Gateway Metrics
24,INT64_01,Bytes Out,AWS Transit Gateway Metrics
24,INT64_00,Bytes In,AWS Transit Gateway Metrics
24,STR01,Transit Gateway Attachment,AWS Transit Gateway Metrics
24,STR00,Transit Gateway,AWS Transit Gateway Metrics
0,INT00,ICMP Type,paloalto
0,INT64_00,Flow ID,paloalto
0,INT02,Post-NAT Source Transport Port,paloalto
Expand Down
4 changes: 2 additions & 2 deletions pkg/formats/prom/prom.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (f *PromFormat) To(msgs []*kt.JCHF, serBuf []byte) (*kt.Output, error) {
f.Infof("Adding %s %v", m.Name, labels)
}
//f.Infof("%s, %v, %v %v", m.Name, m.Tags, f.vecTags[m.Name], f.toLabels(m.Name))
f.vecs[m.Name].WithLabelValues(m.GetTagValues(f.vecTags)...).Add(m.Value)
f.vecs[m.Name].WithLabelValues(m.GetTagValues(f.vecTags)...).Set(m.Value)
}

return nil, nil
Expand All @@ -171,7 +171,7 @@ func (f *PromFormat) Rollup(rolls []rollup.Rollup) (*kt.Output, error) {
)
prometheus.MustRegister(f.vecs[roll.EventType])
}
f.vecs[roll.EventType].WithLabelValues(strings.Split(roll.Dimension, roll.KeyJoin)...).Add(float64(roll.Metric))
f.vecs[roll.EventType].WithLabelValues(strings.Split(roll.Dimension, roll.KeyJoin)...).Set(float64(roll.Metric))
}

return nil, nil
Expand Down

0 comments on commit c631ea8

Please sign in to comment.