Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[loader] Too easy to configure no-op implementation by mistake #45

Closed
@Oberon00

Description

@Oberon00

From #29 (comment)

The current lazy-loading behavior makes it easy to accidentally create a no-op tracer that sticks around. E.g. if the configured API implementation is decided after making an HTTP request and the used HTTP library is instrumented, the no-op tracer would be installed by the loader (and it's not exchangeable).

Several possible solutions come to my mind:

  • Just provide setters that directly set the global objects. That would also resolve [loader] Decide setter/envvar interaction & behavior with multiple setter calls #44. Disadvantage: We allow changing an existing implementation and any loader logic is effectively circumvented if the app uses the setter.
  • Don't load implicitly, explicitly require a call to loader.load (this would require moving the storage of the global objects and factory callbacks back to the loader to be implementable). Before that, all getters will return no-op.
  • Provide loader.finish_configuration(). Similar to load but does not load immediately, only signals to getters that next time they are called they should load their component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAffects the API package.usability

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions