File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
packages/mcp-common/src/api Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { V4Schema } from '../v4-api'
88
99import type { z } from 'zod'
1010import type { zKeysRequest , zQueryRunRequest , zValuesRequest } from '../types/workers-logs-schemas'
11+ import { env } from 'cloudflare:workers'
1112
1213type QueryRunRequest = z . infer < typeof zQueryRunRequest >
1314
@@ -23,6 +24,8 @@ export async function queryWorkersObservability(
2324 accountId : string ,
2425 query : QueryRunRequest
2526) : Promise < z . infer < typeof zReturnedQueryRunResult > | null > {
27+ // @ts -expect-error We don't have actual env in this package
28+ const environment = env . ENVIRONMENT
2629 const data = await fetchCloudflareApi ( {
2730 endpoint : '/workers/observability/telemetry/query' ,
2831 accountId,
@@ -32,6 +35,7 @@ export async function queryWorkersObservability(
3235 method : 'POST' ,
3336 headers : {
3437 'Content-Type' : 'application/json' ,
38+ 'workers-observability-origin' : `workers-observability-mcp-${ environment } ` ,
3539 } ,
3640 body : JSON . stringify ( { ...query , timeframe : fixTimeframe ( query . timeframe ) } ) ,
3741 } ,
You can’t perform that action at this time.
0 commit comments