diff --git a/jest.config.js b/jest.config.js index 8de1f4a..2fbbf31 100644 --- a/jest.config.js +++ b/jest.config.js @@ -18,7 +18,7 @@ export default { // API options here: testEnvironmentOptions: { bindings: { - WSHIM_TOKEN: '', + LOGGING_SHIM_TOKEN: '', WSHIM_ENDPOINT: 'https://example.com', VERSION_METADATA: '', }, diff --git a/src/bindings.ts b/src/bindings.ts index 1ff360a..741f624 100644 --- a/src/bindings.ts +++ b/src/bindings.ts @@ -28,7 +28,7 @@ export interface Bindings { MINIMUM_FRESHEST_KEYS: string; // telemetry - WSHIM_TOKEN: string; + LOGGING_SHIM_TOKEN: string; WSHIM_SOCKET?: Fetcher; WSHIM_ENDPOINT: string; } diff --git a/src/context/logging.ts b/src/context/logging.ts index 98bd8e1..fee2b13 100644 --- a/src/context/logging.ts +++ b/src/context/logging.ts @@ -183,7 +183,7 @@ export class WshimLogger { throw new Error('Sample rate must be a number between 0 and 1'); } - this.serviceToken = env.WSHIM_TOKEN; + this.serviceToken = env.LOGGING_SHIM_TOKEN; this.sampleRate = sampleRate; this.fetcher = env.WSHIM_SOCKET?.fetch ?? fetch; this.loggingEndpoint = `${env.WSHIM_ENDPOINT}/log`; diff --git a/src/context/metrics.ts b/src/context/metrics.ts index ff29f49..8f105af 100644 --- a/src/context/metrics.ts +++ b/src/context/metrics.ts @@ -49,7 +49,7 @@ export class MetricsRegistry { constructor(env: Bindings) { this.env = env; this.options = { - bearerToken: env.WSHIM_TOKEN, + bearerToken: env.LOGGING_SHIM_TOKEN, endpoint: `${env.WSHIM_ENDPOINT}/prometheus`, fetcher: env.WSHIM_SOCKET?.fetch ?? fetch, };