Skip to content

Commit

Permalink
fix(js/plugins/google-cloud): allow user specified otel instrumentations
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDoyle committed Feb 19, 2025
1 parent 24cd016 commit e65793f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions js/plugins/google-cloud/src/gcpOpenTelemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,17 @@ export class GcpOpenTelemetry {

/** Gets all open telemetry instrumentations as configured by the plugin. */
private getInstrumentations() {
let instrumentations: Instrumentation[] = [];

if (this.config.autoInstrumentation) {
return getNodeAutoInstrumentations(
instrumentations = getNodeAutoInstrumentations(
this.config.autoInstrumentationConfig
).concat(this.getDefaultLoggingInstrumentations());
);
}
return this.getDefaultLoggingInstrumentations();

return instrumentations
.concat(this.getDefaultLoggingInstrumentations())
.concat(this.config.instrumentations ?? []);
}

private shouldExportTraces(): boolean {
Expand Down

0 comments on commit e65793f

Please sign in to comment.