You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resource.WithoutBuiltin() is ineffective if used by itself within resource.New() resource.New() will return nil, which downstream code treats as "no config, give me the defaults".
For example, prometheus.InstallNewPipeline(), will in turn call controller.New(). If the resource passed to controller.New() is nil, then controller.New() will assume that you want the defaults. AKA, all the things we wanted to remove with resource.WithoutBuiltin()
Passing resource.WithoutBuiltin() to resource.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:
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: