-
Notifications
You must be signed in to change notification settings - Fork 22
feat(opentelemetry): create otel instrumentation for typed-express-router #1044
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
base: beta
Are you sure you want to change the base?
feat(opentelemetry): create otel instrumentation for typed-express-router #1044
Conversation
9c177cd
to
0bff27e
Compare
packages/opentelemetry-instrumentation-typed-express-router/test/instrumentation.test.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-typed-express-router/test/instrumentation.test.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-typed-express-router/test/integration.test.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-typed-express-router/src/version.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-typed-express-router/src/utils.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-typed-express-router/test/integration.test.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-typed-express-router/test/integration.test.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-typed-express-router/test/integration.test.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-typed-express-router/test/integration.test.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-typed-express-router/test/integration.test.ts
Fixed
Show fixed
Hide fixed
43daf20
to
3781856
Compare
packages/opentelemetry-instrumentation-typed-express-router/test/integration.test.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-typed-express-router/test/integration.test.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-express/src/terinstrumentation.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-express/src/terinstrumentation.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-express/src/terinstrumentation.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-express/src/terinstrumentation.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-express/src/terinstrumentation.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-express/src/terinstrumentation.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-express/src/terinstrumentation.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-express/src/terinstrumentation.ts
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-express/test/fixtures/use-express.mjs
Fixed
Show fixed
Hide fixed
packages/opentelemetry-instrumentation-typed-express-router/src/instrumentation.ts
Fixed
Show fixed
Hide fixed
6cd264b
to
11fc7f0
Compare
typed-express-router
f804fb4
to
0158ca3
Compare
Back to you, @starfy84! Co-authored-by: Dereck Tu <[email protected]>
a224511
to
ab8a123
Compare
res.writeHead(400, { 'Content-Type': 'application/json' }); | ||
res.write(JSON.stringify({ error: validationErrorMessage })); | ||
res.end(); | ||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
express-wrapper
modified due to onDecodeError
return type being changed
export function defaultOnDecodeError( | ||
errs: Errors, | ||
_req: express.Request, | ||
res: express.Response, | ||
) { | ||
): ReturnType<OnDecodeErrorFn> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can simplify this thing we wrote several hours into our pair programming session last week with:
export const defaultOnDecodeError: OnDecodeErrorFn = (
errs,
_req, // Use _req to indicate it's not used if you prefer
res
) => {
// ...
};
Ticket: DX-1473
This PR implements a manual opentelemetry instrumentation for @api-ts/typed-express-router.
It modifies the library's
wrapRouter
andcreateRouter
functions to create encode and decode spans.For the telemetry to work, @opentelemetry/api needs to be installed