census-ecosystem / opencensus-go-exporter-stackdriver

OpenCensus Go exporter for Stackdriver Monitoring and Trace
Apache License 2.0
67 stars 79 forks source link

Check .Present before setting label value #268

Closed jjzeng-seattle closed 4 years ago

jjzeng-seattle commented 4 years ago

We shouldn't set the labels if the value is not present.

This is necessary for the current knative work with multiple meters. In knative some metric labels are extracted into resource labels, so we shouldn't set those metric labels.

https://github.com/evankanderson/knative-pkg/blob/resourcefullest/metrics/stackdriver_exporter.go#L239

jjzeng-seattle commented 4 years ago

/assign @rghetia

nilebox commented 4 years ago

@james-bebbington could you please take care of this PR if you have time? Otherwise I'll get back to it next Tuesday.