-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instrumentations are enabled twice on bootstrap #2410
Comments
The problem also prevents derived instrumentation class from defining their own fields, like: export class SomeInstrumentation extends InstrumentationBase {
someField: SomeType;
constructor(someField: SomeType) {
super(info.name, info.version);
this.someField = someField;
}
enable() {
// this.someField is not initialized yet.
}
} The |
Currently, the documentation of instrumentation all show two approaches to enable instrumentation:
IIUC, it is still left there for compatibility. Maybe it is time to remove the invocation in the InstrumentationBase constructor and the option |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
Was brought up in sig today, already fixed in #2610 (10 Nov 2021) separate question about how good current logic is (as in when enable should be called, during instrumentation instance init or during registerInstrumentation call):
|
What version of OpenTelemetry are you using?
What version of Node are you using?
12.7.0
Please provide the code you used to setup the OpenTelemetry SDK
Then bundled using
webpack@^5.50.0
.What did you do?
I run the provided code in Firefox and set breakpoints on
enable
anddisable
methods ofDocumentLoadInstrumentation
.What did you expect to see?
The
DocumentLoadInstrumentation.prototype.enable
being called only once.What did you see instead?
The
DocumentLoadInstrumentation.prototype.enable
was called twice with no calls ondisable
.Additional context
It looks that all instrumentations are enabling twice on bootstrap firstly by
InstrumentationBase
and secondly byregisterInstrumentations
.The text was updated successfully, but these errors were encountered: