File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
packages/logfire-cf-workers/src Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @pydantic/logfire-cf-workers " : minor
3+ ---
4+
5+ Allow disabling scrubbing
Original file line number Diff line number Diff line change 11import type { ReadableSpan } from '@opentelemetry/sdk-trace-base'
22
33import { resolveBaseUrl , serializeAttributes , ULIDGenerator } from '@pydantic/logfire-api'
4+ import * as logfireApi from '@pydantic/logfire-api'
45import { instrument as baseInstrument , TraceConfig } from '@pydantic/otel-cf-workers'
56
67import { TailWorkerExporter } from './TailWorkerExporter'
78export * from './exportTailEventsToLogfire'
89
9- export interface CloudflareConfigOptions {
10- baseUrl ?: string
11- token : string
12- }
13-
1410type Env = Record < string , string | undefined >
1511
1612type ConfigOptionsBase = Pick <
@@ -20,6 +16,10 @@ type ConfigOptionsBase = Pick<
2016
2117export interface InProcessConfigOptions extends ConfigOptionsBase {
2218 baseUrl ?: string
19+ /**
20+ * Options for scrubbing sensitive data. Set to False to disable.
21+ */
22+ scrubbing ?: false | logfireApi . ScrubbingOptions
2323}
2424
2525// eslint-disable-next-line @typescript-eslint/no-empty-object-type
@@ -55,6 +55,9 @@ export function getTailConfig(config: TailConfigOptions): (env: Env) => TraceCon
5555}
5656
5757export function instrumentInProcess < T > ( handler : T , config : InProcessConfigOptions ) : T {
58+ if ( config . scrubbing !== undefined ) {
59+ logfireApi . configureLogfireApi ( { scrubbing : config . scrubbing } )
60+ }
5861 return baseInstrument ( handler , getInProcessConfig ( config ) ) as T
5962}
6063
You can’t perform that action at this time.
0 commit comments