resource.WithoutBuiltin()
is ineffective if used by itself within resource.New()
#1813
Labels
bug
Something isn't working
Description
resource.WithoutBuiltin()
is ineffective if used by itself withinresource.New()
resource.New()
will return nil, which downstream code treats as "no config, give me the defaults".For example,
prometheus.InstallNewPipeline()
, will in turn callcontroller.New()
. If the resource passed tocontroller.New()
is nil, thencontroller.New()
will assume that you want the defaults. AKA, all the things we wanted to remove withresource.WithoutBuiltin()
Environment
Steps To Reproduce
Example code:
All prometheus metrics created will have all the built-in labels added. (Service, sdk, etc.)
Workaround
Expected behavior
Passing
resource.WithoutBuiltin()
toresource.New()
, should result in no built-in labels being added.Possible solution
resource.WithoutBuiltin()
should both nil out all the built-in detectors, but also add a NullDetector, so that we're guaranteed to have a single "valid" detector on return.The text was updated successfully, but these errors were encountered: