@compas/server
Advanced tools
Comparing version 0.12.0 to 0.12.1
{ | ||
"name": "@compas/server", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"description": "Koa server and common middleware", | ||
@@ -24,3 +24,3 @@ "exports": { | ||
"dependencies": { | ||
"@compas/stdlib": "0.12.0", | ||
"@compas/stdlib": "0.12.1", | ||
"@types/formidable": "2.0.6", | ||
@@ -27,0 +27,0 @@ "@types/koa": "2.15.0", |
@@ -82,3 +82,7 @@ import { Transform } from "node:stream"; | ||
// Skip eventStop for CORS requests, this gives a bit cleaner logs. | ||
if (options.disableRootEvent !== true && ctx.method !== "OPTIONS") { | ||
if ( | ||
options.disableRootEvent !== true && | ||
ctx.method !== "OPTIONS" && | ||
ctx.method !== "HEAD" | ||
) { | ||
if (_compasSentryExport) { | ||
@@ -95,8 +99,8 @@ const span = _compasSentryExport.getActiveSpan(); | ||
if (_compasSentryExport) { | ||
const span = _compasSentryExport.getActiveSpan(); | ||
const routeName = ctx.event.name; | ||
const isMatchedRoute = routeName.startsWith("router."); | ||
if (_compasSentryExport.metrics?.increment) { | ||
let compasRouteName = ctx.event.name; | ||
if (!compasRouteName.startsWith("router.")) { | ||
compasRouteName = "<unmatched>"; | ||
} | ||
const compasRouteName = isMatchedRoute ? routeName : "<unmatched>"; | ||
_compasSentryExport.metrics.increment("compas.route.name", 1, { | ||
@@ -110,4 +114,10 @@ tags: { | ||
const span = _compasSentryExport.getActiveSpan(); | ||
if (span) { | ||
if (!isMatchedRoute) { | ||
// @ts-expect-error Private property? | ||
// | ||
// Discard sampled spans which don't match a route. | ||
span._sampled = false; | ||
} | ||
span.setStatus( | ||
@@ -114,0 +124,0 @@ _compasSentryExport.getSpanStatusFromHttpCode(ctx.status), |
@@ -36,3 +36,3 @@ import { _compasSentryExport } from "@compas/stdlib"; | ||
return _sentry.withIsolationScope(() => { | ||
return _sentry.startNewTrace(() => { | ||
return _sentry.startSpanManual( | ||
@@ -39,0 +39,0 @@ { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40558
1152
+ Added@compas/stdlib@0.12.1(transitive)
- Removed@compas/stdlib@0.12.0(transitive)
Updated@compas/stdlib@0.12.1