Skip to content

Commit 77cb30a

Browse files
authored
feat: drop x- header prefix (#9175)
1 parent b04079c commit 77cb30a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/lib/metrics.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export function registerPrometheusMetrics(
271271

272272
dbMetrics.registerGaugeDbMetric({
273273
name: 'unique_sdk_connections_total',
274-
help: 'The number of unique SDK connections for the full previous hour across all instances. Available only for SDKs reporting `unleash-x-connection-id`',
274+
help: 'The number of unique SDK connections for the full previous hour across all instances. Available only for SDKs reporting `unleash-connection-id`',
275275
query: () => {
276276
if (flagResolver.isEnabled('uniqueSdkTracking')) {
277277
return stores.uniqueConnectionReadModel.getStats();
@@ -283,7 +283,7 @@ export function registerPrometheusMetrics(
283283

284284
dbMetrics.registerGaugeDbMetric({
285285
name: 'unique_backend_sdk_connections_total',
286-
help: 'The number of unique backend SDK connections for the full previous hour across all instances. Available only for SDKs reporting `unleash-x-connection-id`',
286+
help: 'The number of unique backend SDK connections for the full previous hour across all instances. Available only for SDKs reporting `unleash-connection-id`',
287287
query: () => {
288288
if (flagResolver.isEnabled('uniqueSdkTracking')) {
289289
return stores.uniqueConnectionReadModel.getStats();
@@ -295,7 +295,7 @@ export function registerPrometheusMetrics(
295295

296296
dbMetrics.registerGaugeDbMetric({
297297
name: 'unique_frontend_sdk_connections_total',
298-
help: 'The number of unique frontend SDK connections for the full previous hour across all instances. Available only for SDKs reporting `unleash-x-connection-id`',
298+
help: 'The number of unique frontend SDK connections for the full previous hour across all instances. Available only for SDKs reporting `unleash-connection-id`',
299299
query: () => {
300300
if (flagResolver.isEnabled('uniqueSdkTracking')) {
301301
return stores.uniqueConnectionReadModel.getStats();

src/lib/middleware/response-time-metrics.ts

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export function responseTimeMetrics(
6868

6969
if (flagResolver.isEnabled('uniqueSdkTracking')) {
7070
const connectionId =
71+
req.headers['unleash-connection-id'] ||
7172
req.headers['x-unleash-connection-id'] ||
7273
req.headers['unleash-instanceid'];
7374
if (req.originalUrl.includes('/api/client') && connectionId) {

0 commit comments

Comments
 (0)