lukeautry / tsoa

Build OpenAPI-compliant REST APIs using TypeScript and Node
MIT License
3.42k stars 489 forks source link

OpenTelemetry for distributed tracing with TSOA #1503

Closed erangac closed 8 months ago

erangac commented 9 months ago

Does TSOA include built-in functionality for context management? For example, is there support for accessing the traceId from incoming HTTP requests, adding new spans, or propagating the current context to a new service?

What is the recommended approach for implementing these context management features in TSOA?

github-actions[bot] commented 9 months ago

Hello there erangac 👋

Thank you for opening your very first issue in this project.

We will try to get back to you as soon as we can.👀

WoH commented 9 months ago

Sure, depending on the framework you target, you can write your own middleware/plugin that does that, or use the ones provided, for example tsoa for express (the default), you would want to check out: https://www.npmjs.com/package/@opentelemetry/instrumentation-express

erangac commented 9 months ago

In this particular scenario, it appears that manual context propagation is necessary. I am referring to a process similar to the following.

https://github.com/musay0/node-samples/blob/v1.0.0/express-otel-boilerplate/src/invoker.ts

It would be beneficial to have a standardized mechanism provided by TSOA for this purpose.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days