nileshsimaria / jtimon

Junos Telemetry Interface client
MIT License
81 stars 29 forks source link

Alias not working #124

Open renatoornelas opened 2 years ago

renatoornelas commented 2 years ago

Hi,

We have some metrics that doesn't convert to the alias short name:

# HELP _lldp_state_counters_frame_in JTIMON Metric
# TYPE _lldp_state_counters_frame_in untyped
_lldp_state_counters_frame_in{device="XXXX"} 1086
# HELP _lldp_state_counters_frame_out JTIMON Metric
# TYPE _lldp_state_counters_frame_out untyped
_lldp_state_counters_frame_out{device="XXXX"} 1174
# HELP _lldp_state_counters_tlv_accepted JTIMON Metric
# TYPE _lldp_state_counters_tlv_accepted untyped
_lldp_state_counters_tlv_accepted{device="XXXX"} 2.7879268e+07
# HELP _lldp_state_enabled JTIMON Metric
# TYPE _lldp_state_enabled untyped
_lldp_state_enabled{device="XXXX"} 1
# HELP _lldp_state_hello_timer JTIMON Metric
# TYPE _lldp_state_hello_timer untyped
_lldp_state_hello_timer{device="XXXX"} 30

Here's our alias.txt:

lldp-frame-in:/lldp/state/counters/frame-in
lldp-frame-out:/lldp/state/counters/frame-out
lldp-hello-timer:/lldp/state/hello-timer
lldp-system-name:/lldp/state/system-name
lldp-enabled:/lldp/state/enabled
weijiage commented 1 year ago

Hi Renato,

Please find the error handling of new alias creation in this pull request https://github.com/nileshsimaria/jtimon/pull/125, jtimon won't be silent on why alias is not working.

renatoornelas commented 1 year ago

Just upgraded our installation to the git version, but got no log on stdout and the alias still not working.

I'm using only this config: { "host": "XXXX", "port": 32767, "paths": [ { "path": "/lldp", "freq": 5000 } ], "alias": "alias.txt" }

and this alias.txt: lldp-frame-in-total:/lldp/state/counters/frame-in lldp-frame-out-total:/lldp/state/counters/frame-out lldp-hello-timer:/lldp/state/hello-timer lldp-system-name:/lldp/state/system-name lldp-enabled:/lldp/state/enabled

I got this on the scrape:

# HELP _lldp_state_counters_frame_in JTIMON Metric
# TYPE _lldp_state_counters_frame_in untyped
_lldp_state_counters_frame_in{device="XXX"} 55769
# HELP _lldp_state_counters_frame_out JTIMON Metric
# TYPE _lldp_state_counters_frame_out untyped
_lldp_state_counters_frame_out{device="XXX"} 60288
# HELP _lldp_state_counters_tlv_accepted JTIMON Metric
# TYPE _lldp_state_counters_tlv_accepted untyped
_lldp_state_counters_tlv_accepted{device="XXX"} 3.4907674e+07
# HELP _lldp_state_enabled JTIMON Metric
# TYPE _lldp_state_enabled untyped
_lldp_state_enabled{device="XXX"} 1
weijiage commented 1 year ago

May you please try the following config? Setting verbose to true may help. { "host": "XXXX", "port": 32767, "paths": [ { "path": "/lldp", "freq": 5000 } ], "alias": "alias.txt", "log": { "verbose": true } }