census-ecosystem / opencensus-go-exporter-stackdriver

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

Make defaultMapResource function public to allow reusing it in custom functions (trying to fix Travis CI) #256

Closed nilebox closed 4 years ago

nilebox commented 4 years ago

In case there is a need to handle extra resource types, it's useful to be able to keep the original behavior, e.g.

func myMapResource(res *resource.Resource) *monitoredrespb.MonitoredResource {
  if res.Type == "my-resource-type" {
    // custom handling
    ...
    return result
  }

  // otherwise return default result
  return stackdriver.DefaultMapResource(res)
}
codecov-io commented 4 years ago

Codecov Report

Merging #256 into master will not change coverage by %. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #256   +/-   ##
=======================================
  Coverage   72.02%   72.02%           
=======================================
  Files          17       17           
  Lines        1691     1691           
=======================================
  Hits         1218     1218           
  Misses        397      397           
  Partials       76       76           
Impacted Files Coverage Δ
resource.go 100.00% <100.00%> (ø)
stackdriver.go 31.68% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1d104f7...870ff90. Read the comment docs.