census-ecosystem / opencensus-go-exporter-stackdriver

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

Kubernetes operator support #118

Open mwuertinger opened 5 years ago

mwuertinger commented 5 years ago

The OpenCensus Kubernetes Operator sets the environment variables OC_RESOURCE_TYPE and OC_RESOURCE_LABELS. The function monitoredresource.Autodetect() should use those values if present.

songy23 commented 5 years ago

Stackdriver exporter will be migrated to use the Resource APIs (https://github.com/census-instrumentation/opencensus-go/tree/master/resource) once they're released. Resource APIs support reading the resource types and labels: https://github.com/census-instrumentation/opencensus-go/blob/master/resource/resource.go#L29-L33

mwuertinger commented 5 years ago

Does this mean that monitoredresource.Autodetect() will be deprecated then?

songy23 commented 5 years ago

Yes, monitoredresource will be deprecated and generic resource will be used instead, similar to what happened in Java: https://github.com/census-instrumentation/opencensus-java/pull/1744 and https://github.com/census-instrumentation/opencensus-java/pull/1745.