autometrics-dev/autometrics-ts

๐Ÿ› Class decorators break in the browser when using the init function

stephlow opened this issue ยท 1 comments

Environment information

`autometrics-ts@0.6.0`

What happened?

In the current implementation, when you use a class decorator and a custom init configuration, the decorator will run before the init function.

Because of this, it will try to spin up a PrometheusExporter, even though we configure a push gateway in the init function.

Expected result

The class decorator should use the configuration provided in the init call

Good catch thank you! Notably this won't just break in the browser: because the decorator resolves before any other code is run (even the first init function) - any custom exporter configuration will be ignored.