1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

feat: drop x- header prefix (#9175)

This commit is contained in:
Mateusz Kwasniewski 2025-01-30 16:09:26 +01:00 committed by GitHub
parent b04079c82d
commit 77cb30a82f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -271,7 +271,7 @@ export function registerPrometheusMetrics(
dbMetrics.registerGaugeDbMetric({
name: 'unique_sdk_connections_total',
help: 'The number of unique SDK connections for the full previous hour across all instances. Available only for SDKs reporting `unleash-x-connection-id`',
help: 'The number of unique SDK connections for the full previous hour across all instances. Available only for SDKs reporting `unleash-connection-id`',
query: () => {
if (flagResolver.isEnabled('uniqueSdkTracking')) {
return stores.uniqueConnectionReadModel.getStats();
@ -283,7 +283,7 @@ export function registerPrometheusMetrics(
dbMetrics.registerGaugeDbMetric({
name: 'unique_backend_sdk_connections_total',
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`',
help: 'The number of unique backend SDK connections for the full previous hour across all instances. Available only for SDKs reporting `unleash-connection-id`',
query: () => {
if (flagResolver.isEnabled('uniqueSdkTracking')) {
return stores.uniqueConnectionReadModel.getStats();
@ -295,7 +295,7 @@ export function registerPrometheusMetrics(
dbMetrics.registerGaugeDbMetric({
name: 'unique_frontend_sdk_connections_total',
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`',
help: 'The number of unique frontend SDK connections for the full previous hour across all instances. Available only for SDKs reporting `unleash-connection-id`',
query: () => {
if (flagResolver.isEnabled('uniqueSdkTracking')) {
return stores.uniqueConnectionReadModel.getStats();

View File

@ -68,6 +68,7 @@ export function responseTimeMetrics(
if (flagResolver.isEnabled('uniqueSdkTracking')) {
const connectionId =
req.headers['unleash-connection-id'] ||
req.headers['x-unleash-connection-id'] ||
req.headers['unleash-instanceid'];
if (req.originalUrl.includes('/api/client') && connectionId) {