FlxPeters / netbox-plugin-prometheus-sd

Provide Prometheus url_sd compatible API Endpoint with data from Netbox
MIT License
136 stars 27 forks source link

Bug: unmarshal error for devices. Must have been a structure change recently #194

Open ekrichbaum opened 3 weeks ago

ekrichbaum commented 3 weeks ago

I'm not positive when this broke, but noticed it this morning, so possibly related to netbox 4.0.9 changes but will need to look.

            "__meta_netbox_rack_u_position": 31.0,

This causes:

ts=2024-08-16T14:25:05.851Z caller=refresh.go:90 level=error component="discovery manager scrape" discovery=http config=nb_snmp msg="Unable to refresh target groups" err="json: cannot unmarshal number into Go struct field .labels of type model.LabelValue"

Easy fix in utils to force it back to a string. PR to come.

ekrichbaum commented 3 weeks ago

Ah, wasn't a netbox issue afterall. Came from here and is fixed in his fork but not pushed to main.

https://github.com/FlxPeters/netbox-plugin-prometheus-sd/commit/ba9ea5baf7549b1e99f945e0db8e42fe0615df9e

ginsul commented 3 weeks ago

Hi, sorry for jumping in. Is this causing the rack unit not to show? If so, I had this problem too.

ekrichbaum commented 3 weeks ago

https://github.com/FlxPeters/netbox-plugin-prometheus-sd/pull/195 contains the fix. It's also fixed in the fork from the original add of the feature.