Skip to content
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

Add support for TRPC clients #4458

Open
alyahmedaly opened this issue Jul 3, 2024 · 1 comment
Open

Add support for TRPC clients #4458

alyahmedaly opened this issue Jul 3, 2024 · 1 comment

Comments

@alyahmedaly
Copy link

I'm trying TRPC in one of our apps, but I don't see the trpc counted as separate resource in the apm dashboard, maybe it's our setup as we use express.js and I want to be able to incrementally move to trpc.

@alyahmedaly
Copy link
Author

alyahmedaly commented Jul 5, 2024

found a solution Thanks datadog team for having plugin system, sharing here maybe someone else will need this

 tracer.use('express', {
      hooks: {
        request(span, req) {
          if (!span || !req || !('baseUrl' in req)) return;
          const expressReq = req as express.Request;
          if (!expressReq.baseUrl?.endsWith('/api/rpc') && expressReq.path) {
            return;
          }
          span.setTag('http.route', `${expressReq.baseUrl}${expressReq.path}`);
        },
      },
    });

but will be great if we get native support so I will keep the issue open
and if you copied/used this react with heart it will make my day that I helped another Person ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant