@effect/opentelemetry 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -72,7 +72,7 @@ class MetricProducerImpl {
|
|
|
72
72
|
startTime: hrTimeNow,
|
|
73
73
|
endTime: hrTimeNow,
|
|
74
74
|
attributes,
|
|
75
|
-
value: metricState.count
|
|
75
|
+
value: Number(metricState.count)
|
|
76
76
|
}]
|
|
77
77
|
});
|
|
78
78
|
} else if (MetricState__namespace.isGaugeState(metricState)) {
|
|
@@ -84,7 +84,7 @@ class MetricProducerImpl {
|
|
|
84
84
|
startTime: hrTimeNow,
|
|
85
85
|
endTime: hrTimeNow,
|
|
86
86
|
attributes,
|
|
87
|
-
value: metricState.value
|
|
87
|
+
value: Number(metricState.value)
|
|
88
88
|
}]
|
|
89
89
|
});
|
|
90
90
|
} else if (MetricState__namespace.isHistogramState(metricState)) {
|
|
@@ -235,17 +235,17 @@ const descriptorFromKey = (metricKey, tags, suffix) => ({
|
|
|
235
235
|
...descriptorMeta(metricKey, suffix),
|
|
236
236
|
unit: tags.unit ?? tags.time_unit ?? "1",
|
|
237
237
|
type: instrumentTypeFromKey(metricKey),
|
|
238
|
-
valueType: OtelApi.ValueType.DOUBLE
|
|
238
|
+
valueType: "bigint" in metricKey.keyType && metricKey.keyType.bigint === true ? OtelApi.ValueType.INT : OtelApi.ValueType.DOUBLE
|
|
239
239
|
});
|
|
240
240
|
const instrumentTypeFromKey = key => {
|
|
241
241
|
if (MetricKeyType__namespace.isHistogramKey(key.keyType)) {
|
|
242
242
|
return sdkMetrics.InstrumentType.HISTOGRAM;
|
|
243
243
|
} else if (MetricKeyType__namespace.isGaugeKey(key.keyType)) {
|
|
244
244
|
return sdkMetrics.InstrumentType.OBSERVABLE_GAUGE;
|
|
245
|
-
} else if (MetricKeyType__namespace.isSummaryKey(key.keyType)) {
|
|
246
|
-
return sdkMetrics.InstrumentType.UP_DOWN_COUNTER;
|
|
247
245
|
} else if (MetricKeyType__namespace.isFrequencyKey(key.keyType)) {
|
|
248
246
|
return sdkMetrics.InstrumentType.COUNTER;
|
|
247
|
+
} else if (MetricKeyType__namespace.isCounterKey(key.keyType) && key.keyType.incremental) {
|
|
248
|
+
return sdkMetrics.InstrumentType.COUNTER;
|
|
249
249
|
}
|
|
250
250
|
return sdkMetrics.InstrumentType.UP_DOWN_COUNTER;
|
|
251
251
|
};
|
|
@@ -72,7 +72,7 @@ class MetricProducerImpl {
|
|
|
72
72
|
startTime: hrTimeNow,
|
|
73
73
|
endTime: hrTimeNow,
|
|
74
74
|
attributes,
|
|
75
|
-
value: metricState.count
|
|
75
|
+
value: Number(metricState.count)
|
|
76
76
|
}]
|
|
77
77
|
});
|
|
78
78
|
} else if (MetricState__namespace.isGaugeState(metricState)) {
|
|
@@ -84,7 +84,7 @@ class MetricProducerImpl {
|
|
|
84
84
|
startTime: hrTimeNow,
|
|
85
85
|
endTime: hrTimeNow,
|
|
86
86
|
attributes,
|
|
87
|
-
value: metricState.value
|
|
87
|
+
value: Number(metricState.value)
|
|
88
88
|
}]
|
|
89
89
|
});
|
|
90
90
|
} else if (MetricState__namespace.isHistogramState(metricState)) {
|
|
@@ -235,17 +235,17 @@ const descriptorFromKey = (metricKey, tags, suffix) => ({
|
|
|
235
235
|
...descriptorMeta(metricKey, suffix),
|
|
236
236
|
unit: tags.unit ?? tags.time_unit ?? "1",
|
|
237
237
|
type: instrumentTypeFromKey(metricKey),
|
|
238
|
-
valueType: OtelApi.ValueType.DOUBLE
|
|
238
|
+
valueType: "bigint" in metricKey.keyType && metricKey.keyType.bigint === true ? OtelApi.ValueType.INT : OtelApi.ValueType.DOUBLE
|
|
239
239
|
});
|
|
240
240
|
const instrumentTypeFromKey = key => {
|
|
241
241
|
if (MetricKeyType__namespace.isHistogramKey(key.keyType)) {
|
|
242
242
|
return sdkMetrics.InstrumentType.HISTOGRAM;
|
|
243
243
|
} else if (MetricKeyType__namespace.isGaugeKey(key.keyType)) {
|
|
244
244
|
return sdkMetrics.InstrumentType.OBSERVABLE_GAUGE;
|
|
245
|
-
} else if (MetricKeyType__namespace.isSummaryKey(key.keyType)) {
|
|
246
|
-
return sdkMetrics.InstrumentType.UP_DOWN_COUNTER;
|
|
247
245
|
} else if (MetricKeyType__namespace.isFrequencyKey(key.keyType)) {
|
|
248
246
|
return sdkMetrics.InstrumentType.COUNTER;
|
|
247
|
+
} else if (MetricKeyType__namespace.isCounterKey(key.keyType) && key.keyType.incremental) {
|
|
248
|
+
return sdkMetrics.InstrumentType.COUNTER;
|
|
249
249
|
}
|
|
250
250
|
return sdkMetrics.InstrumentType.UP_DOWN_COUNTER;
|
|
251
251
|
};
|
package/internal/metrics.esm.js
CHANGED
|
@@ -39,7 +39,7 @@ class MetricProducerImpl {
|
|
|
39
39
|
startTime: hrTimeNow,
|
|
40
40
|
endTime: hrTimeNow,
|
|
41
41
|
attributes,
|
|
42
|
-
value: metricState.count
|
|
42
|
+
value: Number(metricState.count)
|
|
43
43
|
}]
|
|
44
44
|
});
|
|
45
45
|
} else if (MetricState.isGaugeState(metricState)) {
|
|
@@ -51,7 +51,7 @@ class MetricProducerImpl {
|
|
|
51
51
|
startTime: hrTimeNow,
|
|
52
52
|
endTime: hrTimeNow,
|
|
53
53
|
attributes,
|
|
54
|
-
value: metricState.value
|
|
54
|
+
value: Number(metricState.value)
|
|
55
55
|
}]
|
|
56
56
|
});
|
|
57
57
|
} else if (MetricState.isHistogramState(metricState)) {
|
|
@@ -202,17 +202,17 @@ const descriptorFromKey = (metricKey, tags, suffix) => ({
|
|
|
202
202
|
...descriptorMeta(metricKey, suffix),
|
|
203
203
|
unit: tags.unit ?? tags.time_unit ?? "1",
|
|
204
204
|
type: instrumentTypeFromKey(metricKey),
|
|
205
|
-
valueType: ValueType.DOUBLE
|
|
205
|
+
valueType: "bigint" in metricKey.keyType && metricKey.keyType.bigint === true ? ValueType.INT : ValueType.DOUBLE
|
|
206
206
|
});
|
|
207
207
|
const instrumentTypeFromKey = key => {
|
|
208
208
|
if (MetricKeyType.isHistogramKey(key.keyType)) {
|
|
209
209
|
return InstrumentType.HISTOGRAM;
|
|
210
210
|
} else if (MetricKeyType.isGaugeKey(key.keyType)) {
|
|
211
211
|
return InstrumentType.OBSERVABLE_GAUGE;
|
|
212
|
-
} else if (MetricKeyType.isSummaryKey(key.keyType)) {
|
|
213
|
-
return InstrumentType.UP_DOWN_COUNTER;
|
|
214
212
|
} else if (MetricKeyType.isFrequencyKey(key.keyType)) {
|
|
215
213
|
return InstrumentType.COUNTER;
|
|
214
|
+
} else if (MetricKeyType.isCounterKey(key.keyType) && key.keyType.incremental) {
|
|
215
|
+
return InstrumentType.COUNTER;
|
|
216
216
|
}
|
|
217
217
|
return InstrumentType.UP_DOWN_COUNTER;
|
|
218
218
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/opentelemetry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@opentelemetry/api": "^1.4",
|
|
52
|
-
"effect": "2.0.0-next.
|
|
52
|
+
"effect": "2.0.0-next.45"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@babel/core": "^7.23.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@changesets/changelog-github": "^0.4.8",
|
|
58
58
|
"@changesets/cli": "^2.26.2",
|
|
59
59
|
"@effect/babel-plugin": "^0.2.0",
|
|
60
|
-
"@effect/build-utils": "^0.1.
|
|
60
|
+
"@effect/build-utils": "^0.1.6",
|
|
61
61
|
"@effect/docgen": "^0.1.8",
|
|
62
62
|
"@effect/eslint-plugin": "^0.1.2",
|
|
63
63
|
"@effect/language-service": "^0.0.21",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@vitest/expect": "^0.34.6",
|
|
76
76
|
"babel-plugin-annotate-pure-calls": "^0.4.0",
|
|
77
77
|
"concurrently": "^8.2.1",
|
|
78
|
-
"effect": "2.0.0-next.
|
|
78
|
+
"effect": "2.0.0-next.45",
|
|
79
79
|
"eslint": "^8.50.0",
|
|
80
80
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
81
81
|
"eslint-plugin-codegen": "0.17.0",
|
package/src/internal/metrics.ts
CHANGED
|
@@ -50,7 +50,7 @@ export class MetricProducerImpl implements MetricProducer {
|
|
|
50
50
|
startTime: hrTimeNow,
|
|
51
51
|
endTime: hrTimeNow,
|
|
52
52
|
attributes,
|
|
53
|
-
value: metricState.count
|
|
53
|
+
value: Number(metricState.count)
|
|
54
54
|
}]
|
|
55
55
|
})
|
|
56
56
|
} else if (MetricState.isGaugeState(metricState)) {
|
|
@@ -62,7 +62,7 @@ export class MetricProducerImpl implements MetricProducer {
|
|
|
62
62
|
startTime: hrTimeNow,
|
|
63
63
|
endTime: hrTimeNow,
|
|
64
64
|
attributes,
|
|
65
|
-
value: metricState.value
|
|
65
|
+
value: Number(metricState.value)
|
|
66
66
|
}]
|
|
67
67
|
})
|
|
68
68
|
} else if (MetricState.isHistogramState(metricState)) {
|
|
@@ -214,7 +214,7 @@ const descriptorFromKey = (
|
|
|
214
214
|
...descriptorMeta(metricKey, suffix),
|
|
215
215
|
unit: tags.unit ?? tags.time_unit ?? "1",
|
|
216
216
|
type: instrumentTypeFromKey(metricKey),
|
|
217
|
-
valueType: ValueType.DOUBLE
|
|
217
|
+
valueType: "bigint" in metricKey.keyType && metricKey.keyType.bigint === true ? ValueType.INT : ValueType.DOUBLE
|
|
218
218
|
})
|
|
219
219
|
|
|
220
220
|
const instrumentTypeFromKey = (key: MetricKey.MetricKey.Untyped): InstrumentType => {
|
|
@@ -222,10 +222,10 @@ const instrumentTypeFromKey = (key: MetricKey.MetricKey.Untyped): InstrumentType
|
|
|
222
222
|
return InstrumentType.HISTOGRAM
|
|
223
223
|
} else if (MetricKeyType.isGaugeKey(key.keyType)) {
|
|
224
224
|
return InstrumentType.OBSERVABLE_GAUGE
|
|
225
|
-
} else if (MetricKeyType.isSummaryKey(key.keyType)) {
|
|
226
|
-
return InstrumentType.UP_DOWN_COUNTER
|
|
227
225
|
} else if (MetricKeyType.isFrequencyKey(key.keyType)) {
|
|
228
226
|
return InstrumentType.COUNTER
|
|
227
|
+
} else if (MetricKeyType.isCounterKey(key.keyType) && key.keyType.incremental) {
|
|
228
|
+
return InstrumentType.COUNTER
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
return InstrumentType.UP_DOWN_COUNTER
|