Closed evankanderson closed 4 years ago
We need a minor fix for stackdriver though. resource
is overwritten by ResourceByDescriptor
. https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/blob/master/metrics.go#L173
I'm wondering if we can leverage resource.MultiDetector
for this:
https://github.com/census-instrumentation/opencensus-go/blob/master/resource/resource.go#L146
Alternatively, we could do the conversion on the recording side for Stackdriver in Knative, and retire the use of ResourceByDescriptor
from Stackdriver.
Working with #1196, I discovered that
metricexport.Reader
collects metrics from all registered Producers, but doesn't provide a way to distinguish between different Meters. (WithRegisterExporter
, I can hand off a different exporter for each Meter and curry the Resource that way.)This fills in the existing
metricdata.Resource
field when available, which looks like it should already work with Stackdriver. Prometheus seems to ignore the Resource field; I can send a PR for that if desired.