Skip to content

Commit 02be3fc

Browse files
Increase quantity and amooth out histogram boundaries
1 parent 34a7758 commit 02be3fc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/cli-kit/src/private/node/otel-metrics.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ export async function recordMetrics(
8282
recordCommandTiming(recorder, labels, timing)
8383
}
8484

85+
const COMMAND_DURATION_BOUNDARIES_MS = [
86+
0, 100, 200, 300, 500, 750, 1000, 1500, 2000, 3000, 5000, 7500, 10_000, 15_000, 20_000, 30_000, 50_000, 70_000,
87+
85_000, 100_000,
88+
]
89+
8590
/**
8691
* Get the default options for the OTEL service. These are the same across environments.
8792
*/
@@ -101,14 +106,14 @@ function defaultOtelOptions(): Omit<DefaultOtelServiceOptions, 'env' | 'otelEndp
101106
description:
102107
'Total time spent in execution of CLI commands. Does not include time spent waiting for network, prompts, etc.',
103108
valueType: ValueType.INT,
104-
boundaries: [0, 100, 250, 500, 1000, 2000, 5000, 10_000, 20_000, 50_000],
109+
boundaries: COMMAND_DURATION_BOUNDARIES_MS,
105110
},
106111
[Name.Elapsed]: {
107112
type: MetricInstrumentType.Histogram,
108113
description:
109114
'Total time elapsed from start to finish of CLI commands. Includes time spent waiting for network, prompts, etc.',
110115
valueType: ValueType.INT,
111-
boundaries: [0, 100, 250, 500, 1000, 2000, 5000, 10_000, 20_000, 50_000],
116+
boundaries: COMMAND_DURATION_BOUNDARIES_MS,
112117
},
113118
},
114119
}

0 commit comments

Comments
 (0)