Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/instrumentation": "^0.214.0",
"@opentelemetry/semantic-conventions": "^1.40.0",
"@remix-run/router": "^1.23.3",
"@sentry/cli": "^2.58.6",
"@sentry/core": "10.57.0",
Expand All @@ -78,6 +77,7 @@
"@remix-run/node": "^2.17.5",
"@remix-run/react": "^2.17.5",
"@remix-run/server-runtime": "^2.17.4",
"@sentry/conventions": "^0.11.0",
"@types/express": "^4.17.14",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/remix/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export default [
output: {
// make it so Rollup calms down about the fact that we're combining default and named exports
exports: 'named',
// keep emitted module paths relative to `src` so the bundled `@sentry/conventions`
// (a devDependency, vendored into the build) doesn't shift the output layout
preserveModulesRoot: 'src',
},
},
}),
Expand Down
16 changes: 8 additions & 8 deletions packages/remix/src/vendor/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
InstrumentationNodeModuleFile,
isWrapped,
} from '@opentelemetry/instrumentation';
import { SemanticAttributes } from '@opentelemetry/semantic-conventions';
import { CODE_FUNCTION, HTTP_METHOD, HTTP_ROUTE, HTTP_STATUS_CODE, HTTP_URL } from '@sentry/conventions/attributes';
import type { Params } from '@remix-run/router';
import type * as remixRunServerRuntime from '@remix-run/server-runtime';
import type * as remixRunServerRuntimeData from '@remix-run/server-runtime/dist/data';
Expand Down Expand Up @@ -192,7 +192,7 @@ export class RemixInstrumentation extends InstrumentationBase {

const routePath = route?.path;
if (span && routePath) {
span.setAttribute(SemanticAttributes.HTTP_ROUTE, routePath);
span.setAttribute(HTTP_ROUTE, routePath);
span.updateName(`remix.request ${routePath}`);
}

Expand Down Expand Up @@ -220,7 +220,7 @@ export class RemixInstrumentation extends InstrumentationBase {
const span = plugin.tracer.startSpan(
'remix.request',
{
attributes: { [SemanticAttributes.CODE_FUNCTION]: 'requestHandler' },
attributes: { [CODE_FUNCTION]: 'requestHandler' },
},
opentelemetry.context.active(),
);
Expand Down Expand Up @@ -256,7 +256,7 @@ export class RemixInstrumentation extends InstrumentationBase {

const span = plugin.tracer.startSpan(
`LOADER ${params.routeId}`,
{ attributes: { [SemanticAttributes.CODE_FUNCTION]: 'loader' } },
{ attributes: { [CODE_FUNCTION]: 'loader' } },
opentelemetry.context.active(),
);

Expand Down Expand Up @@ -291,7 +291,7 @@ export class RemixInstrumentation extends InstrumentationBase {
const clonedRequest = params.request.clone();
const span = plugin.tracer.startSpan(
`ACTION ${params.routeId}`,
{ attributes: { [SemanticAttributes.CODE_FUNCTION]: 'action' } },
{ attributes: { [CODE_FUNCTION]: 'action' } },
opentelemetry.context.active(),
);

Expand Down Expand Up @@ -344,8 +344,8 @@ export class RemixInstrumentation extends InstrumentationBase {

const addRequestAttributesToSpan = (span: Span, request: Request): void => {
span.setAttributes({
[SemanticAttributes.HTTP_METHOD]: request.method,
[SemanticAttributes.HTTP_URL]: request.url,
[HTTP_METHOD]: request.method,
[HTTP_URL]: request.url,
});
};

Expand All @@ -362,7 +362,7 @@ const addMatchAttributesToSpan = (span: Span, match: { routeId: string; params:
const addResponseAttributesToSpan = (span: Span, response: Response | null): void => {
if (response) {
span.setAttributes({
[SemanticAttributes.HTTP_STATUS_CODE]: response.status,
[HTTP_STATUS_CODE]: response.status,
});
}
};
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7578,6 +7578,11 @@
"@sentry/cli-win32-i686" "2.58.6"
"@sentry/cli-win32-x64" "2.58.6"

"@sentry/conventions@^0.11.0":
version "0.11.0"
resolved "https://registry.yarnpkg.com/@sentry/conventions/-/conventions-0.11.0.tgz#5a324b8368dc5c141260bd8ccc684756ea3dd843"
integrity sha512-AQTAKeq9mDpOElDFSPymZTPZF/c50rk355mWTf5Y1ZxZJKKOBli5qTttskJyCxrE5ynNgN1KwcXoU5MRrMSRmQ==

"@sentry/node-cpu-profiler@^2.4.2":
version "2.4.2"
resolved "https://registry.yarnpkg.com/@sentry/node-cpu-profiler/-/node-cpu-profiler-2.4.2.tgz#d0ba01370545297d015df1497daf7f81e27f2ab5"
Expand Down
Loading