fix(gnmic): preserve full OpenConfig path-based metric names
Changes: - Remove path-base transform that was stripping metric names to just leaf elements - Change VXLAN subscription from on_change to sample mode (30s interval) to ensure consistent metric collection - Remove unused event-processors from Prometheus output - Clean up processor configuration This fixes metric naming to match Grafana dashboard expectations: - Before: gnmic_interfaces_out_octets - After: gnmic_interfaces_interface_state_counters_out_octets The full path names provide better clarity and match standard OpenConfig metric naming conventions used in dashboards.
This commit is contained in:
@@ -12,9 +12,9 @@
|
|||||||
# gnmic -a 172.16.0.25:6030 -u admin -p admin --insecure \
|
# gnmic -a 172.16.0.25:6030 -u admin -p admin --insecure \
|
||||||
# get --path /interfaces/interface[name=Vxlan1]
|
# get --path /interfaces/interface[name=Vxlan1]
|
||||||
|
|
||||||
# ============================================================================
|
# ===========================================================================
|
||||||
# Global settings
|
# Global settings
|
||||||
# ============================================================================
|
# ===========================================================================
|
||||||
username: admin
|
username: admin
|
||||||
password: admin
|
password: admin
|
||||||
insecure: true
|
insecure: true
|
||||||
@@ -24,9 +24,9 @@ debug: false
|
|||||||
timeout: 30s
|
timeout: 30s
|
||||||
retry: 10s
|
retry: 10s
|
||||||
|
|
||||||
# ============================================================================
|
# ===========================================================================
|
||||||
# Target devices - All switches in the fabric
|
# Target devices - All switches in the fabric
|
||||||
# ============================================================================
|
# ===========================================================================
|
||||||
targets:
|
targets:
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Spine switches (AS 65000) - No VXLAN subscription needed
|
# Spine switches (AS 65000) - No VXLAN subscription needed
|
||||||
@@ -195,10 +195,10 @@ targets:
|
|||||||
device: leaf8
|
device: leaf8
|
||||||
asn: "65004"
|
asn: "65004"
|
||||||
|
|
||||||
# ============================================================================
|
# ===========================================================================
|
||||||
# Subscriptions - define what telemetry to collect
|
# Subscriptions - define what telemetry to collect
|
||||||
# Paths verified for Arista cEOS OpenConfig + native augmentations
|
# Paths verified for Arista cEOS OpenConfig + native augmentations
|
||||||
# ============================================================================
|
# ===========================================================================
|
||||||
subscriptions:
|
subscriptions:
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Interface statistics - for Flow Plugin bandwidth visualization
|
# Interface statistics - for Flow Plugin bandwidth visualization
|
||||||
@@ -229,7 +229,8 @@ subscriptions:
|
|||||||
# Vxlan1 interface with Arista VXLAN augmentations
|
# Vxlan1 interface with Arista VXLAN augmentations
|
||||||
- /interfaces/interface[name=Vxlan1]
|
- /interfaces/interface[name=Vxlan1]
|
||||||
mode: stream
|
mode: stream
|
||||||
stream-mode: on_change # VNI mappings don't change frequently
|
stream-mode: sample
|
||||||
|
sample-interval: 30s
|
||||||
encoding: json_ietf
|
encoding: json_ietf
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
@@ -278,9 +279,9 @@ subscriptions:
|
|||||||
sample-interval: 15s
|
sample-interval: 15s
|
||||||
encoding: json_ietf
|
encoding: json_ietf
|
||||||
|
|
||||||
# ============================================================================
|
# ===========================================================================
|
||||||
# Prometheus output configuration
|
# Prometheus output configuration
|
||||||
# ============================================================================
|
# ===========================================================================
|
||||||
outputs:
|
outputs:
|
||||||
prometheus:
|
prometheus:
|
||||||
type: prometheus
|
type: prometheus
|
||||||
@@ -293,31 +294,8 @@ outputs:
|
|||||||
debug: false
|
debug: false
|
||||||
# Expiration time for metrics (prevents stale data)
|
# Expiration time for metrics (prevents stale data)
|
||||||
expiration: 120s
|
expiration: 120s
|
||||||
# Event processors to clean up metric names
|
# No event processors - preserve full OpenConfig path names
|
||||||
event-processors:
|
# This produces metrics like:
|
||||||
- trim-prefixes
|
# gnmic_interfaces_interface_state_counters_out_octets
|
||||||
- add-subscription-name
|
# gnmic_bgp_neighbors_neighbor_state_session_state
|
||||||
|
# gnmic_vxlan_interfaces_interface_arista_vxlan_state_udp_port
|
||||||
# ============================================================================
|
|
||||||
# Event processors - clean up and transform metrics
|
|
||||||
# ============================================================================
|
|
||||||
processors:
|
|
||||||
# Remove long path prefixes from metric names
|
|
||||||
trim-prefixes:
|
|
||||||
event-strings:
|
|
||||||
value-names:
|
|
||||||
- ".*"
|
|
||||||
transforms:
|
|
||||||
- path-base:
|
|
||||||
apply-on: "name"
|
|
||||||
|
|
||||||
# Keep subscription name for better organization
|
|
||||||
add-subscription-name:
|
|
||||||
event-strings:
|
|
||||||
value-names:
|
|
||||||
- ".*"
|
|
||||||
transforms:
|
|
||||||
- replace:
|
|
||||||
apply-on: "name"
|
|
||||||
old: ""
|
|
||||||
new: ""
|
|
||||||
|
|||||||
Reference in New Issue
Block a user