SuperQ / smokeping_prober

Prometheus style smokeping
Apache License 2.0
554 stars 73 forks source link

Use correct source label for metrics #142

Closed tomhughes closed 6 months ago

tomhughes commented 6 months ago

This is built on #141 to avoid conflicts.

As go captures by reference the callbacks hold pinger by reference and they will all wind up taking the source from the last pinger the loop processes.

Assigning source to a local variable that ensures that each pinger's callbacks capture a reference to that variable which is unique to each pinger and hence that the correct source is reported.

SuperQ commented 6 months ago

Close/Open to fix the CI triggers.