зеркало из https://github.com/Azure/git-rest-api.git
Make dimensions be strings (#41)
This commit is contained in:
Родитель
3af0e172b0
Коммит
cf004a775c
|
@ -1,7 +1,7 @@
|
|||
export interface Metric {
|
||||
name: string;
|
||||
value: number;
|
||||
dimensions?: StringMap<unknown>;
|
||||
dimensions?: StringMap<string>;
|
||||
}
|
||||
|
||||
export abstract class Telemetry {
|
||||
|
|
|
@ -68,11 +68,12 @@ export class LoggingInterceptor implements NestInterceptor {
|
|||
}
|
||||
|
||||
private trackRequest(properties: { duration: number; path: string; method: string; status: number }) {
|
||||
const { duration, ...otherProperties } = properties;
|
||||
const { duration, status, ...otherProperties } = properties;
|
||||
this.telemetry.emitMetric({
|
||||
name: "INCOMING_REQUEST",
|
||||
value: 1,
|
||||
dimensions: {
|
||||
status: status.toString(),
|
||||
...otherProperties,
|
||||
},
|
||||
});
|
||||
|
@ -80,6 +81,7 @@ export class LoggingInterceptor implements NestInterceptor {
|
|||
name: "INCOMING_REQUEST_DURATION",
|
||||
value: duration,
|
||||
dimensions: {
|
||||
status: status.toString(),
|
||||
...otherProperties,
|
||||
},
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче