generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
I want to be able to setup custom components like sampler, span processors, resource detectors and so on.
Manual NodeSDK setup with @opentelemetry/instrumentation-aws-sdk instrumentation doesn't work in bundled (probably, bundled in a very specific way) apps, like NextJS, for example.
See this ticket and these comments specifically:
- @opentelemetry/instrumentation-aws-sdk doesn't work with NextJS open-telemetry/opentelemetry-js-contrib#2734 (comment)
- @opentelemetry/instrumentation-aws-sdk doesn't work with NextJS open-telemetry/opentelemetry-js-contrib#2734 (comment)
You guys are doing something else on top of the standard NodeSDK setup that makes @opentelemetry/instrumentation-aws-sdk work in the bundled app.
It would be great if you could wrap everything you do in the register.ts in a fn that accepts the configuration options for the NodeSDK and let us call it programmatically.
Something like that:
import { registerAdotInstrumentation } from '@aws/aws-distro-opentelemetry-node-autoinstrumentation';
registerAdotInstrumentation({
nodeSdkOptions: {
instrumentations: [
new FetchInstrumentation(),
new HttpInstrumentation(),
new AwsInstrumentation({
suppressInternalInstrumentation: true,
}),
],
sampler: new ParentBasedSampler({
root: new NextJSSampler({
// base: new AlwaysOnSampler(),
base: new TraceIdRatioBasedSampler(0.1),
}),
}),
},
});Please let me know if you want me to make a PR for this myself.
mxiamxia, coding-velociraptor, moltar and Raiszo
Metadata
Metadata
Assignees
Labels
No labels