File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type { MiddlewareFn } from "./mod.ts";
44import { ASSET_CACHE_BUST_KEY } from "../runtime/shared_internal.tsx" ;
55import { BUILD_ID } from "../runtime/build_id.ts" ;
66import { getBuildCache } from "../context.ts" ;
7- import { tracer } from "../otel.ts" ;
7+ import { trace , tracer } from "../otel.ts" ;
88
99/**
1010 * Fresh middleware to enable file-system based routing.
@@ -41,6 +41,12 @@ export function staticFiles<T>(): MiddlewareFn<T> {
4141 return new Response ( "Method Not Allowed" , { status : 405 } ) ;
4242 }
4343
44+ const parentSpan = trace . getActiveSpan ( ) ;
45+ if ( parentSpan ) {
46+ parentSpan . updateName ( `${ req . method } /*` ) ;
47+ parentSpan . setAttribute ( "http.route" , "/*" ) ;
48+ }
49+
4450 const span = tracer . startSpan ( "static file" , {
4551 attributes : { "fresh.span_type" : "static_file" } ,
4652 startTime,
Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ import denoJson from "../deno.json" with { type: "json" };
44export const CURRENT_FRESH_VERSION = denoJson . version ;
55
66export const tracer = trace . getTracer ( "fresh" , CURRENT_FRESH_VERSION ) ;
7+ export { trace } ;
You can’t perform that action at this time.
0 commit comments