Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Change format for bulk metrics. (#3229)
### What Change /edge/metrics endpoint to accept list of ClientMetricsEnv ### Rationale We originally made the assumption that we probably didn't need to keep splitting from a map of features into ClientMetricsEnv for bulk, instead the bulk poster could post ClientMetricsEnv directly. However, Unleash still expected the old client metrics format with a dictionary of featurename -> metricsForFeature. This PR changes that to now accept the list of ClientMetricsEnv (preprocessed data from downstream) instead of expecting metrics to be in the old single application metric format.
- Loading branch information
Christopher Kolstad
committed
Mar 1, 2023
1 parent
2fece60
commit f4bdd89
Showing
8 changed files
with
124 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { dateSchema } from './date-schema'; | ||
import { FromSchema } from 'json-schema-to-ts'; | ||
|
||
export const clientMetricsEnvSchema = { | ||
$id: '#/components/schemas/clientMetricsEnvSchema', | ||
type: 'object', | ||
required: ['featureName', 'appName'], | ||
additionalProperties: true, | ||
properties: { | ||
featureName: { | ||
type: 'string', | ||
}, | ||
appName: { | ||
type: 'string', | ||
}, | ||
environment: { | ||
type: 'string', | ||
}, | ||
timestamp: { | ||
$ref: '#/components/schemas/dateSchema', | ||
}, | ||
yes: { | ||
type: 'number', | ||
}, | ||
no: { | ||
type: 'number', | ||
}, | ||
variants: { | ||
type: 'object', | ||
additionalProperties: { | ||
type: 'integer', | ||
minimum: 0, | ||
}, | ||
}, | ||
}, | ||
components: { | ||
schemas: { | ||
dateSchema, | ||
}, | ||
}, | ||
} as const; | ||
|
||
export type ClientMetricsSchema = FromSchema<typeof clientMetricsEnvSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters