Compare commits
821 Commits
api/v1.6.0
...
main
Author | SHA1 | Date |
---|---|---|
|
48538b46ad | |
|
8de88737ff | |
|
d63dfaef09 | |
|
cb42f7d511 | |
|
99dde7786f | |
|
287d46353d | |
|
8e1fc80d1a | |
|
1537d405fe | |
|
06330cebbb | |
|
41ba7f57cb | |
|
a0618ad0c7 | |
|
2c7037662c | |
|
93187f0224 | |
|
ca6ae61783 | |
|
407c98a09f | |
|
27d5171890 | |
|
7a32f86055 | |
|
5c4057bb8d | |
|
553db87117 | |
|
74d434eecd | |
|
a59d707c42 | |
|
491ed96aca | |
|
e18a6c8456 | |
|
8505a6147e | |
|
04a8150d37 | |
|
ec17ce48d0 | |
|
f2cfd1327a | |
|
62fbfd3d0d | |
|
995d708729 | |
|
86bab66f32 | |
|
5b3c6b4e83 | |
|
a4e9645829 | |
|
7e30af4c15 | |
|
3578f68c74 | |
|
56df3c0346 | |
|
55f8c20b19 | |
|
c04536857e | |
|
b1dc46473c | |
|
22bc5bac9b | |
|
5736c49842 | |
|
c1935022c1 | |
|
4919fd1711 | |
|
a9fc600f2b | |
|
08afa47f6a | |
|
a2e0f2c6ac | |
|
019cb2c149 | |
|
7a9b04904c | |
|
6d0d33b3df | |
|
280cd5012b | |
|
1c8ec3b291 | |
|
85f1bcc256 | |
|
f0ba942c04 | |
|
af9c024c04 | |
|
9dbd1e446b | |
|
4e2703c3e0 | |
|
072d8a8b2b | |
|
04545fa4ab | |
|
baec0a3e65 | |
|
4ce5bd1651 | |
|
6803723f69 | |
|
d4d373217a | |
|
56610a0c6f | |
|
697e1d31bd | |
|
373edd9bc1 | |
|
0c21db4621 | |
|
0665c854c8 | |
|
d07d630cea | |
|
bc8c94e22c | |
|
4d3f899532 | |
|
6f72fb9646 | |
|
ba50c08e12 | |
|
c2c9399740 | |
|
b50f088f8a | |
|
039b6b4df1 | |
|
b76281a32c | |
|
6033e66530 | |
|
5954fdeb90 | |
|
e1ec4026ed | |
|
eb4ce206b7 | |
|
67ba9e3084 | |
|
db0616fb37 | |
|
eeec126479 | |
|
60d3115390 | |
|
b0e4e4f1d8 | |
|
7749d0a011 | |
|
aca743b499 | |
|
cfc33f7741 | |
|
0c452201aa | |
|
2ac15af496 | |
|
826c2d90d4 | |
|
4061f81de7 | |
|
a2fab71bae | |
|
6f753cca7e | |
|
0b5736d4e1 | |
|
0bbb966729 | |
|
9f5ae79b1e | |
|
8efceed28c | |
|
dbbd03233e | |
|
fb2fdd293f | |
|
cf6dffeebc | |
|
de3a89b1f6 | |
|
e26ecd8eda | |
|
c89cb38d0f | |
|
37fe1e495b | |
|
6e15d69cb8 | |
|
dac72912b3 | |
|
b0b721ae3e | |
|
a59448fe27 | |
|
4f9b31b78a | |
|
28ddef3868 | |
|
78f9260bd5 | |
|
e46bd39e8d | |
|
141c054d2d | |
|
58468728e8 | |
|
0f6619e0cc | |
|
b018f15a00 | |
|
0808373465 | |
|
54e039c9e0 | |
|
77cad06f40 | |
|
3c452f4b20 | |
|
efc640eefa | |
|
2c60ac030a | |
|
dd4b39c850 | |
|
050aafbea5 | |
|
27eb7f12cf | |
|
a8583b82d3 | |
|
390243e308 | |
|
c3260a4dba | |
|
b322a24b4a | |
|
c6ab2ba488 | |
|
790dbb986c | |
|
378344a740 | |
|
019671e140 | |
|
0590a5c08a | |
|
f4dd2a1062 | |
|
7fde94081e | |
|
ecd67debdb | |
|
eaebf765d8 | |
|
e947bd93ae | |
|
5e20647ffe | |
|
78fc472c17 | |
|
693b09d9ac | |
|
92fde6aa77 | |
|
04b32102f0 | |
|
cb4826635a | |
|
8e5049877a | |
|
d240d37ec4 | |
|
455a352b6a | |
|
d9eae58155 | |
|
544c409847 | |
|
537eaf9fc0 | |
|
7d6e11e02f | |
|
2053f0d3a4 | |
|
de5f1dab8c | |
|
f2d4e54975 | |
|
492ed355cb | |
|
5ccf3809b9 | |
|
faeae98653 | |
|
d004d41b5a | |
|
0cdf9eea80 | |
|
1afa8ba514 | |
|
14d55d8641 | |
|
e9d3c71918 | |
|
e4381fcb18 | |
|
1a5b57b7f3 | |
|
cc7aa3c724 | |
|
52d033171a | |
|
5c90aec9af | |
|
5b988c892d | |
|
c27fbc6d49 | |
|
7a1e1b274f | |
|
60f2ce9b73 | |
|
3c65b56d6f | |
|
b526ec99d7 | |
|
4b8ae0c2bf | |
|
7438735af7 | |
|
2d5671aeec | |
|
e7865c67d8 | |
|
bc6c4ebb7f | |
|
afcc71158b | |
|
fcd96deb78 | |
|
1ed613c248 | |
|
9feaee3ff5 | |
|
b6fa2b9e4d | |
|
4fb9c5aba9 | |
|
4f91c1d590 | |
|
824814f783 | |
|
abf31e17f8 | |
|
94059f7cf7 | |
|
99091be9d4 | |
|
3b65dee7bd | |
|
b9d5aeeb22 | |
|
e744798957 | |
|
6508845fa6 | |
|
9030b3e7bd | |
|
a6bb7a321d | |
|
4001f626d9 | |
|
41beed70a3 | |
|
e9f84cbeef | |
|
241c046ccd | |
|
2d4e1cac7c | |
|
d803022ba3 | |
|
57f37eeb31 | |
|
e25de957f4 | |
|
34a2dd574c | |
|
39e9a09694 | |
|
b5885e90e6 | |
|
595d0e9c0d | |
|
f9fda8baef | |
|
7332f3a863 | |
|
15ba2d7da3 | |
|
05c2869ada | |
|
29d0da559b | |
|
c513965062 | |
|
5903906d10 | |
|
bb212334c7 | |
|
e265e47e98 | |
|
a04284ccdc | |
|
27bdf71519 | |
|
3c040c4ef0 | |
|
1c6c39b454 | |
|
a686b88bf5 | |
|
22569aca32 | |
|
2759d73ed5 | |
|
23adb2bdc5 | |
|
682ab65f7c | |
|
d2812d2810 | |
|
e966dc535b | |
|
e42fbb985f | |
|
199fd8ddd3 | |
|
321c31f442 | |
|
c43f17238c | |
|
bdc0e3a34c | |
|
2a26d08b2e | |
|
3e013cfd8f | |
|
f927e82b1d | |
|
0ae25f191e | |
|
b4ae9ca61d | |
|
df49fb1893 | |
|
34475825e8 | |
|
c00f36ee43 | |
|
6c04a41443 | |
|
56c7522693 | |
|
bb22068a27 | |
|
fc0edd82f6 | |
|
95a190a5ac | |
|
6d83f80c13 | |
|
13e951a001 | |
|
6f18ec24d2 | |
|
cb88833234 | |
|
6864c2f785 | |
|
ebdc3144f2 | |
|
70755a6a80 | |
|
37015ee9de | |
|
513ef0d7fb | |
|
ec638dc193 | |
|
a37692abc7 | |
|
d35fbab151 | |
|
52af860553 | |
|
12bde40fb6 | |
|
ec9429711e | |
|
4a6021af7a | |
|
c408d21bb6 | |
|
fddcd199a0 | |
|
643f2bbfc4 | |
|
3b56060c51 | |
|
04e74d7846 | |
|
42eb824f2f | |
|
f44bf10459 | |
|
b2d02d2cc0 | |
|
369d85adbf | |
|
fa5edc639c | |
|
9c46e8f87d | |
|
90afa2850c | |
|
8dc74e609a | |
|
347dd5f692 | |
|
107637ea28 | |
|
2610521b16 | |
|
b8d7966b86 | |
|
4179ddb26c | |
|
616d27a0a1 | |
|
e524148b48 | |
|
67a0e9cb0c | |
|
0c11fc6325 | |
|
8ab52d5479 | |
|
a8befa6814 | |
|
6d7a73aa85 | |
|
84cce75361 | |
|
6d31a18c34 | |
|
e03b6e7caa | |
|
e4d9c213f6 | |
|
bdee949b8a | |
|
61d5a0e291 | |
|
887ff1cd6e | |
|
79e28759f0 | |
|
5387343986 | |
|
9328790c54 | |
|
484af40805 | |
|
0bc4af6cd8 | |
|
eb81e286c0 | |
|
a761a8c4cf | |
|
47212bb4e1 | |
|
a8b4cd2b9d | |
|
569346ba7b | |
|
97dff5b375 | |
|
85dcbc7c55 | |
|
b0f73ea11d | |
|
c9b5bb0bfe | |
|
fc94e4669a | |
|
810b6183dc | |
|
fd7f2d951b | |
|
17bf0d9a34 | |
|
1249e34591 | |
|
5ad0aa544b | |
|
3bf12847d1 | |
|
561f8ad3a3 | |
|
e80879e093 | |
|
c9fa209bf9 | |
|
e35f3d659e | |
|
556eecf0f9 | |
|
e250a0f30b | |
|
3a20ed60b0 | |
|
c28abacee5 | |
|
1e312c2088 | |
|
ef80821f94 | |
|
f3a6310733 | |
|
e97cc2ee8e | |
|
d8bc6b283b | |
|
ef30dbc94d | |
|
dd5b5fbd11 | |
|
a834861418 | |
|
91b9abdf21 | |
|
b7c03d29a4 | |
|
0ee9a27694 | |
|
8ad1304098 | |
|
2a5e0d8224 | |
|
7e98761bc6 | |
|
1370810663 | |
|
4b1ad3fda0 | |
|
9e4d36cb3e | |
|
d3630afb35 | |
|
09a630d304 | |
|
473bb5edcd | |
|
23a47d3fed | |
|
6096f7238d | |
|
1aa158bf98 | |
|
363c003a95 | |
|
0c268e7127 | |
|
44465081c8 | |
|
5bf7e8957e | |
|
d51fa95a6f | |
|
b7343ef3e0 | |
|
c78a02fe74 | |
|
56a0308297 | |
|
4afc190d90 | |
|
a833d9c443 | |
|
699b9194ba | |
|
4a394cc8d7 | |
|
db14633cc4 | |
|
f1ef5960ae | |
|
8483b68f2d | |
|
012dc9e742 | |
|
4b5c21cede | |
|
87bd98edd2 | |
|
030aff30f7 | |
|
72c9af9198 | |
|
fe4d368900 | |
|
6f4f3fcefd | |
|
33dbde1ede | |
|
67d771869b | |
|
ce5bbfb05c | |
|
4c0921ee64 | |
|
2b73d37c9c | |
|
eb3ca4fb07 | |
|
6fee82d868 | |
|
50d59ca938 | |
|
4497ee3831 | |
|
006fe44e56 | |
|
330172c1d8 | |
|
55a1fc88d8 | |
|
508946c853 | |
|
5e1736130e | |
|
be1737fc46 | |
|
c208991123 | |
|
7ed67f98c2 | |
|
a1442fec01 | |
|
7293e69c1e | |
|
dcc1a874d3 | |
|
6be903a902 | |
|
cc8c54ae40 | |
|
039db0b3fc | |
|
859c0ef5a0 | |
|
b057c93c15 | |
|
8fed1b1b66 | |
|
6ccd4df33a | |
|
4947c2d6a4 | |
|
776993f0fc | |
|
7baa493f50 | |
|
e0e2b4ad81 | |
|
3007d3e749 | |
|
77f12c57bf | |
|
98143af5db | |
|
d1cd7f23d0 | |
|
466140bdf8 | |
|
2f919a43fd | |
|
a5dade5462 | |
|
91c67ba470 | |
|
e15d5b3bcd | |
|
9de31518e7 | |
|
2a4919c1cf | |
|
395010f96b | |
|
ee40d5d9b7 | |
|
1ce52050bd | |
|
5627d8451e | |
|
4574bf51c0 | |
|
42be951958 | |
|
8900cfdbba | |
|
1804925c53 | |
|
32564adbb0 | |
|
f4d0dcf45d | |
|
4ef739580f | |
|
6515ed8098 | |
|
0571e429b6 | |
|
cdfefb8294 | |
|
32e25c31c2 | |
|
92b0c368e8 | |
|
af0ecacf72 | |
|
e9eb92476e | |
|
9c30124e76 | |
|
f8ab5592dd | |
|
61c37441f5 | |
|
f7dc8ff5fa | |
|
016c240613 | |
|
b78fec3406 | |
|
3d43356782 | |
|
a3983faa44 | |
|
9d474e3b96 | |
|
1fc304c1e9 | |
|
a00a429b2c | |
|
e311672daf | |
|
7b800e124d | |
|
d7f4288919 | |
|
41c0d88710 | |
|
720bc8c70d | |
|
65cedf71bd | |
|
bd25230eae | |
|
948496dcbf | |
|
966ac176af | |
|
2ca2459414 | |
|
c398601cc1 | |
|
3cf1c5215f | |
|
5578a11dfd | |
|
5c1ae0aa5b | |
|
0b8d310cf5 | |
|
0ee398d1e3 | |
|
f7dccbf0a0 | |
|
7aff06d793 | |
|
00683ff515 | |
|
f2a6bcc204 | |
|
cd4e2bf8c0 | |
|
583154c919 | |
|
14d086a234 | |
|
e1522f0f39 | |
|
39ab59d9ad | |
|
fb4619bfc8 | |
|
bb67268e17 | |
|
f047db9da2 | |
|
15e6534451 | |
|
af1efea55c | |
|
fbd28f0332 | |
|
c0e25aaaf5 | |
|
f947278cb3 | |
|
30d1e13876 | |
|
d4b75c3f0c | |
|
3c307994fa | |
|
ae25ae3319 | |
|
cf8edbed43 | |
|
5cc3dc28d7 | |
|
01cea7caeb | |
|
38f6689480 | |
|
b2778e1b2f | |
|
30a46ae547 | |
|
bb9caaf1ef | |
|
eee78fa2e7 | |
|
154155f7d9 | |
|
08942ba126 | |
|
1cf1939641 | |
|
3d66bcbb9c | |
|
3f2c707ade | |
|
d91dbe1b1d | |
|
3460a8c264 | |
|
f2039e856b | |
|
34003c9b7e | |
|
d4035eb973 | |
|
a6020fb113 | |
|
8d88c36dcb | |
|
54b14fbbe3 | |
|
539d94265b | |
|
0f6363ae35 | |
|
a037f84b67 | |
|
fbb1b360eb | |
|
01a2c35a69 | |
|
f99e7d9c2c | |
|
3fdadd516e | |
|
73fad98428 | |
|
08628bce82 | |
|
86019e0ff6 | |
|
0608f40557 | |
|
cdd5284dc3 | |
|
81f78a6e42 | |
|
1041ed4fdb | |
|
c07aa537cb | |
|
55f15e90d6 | |
|
3cbc9c72e9 | |
|
9e421f6a84 | |
|
dd83751f19 | |
|
4fa7c1358e | |
|
812c774998 | |
|
48854685d3 | |
|
b5409d7acd | |
|
c280a08027 | |
|
05e2699089 | |
|
c9ea5f2428 | |
|
01664ddf87 | |
|
2e42181ff0 | |
|
fd911fb3a4 | |
|
bd053932b7 | |
|
6481396a6b | |
|
6bb2f16d85 | |
|
c4d3351b6b | |
|
26974c4d07 | |
|
957fa3b5e4 | |
|
97d0ec5a1b | |
|
929e345454 | |
|
97f372b475 | |
|
9cd2021119 | |
|
de503497b9 | |
|
7c808e3117 | |
|
9d3bc18f7d | |
|
106fa9bfdd | |
|
315239da67 | |
|
be9d11c045 | |
|
1ef6027457 | |
|
c66b65f610 | |
|
0ce7d94e3e | |
|
20074d8cd3 | |
|
95edbd9992 | |
|
55c6c014cf | |
|
04dc781a84 | |
|
81b847484e | |
|
7e72f1cccf | |
|
ba7bdf5465 | |
|
ecc88a38d8 | |
|
634277f460 | |
|
82b7526b02 | |
|
7238852445 | |
|
4f6d7a4ade | |
|
969a16f911 | |
|
095003da3e | |
|
860e5d5746 | |
|
182cbb530d | |
|
195e5efb4e | |
|
d545521580 | |
|
c97f21f221 | |
|
4e778b1257 | |
|
2d867172b4 | |
|
e49c4c7f42 | |
|
bac68fc7d4 | |
|
d7fcc77d55 | |
|
20182d8804 | |
|
4c01b33826 | |
|
806fa97ebd | |
|
a479ddce4b | |
|
3c8c29ac8f | |
|
50bd46061e | |
|
1c6e8b2531 | |
|
15b35260df | |
|
3ca2f5ba8d | |
|
3cfa78303a | |
|
4777631b13 | |
|
ca027b5eed | |
|
5608bba359 | |
|
46d79f9a5e | |
|
a82d875863 | |
|
c503ff1394 | |
|
1c5de7ac2f | |
|
75d88f7126 | |
|
b518e16ef8 | |
|
9400e726d0 | |
|
157c811274 | |
|
753f0a63a2 | |
|
5c84971528 | |
|
e86470a53b | |
|
4d6cf080c7 | |
|
d99e211a31 | |
|
e44895fdac | |
|
8c12dd5c42 | |
|
141b457b85 | |
|
8079fd6880 | |
|
3ab4f765d8 | |
|
31eb60dc99 | |
|
99431df2e2 | |
|
73fddf9b5e | |
|
0d6c45697f | |
|
26101229ae | |
|
629bb8398b | |
|
0a750eb90b | |
|
7f82b80f3c | |
|
87e25c5e01 | |
|
3b5eb239cc | |
|
da02c8d6b1 | |
|
fab27d578a | |
|
583cc7c23d | |
|
34387774ca | |
|
b067aed8ba | |
|
7a5db08f75 | |
|
19660dbc96 | |
|
7fb673cc59 | |
|
0b6463e491 | |
|
c0468673cb | |
|
b78d4432d8 | |
|
e01f493a24 | |
|
5231aa2550 | |
|
928796d853 | |
|
d66e1d75d4 | |
|
f3aedb76ff | |
|
b418d36609 | |
|
9a5688e61f | |
|
1a0fb4fd5f | |
|
900b7d8bfc | |
|
f6a075be32 | |
|
97af8e6d4d | |
|
fec6286127 | |
|
5fb65b4145 | |
|
f9a0d3ec33 | |
|
6547440432 | |
|
5489797344 | |
|
aabd1a9b00 | |
|
3a426e8c32 | |
|
1b4999f386 | |
|
a30989f420 | |
|
7fa2c84e6f | |
|
680406654e | |
|
c379326d92 | |
|
63d74cdc36 | |
|
5a033e50b3 | |
|
75bd7233ea | |
|
3920b158d0 | |
|
8e1996ef0d | |
|
7be35c7845 | |
|
05720ccc41 | |
|
f1b2c6d212 | |
|
5637e2a91c | |
|
aff48a1f00 | |
|
12dec9b9cd | |
|
89caef9bb9 | |
|
356ef8af4a | |
|
5bc8cedbd3 | |
|
8bbebfd191 | |
|
44b0b29dea | |
|
7e709a6fd9 | |
|
83becc71bf | |
|
01348e6fbc | |
|
25548fd9a5 | |
|
19b433e137 | |
|
b7c53827d4 | |
|
f86251d40f | |
|
63845ec2e7 | |
|
f6712fd450 | |
|
6d276f4d87 | |
|
588d8ad14d | |
|
0229434cb5 | |
|
72c60f17ef | |
|
2df6310351 | |
|
efa6307319 | |
|
ac75b70dde | |
|
c98a5d31ea | |
|
4655895ba1 | |
|
828f2ed730 | |
|
37119908d6 | |
|
5afbcdbe0a | |
|
bf4d553ef8 | |
|
df63272408 | |
|
8648313ed8 | |
|
0635ab1c6c | |
|
a9af247259 | |
|
0f6518dd63 | |
|
0aba75ceef | |
|
97276869cd | |
|
43e598e7c1 | |
|
2a3c26437f | |
|
7f613e0491 | |
|
bf8714edcb | |
|
71ef1b1f2c | |
|
6898a34512 | |
|
fac6d147a1 | |
|
57008533ab | |
|
b7e3d44fd1 | |
|
ae0a3c522d | |
|
b36ab12d16 | |
|
0206181c49 | |
|
f4b681d4f3 | |
|
a512494ba2 | |
|
42aaae0270 | |
|
3cf2cf60c5 | |
|
37add77095 | |
|
3e59291321 | |
|
d828041a52 | |
|
d3c311aec2 | |
|
02de4ab720 | |
|
d286bf6498 | |
|
1cbaaf08b2 | |
|
ba00147a77 | |
|
ea8bfa283a | |
|
4fe1ae8aaf | |
|
af4f7a9daf | |
|
dddab06aa4 | |
|
6be10fbd8d | |
|
237c757242 | |
|
9349c68c2f | |
|
4e77c1dee6 | |
|
09bdeba200 | |
|
5b0fb7b40d | |
|
4daa2640d2 | |
|
104a5e8867 | |
|
dcf93e8506 | |
|
9e9453649d | |
|
6dd075cdf6 | |
|
1447ad5223 | |
|
a81e0eaa14 | |
|
c4e75fb953 | |
|
0b7dc46f56 | |
|
317c93dec8 | |
|
3e2fcdaebb | |
|
c0034ce3e5 | |
|
d0d95816b9 | |
|
593d220465 | |
|
0a52166bbd | |
|
cc4ff2d158 | |
|
3f96f1ff83 | |
|
1dda06a803 | |
|
470a2bf79b | |
|
bf8ee62a1e | |
|
f654636502 | |
|
762a65a6e4 | |
|
38db748685 | |
|
8067d97210 | |
|
35be022db1 | |
|
543f0b470c | |
|
b3a539d301 | |
|
3b8f0aff95 | |
|
dc10b81ee9 | |
|
5be08f47f0 | |
|
26fcb884fd | |
|
079c1f547a | |
|
21da78f76c | |
|
4cbb6351f8 | |
|
bf30779119 | |
|
343ca78015 | |
|
d229b3ad31 | |
|
7cf46c794b | |
|
9d62673d2c | |
|
ab52a8420a | |
|
6031bb4ddc | |
|
ba4de42a4b | |
|
e0efd7aa3d | |
|
51be418b3d | |
|
4eddf51eb9 | |
|
2c7d5c427f | |
|
0f8aa7924f | |
|
5ed54c8a09 | |
|
10f6c46057 | |
|
b0c0ace8fc | |
|
b41cada2d2 | |
|
f5ef8de1cc | |
|
40fde0f69f | |
|
f2b447dad5 | |
|
654638a430 | |
|
c478c11975 | |
|
f665499096 | |
|
c7c1867c82 | |
|
73b446688f | |
|
9fd1948e0d | |
|
d434f84253 | |
|
cd232cde14 | |
|
9db6352d30 | |
|
586def466b | |
|
95471d1cce | |
|
e9328abb68 | |
|
1c7d7a3542 | |
|
7f52f70d22 | |
|
00e78efd84 | |
|
b6e532bf52 | |
|
f8e187b473 | |
|
4eb10f7c9d | |
|
c320c981c5 | |
|
5fd3737aa3 | |
|
84861cd827 | |
|
912256184c | |
|
5ce32c0fe5 | |
|
5af865386a | |
|
868f75e448 | |
|
c84698d4a1 | |
|
52f428a9f1 | |
|
f0ceabc57c | |
|
513d0679a5 | |
|
6bf1b78653 | |
|
24997089da | |
|
2b9832ecb5 | |
|
f2fc0d8787 | |
|
1a8652aa54 | |
|
cbc5c52085 | |
|
be1627267f | |
|
ed27a37678 | |
|
f038b44fe9 | |
|
30d1fcac78 | |
|
4a4059bc85 | |
|
937cfaa64b | |
|
5615b1c185 | |
|
4f28f90fd9 | |
|
f6ebf0e1d6 |
|
@ -5,38 +5,61 @@ body:
|
|||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this bug report!
|
||||
Please make sure to fill out the entire form below,
|
||||
providing as much context as you can in order to help us
|
||||
triage and track down your bug as quickly as possible.
|
||||
> [!IMPORTANT]
|
||||
> **Please read all parts of this form carefully.** By following the instructions carefully, you ensure that we
|
||||
> can get started fixing your bug, instead of being stuck at trying to reproduce your issue. Please provide
|
||||
> all requested information, even if you think it does not apply to your problem.
|
||||
>
|
||||
> **If you use a third-party package that re-distributes OpenTelemetry, open the bug ticket with that third party unless you can provide steps to reproduce this with pure OpenTelemetry.**
|
||||
> Digging into third-party distributions of OpenTelemetry is not in scope for this project.
|
||||
|
||||
Before filing a bug, please be sure you have searched through
|
||||
[existing bugs](https://github.com/open-telemetry/opentelemetry-js/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug)
|
||||
to see if your bug is already addressed.
|
||||
|
||||
If your bug is related to an instrumentation or plugin in [opentelemetry-js-contrib](https://github.com/open-telemetry/opentelemetry-js-contrib)
|
||||
please be sure to file it there.
|
||||
Before filing a bug, please be sure you have searched through [existing open bugs](https://github.com/open-telemetry/opentelemetry-js/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug)
|
||||
to see if this bug has already been filed.
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
## Bug Reproduction
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What happened?
|
||||
description: Please provide as much detail as you reasonably can.
|
||||
description: |
|
||||
> [!IMPORTANT]
|
||||
> **Please provide as much detail as you reasonably can.**
|
||||
> We all know the complexities of developing with JavaScript/TypeScript. **Be specific** about your setup and **DO NOT** assume that the person handling your bug report knows how to use your specific combination of tooling. Always provide build instructions and config files.
|
||||
value: |
|
||||
## Steps to Reproduce
|
||||
|
||||
<!--
|
||||
The most effective way to solve a bug is to provide a link to a reproducer repository. It is extremely difficult to exactly reproduce problems
|
||||
and doing so can take multiple hours for us. You know your tooling and setup and we know OpenTelemetry JavaScript internals.
|
||||
Let's help each other! :)
|
||||
-->
|
||||
## Expected Result
|
||||
|
||||
## Actual Result
|
||||
|
||||
## Additional Details
|
||||
<!--
|
||||
Anything you can think of that will help us reproduce and understand your problem:
|
||||
- details about the behavior of the bug
|
||||
- code to reproduce, if not provided via a repository above (including setting up any frameworks you may be using, we likely don't use the same tech-stack that you're using on the daily)
|
||||
- which tooling you use and how you're using it
|
||||
- config files for your tooling (typescript, bundlers, ...)
|
||||
- how you run your code (example: `node -r otel.js ./index.js`).
|
||||
- which module type you are you using (`module` or `commonjs`)
|
||||
-->
|
||||
|
||||
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: OpenTelemetry Setup Code
|
||||
description: Please provide the code you use to set up OpenTelemetry
|
||||
description: |
|
||||
Please provide the code you use to set up OpenTelemetry.
|
||||
If you use `@opentelemetry/auto-instrumentations-node/register`, please state so here.
|
||||
You may omit this step if you have provided a reproducer repository.
|
||||
placeholder: | # This comes from our README.md
|
||||
// tracing.js
|
||||
// otel.js
|
||||
|
||||
'use strict'
|
||||
|
||||
|
@ -44,15 +67,15 @@ body:
|
|||
const opentelemetry = require('@opentelemetry/sdk-node');
|
||||
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
|
||||
const { ConsoleSpanExporter } = require('@opentelemetry/sdk-trace-base');
|
||||
const { Resource } = require('@opentelemetry/resources');
|
||||
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
|
||||
const { resourceFromAttributes } = require('@opentelemetry/resources');
|
||||
const { ATTR_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
|
||||
|
||||
// configure the SDK to export telemetry data to the console
|
||||
// enable all auto-instrumentations from the meta package
|
||||
const traceExporter = new ConsoleSpanExporter();
|
||||
const sdk = new opentelemetry.NodeSDK({
|
||||
resource: new Resource({
|
||||
[SemanticResourceAttributes.SERVICE_NAME]: 'my-service',
|
||||
resource: resourceFromAttributes({
|
||||
[ATTR_SERVICE_NAME]: 'my-service',
|
||||
}),
|
||||
traceExporter,
|
||||
instrumentations: [getNodeAutoInstrumentations()]
|
||||
|
@ -75,13 +98,15 @@ body:
|
|||
- type: textarea
|
||||
attributes:
|
||||
label: package.json
|
||||
description: If possible, please provide your full package.json. If not, please provide at least your list of dependencies and their versions, especially OpenTelemetry versions.
|
||||
description: |
|
||||
Please provide your the full package.json needed to reproduce the issue.
|
||||
You may omit this step if you provided a reproducer repository.
|
||||
render: "JSON"
|
||||
placeholder: |
|
||||
{
|
||||
"name": "my-app",
|
||||
"scripts": {
|
||||
"start": "node -r tracing.js app.js"
|
||||
"start": "node -r otel.js app.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@opentelemetry/api": "^1.3.0",
|
||||
|
@ -95,3 +120,20 @@ body:
|
|||
description: |
|
||||
Please copy and paste any relevant log output.
|
||||
render: shell
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
## System Details
|
||||
System Details help us when we cannot reproduce your problem with the information provided above. Sometimes bugs only surface on specific platforms and runtime versions.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Operating System and Version
|
||||
placeholder: Ubuntu 24.04, Windows 11 Build 26100.2033, macOS 15.0.1
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Runtime and Version
|
||||
placeholder: Node.js v20.12.1, Node.js v18.18.2, Firefox 130, Chrome 132, ...
|
||||
validations:
|
||||
required: false
|
||||
|
|
|
@ -7,7 +7,7 @@ Before creating a pull request, please make sure:
|
|||
- You have read the guide for contributing
|
||||
- See https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md
|
||||
- You signed all your commits (otherwise we won't be able to merge the PR)
|
||||
- See https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#sign-the-cla
|
||||
- See https://github.com/open-telemetry/community/blob/main/guides/contributor#sign-the-cla
|
||||
- You added unit tests for the new functionality
|
||||
- You mention in the PR description which issue it is addressing, e.g. "Fixes #xxx". This will auto-close
|
||||
the issue that your PR fixes (if such)
|
||||
|
|
|
@ -10,8 +10,8 @@ No changes
|
|||
|
||||
## Collaborators and Teams
|
||||
|
||||
* There is currently no `javascript-triagers` role
|
||||
* `javascript-maintainers` has `Admin` permission
|
||||
- There is currently no `javascript-triagers` role
|
||||
- `javascript-maintainers` has `Admin` permission
|
||||
|
||||
## Branches
|
||||
|
||||
|
@ -19,13 +19,13 @@ No changes
|
|||
|
||||
### `main`
|
||||
|
||||
* Uncheck "Restrict who can push to matching branches"
|
||||
* Check "Require merge queue"
|
||||
* Build concurrency: 5
|
||||
* Minimum pull requests to merge: 1 or after 5 minutes
|
||||
* Maximum pull requests to merge: 5
|
||||
* Check "Only merge non-failing pull requests"
|
||||
* Status check timeout: 60 minutes
|
||||
- Uncheck "Restrict who can push to matching branches"
|
||||
- Check "Require merge queue"
|
||||
- Build concurrency: 5
|
||||
- Minimum pull requests to merge: 1 or after 5 minutes
|
||||
- Maximum pull requests to merge: 5
|
||||
- Check "Only merge non-failing pull requests"
|
||||
- Status check timeout: 60 minutes
|
||||
|
||||
### `dependabot/**/**`
|
||||
|
||||
|
@ -36,10 +36,10 @@ Our dependencies are managed by a bot which creates PRs from a fork.
|
|||
|
||||
This is a special branch which we use to publish the automatically generated docs.
|
||||
It is exempt from most protections.
|
||||
|
||||
* "Allow force pushes from everyone" (requires write permission)
|
||||
|
||||
- "Allow force pushes from everyone" (requires write permission)
|
||||
|
||||
## Pages
|
||||
|
||||
* Source: Deploy from a branch
|
||||
* Branch: `gh-pages` `/ (root)`
|
||||
- Source: Deploy from a branch
|
||||
- Branch: `gh-pages` `/ (root)`
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
name: Benchmark Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
benchmark-tests:
|
||||
permissions:
|
||||
contents: write # required for pushing benchmark results to gh-pages
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node_version:
|
||||
- "22"
|
||||
runs-on: equinix-bare-metal
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
NPM_CONFIG_UNSAFE_PERM: true
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
node-version: ${{ matrix.node_version }}
|
||||
|
||||
- run: npm install -g npm@latest
|
||||
|
||||
- name: Bootstrap
|
||||
run: npm ci
|
||||
|
||||
- name: Build 🔧
|
||||
run: npm run compile
|
||||
|
||||
- name: Benchmark tests
|
||||
run: |
|
||||
npm run test:bench
|
||||
find . -name .benchmark-results.txt -exec cat {} + > combined_benchmarks.txt
|
||||
|
||||
- name: Store benchmark results
|
||||
uses: benchmark-action/github-action-benchmark@v1
|
||||
with:
|
||||
tool: 'benchmarkjs'
|
||||
output-file-path: combined_benchmarks.txt
|
||||
gh-pages-branch: gh-pages
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
benchmark-data-dir-path: "benchmarks"
|
||||
auto-push: true
|
|
@ -1,4 +1,4 @@
|
|||
# This action requires that any PR targeting the main branch should touch at
|
||||
# This action requires that any PR targeting the main and next branch should touch at
|
||||
# least one CHANGELOG file. If a CHANGELOG entry is not required, add the "Skip
|
||||
# Changelog" label to disable this action.
|
||||
|
||||
|
@ -9,6 +9,9 @@ on:
|
|||
types: [opened, synchronize, reopened, labeled, unlabeled]
|
||||
branches:
|
||||
- main
|
||||
- next
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
changelog:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -3,11 +3,17 @@ on:
|
|||
schedule:
|
||||
- cron: '30 6 * * 1'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
permissions:
|
||||
issues: write # required for closing stale issues
|
||||
pull-requests: write # required for closing stale PRs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v8
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
days-before-stale: 60
|
||||
days-before-close: 14
|
||||
|
|
|
@ -2,20 +2,17 @@ name: "CodeQL Analysis"
|
|||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# ┌───────────── minute (0 - 59)
|
||||
# │ ┌───────────── hour (0 - 23)
|
||||
# │ │ ┌───────────── day of the month (1 - 31)
|
||||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
||||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# │ │ │ │ │
|
||||
# * * * * *
|
||||
- cron: '30 1 * * *'
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
permissions:
|
||||
security-events: write
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
@ -24,12 +21,12 @@ jobs:
|
|||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: javascript
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
name: Create or Update Release PR
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release_type:
|
||||
type: choice
|
||||
description: Release type
|
||||
options:
|
||||
- patch
|
||||
- minor
|
||||
release_scope:
|
||||
type: choice
|
||||
description: Release Scope
|
||||
options:
|
||||
- experimental # all packages in experimental/packages
|
||||
- sdk # all SDK packages, experimental and stable, excluding semantic conventions
|
||||
- all # all release packages, including API, excluding semconv
|
||||
- semconv # only semantic convention package
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
create-or-update-release-pr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fork
|
||||
run: gh repo fork open-telemetry/opentelemetry-js
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: opentelemetrybot/opentelemetry-js
|
||||
ref: main
|
||||
token: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
|
||||
- name: Sync with upstream
|
||||
run: |
|
||||
git remote show origin
|
||||
git remote add upstream https://github.com/open-telemetry/opentelemetry-js.git
|
||||
git fetch upstream
|
||||
git reset --hard upstream/main
|
||||
git push origin main --force
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
cache: 'npm'
|
||||
cache-dependency-path: package-lock.json
|
||||
node-version: 22
|
||||
- run: npm install -g npm@latest
|
||||
|
||||
- run: npm ci
|
||||
|
||||
- name: Create/Update Release PR
|
||||
run: |
|
||||
git config user.name opentelemetrybot
|
||||
git config user.email 107717825+opentelemetrybot@users.noreply.github.com
|
||||
npm run github:create_or_update_release_pr
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
|
||||
RELEASE_SCOPE: ${{ github.event.inputs.release_scope }}
|
||||
RELEASE_KIND: ${{ github.event.inputs.release_scope }}:${{ github.event.inputs.release_type }}
|
||||
RELEASE_PR_REMOTE: origin
|
||||
RELEASE_PR_OWNER: opentelemetrybot
|
|
@ -4,42 +4,28 @@ on:
|
|||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
permissions:
|
||||
contents: write # required for deploying documentation to gh-pages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '14'
|
||||
|
||||
- name: restore lock files
|
||||
uses: actions/cache@master # must use unreleased master to cache multiple paths
|
||||
id: cache
|
||||
with:
|
||||
# must be done before bootstrap to not include node_modules files in the cache paths
|
||||
path: |
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
packages/*/package-lock.json
|
||||
backwards-compatibility/*/package-lock.json
|
||||
metapackages/*/package-lock.json
|
||||
packages/*/package-lock.json
|
||||
integration-tests/*/package-lock.json
|
||||
key: ${{ runner.os }}-unit_test-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
|
||||
- name: Install and Build (cache miss) 🔧
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install --ignore-scripts
|
||||
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
|
||||
npm run compile
|
||||
node-version: '22'
|
||||
|
||||
- name: Install and Build (cache hit) 🔧
|
||||
if: steps.cache.outputs.cache-hit == 'true'
|
||||
- name: Install and Build 🔧
|
||||
run: |
|
||||
npm ci --ignore-scripts
|
||||
npx lerna bootstrap --hoist --nohoist='zone.js'
|
||||
npm ci
|
||||
npm run compile
|
||||
|
||||
- name: Build Docs
|
||||
|
@ -48,8 +34,10 @@ jobs:
|
|||
NODE_OPTIONS: --max-old-space-size=6144
|
||||
|
||||
- name: Deploy Documentation 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BRANCH: gh-pages # The branch the action should deploy to.
|
||||
FOLDER: docs # The folder the action should deploy.
|
||||
branch: gh-pages # The branch the action should deploy to.
|
||||
folder: docs # The folder the action should deploy.
|
||||
# ensure we don't override benchmark data
|
||||
clean-exclude: |
|
||||
benchmarks/**
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
name: E2E Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
e2e-tests:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node_version:
|
||||
- "18.19.0"
|
||||
- "18"
|
||||
- "20.6.0"
|
||||
- "20"
|
||||
- "22"
|
||||
- "23"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
node-version: ${{ matrix.node_version }}
|
||||
|
||||
# npm@11.0.0 drops support for Node.js v18
|
||||
# Install the latest npm compatible with this version of Node.js
|
||||
# - npm@11.1.0 supports: {"node":"^20.17.0 || >=22.9.0"}
|
||||
- run: npm install -g npm@"<11.0.0"
|
||||
if: ${{
|
||||
matrix.node_version == '18.19.0' ||
|
||||
matrix.node_version == '18' ||
|
||||
matrix.node_version == '20.6.0'
|
||||
}}
|
||||
- run: npm install -g npm@latest
|
||||
if: ${{
|
||||
matrix.node_version == '20' ||
|
||||
matrix.node_version == '22' ||
|
||||
matrix.node_version == '23'
|
||||
}}
|
||||
|
||||
- name: Bootstrap
|
||||
run: npm ci
|
||||
|
||||
- name: Build 🔧
|
||||
run: npm run compile
|
||||
|
||||
- name: Install collector
|
||||
run: |
|
||||
curl -sSL -o otelcol-contrib.tar.gz https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.126.0/otelcol-contrib_0.126.0_linux_amd64.tar.gz
|
||||
tar -xzf otelcol-contrib.tar.gz
|
||||
working-directory: e2e-tests
|
||||
- name: run collector in background
|
||||
run: |
|
||||
./otelcol-contrib --config collector-config.yaml &
|
||||
working-directory: e2e-tests
|
||||
- name: Export telemetry to collector
|
||||
run: npm run export-telemetry
|
||||
working-directory: e2e-tests
|
||||
- name: stop collector
|
||||
run: pkill -f otelcol-contrib
|
||||
working-directory: e2e-tests
|
||||
- name: Print output
|
||||
run: cat collector-output.json
|
||||
working-directory: e2e-tests
|
||||
- name: verify exported telemetry
|
||||
run: npm run verify
|
||||
working-directory: e2e-tests
|
|
@ -0,0 +1,20 @@
|
|||
name: FOSSA scanning
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
fossa:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
|
||||
with:
|
||||
api-key: ${{secrets.FOSSA_API_KEY}}
|
||||
team: OpenTelemetry
|
|
@ -1,12 +0,0 @@
|
|||
on:
|
||||
pull_request_target:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
label-release:
|
||||
if: ${{ startsWith(github.event.pull_request.title, 'release:') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo this is a release PR
|
||||
- run: gh pr edit ${{ github.event.pull_request.number }} --add-label release
|
|
@ -7,51 +7,25 @@ on:
|
|||
pull_request:
|
||||
merge_group:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '16'
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Lint changelog file
|
||||
uses: avto-dev/markdown-lint@v1
|
||||
with:
|
||||
# Commenting due to
|
||||
# https://github.com/avto-dev/markdown-lint/blob/aab9be9823fcd706f6da3e6ad6c64874c23fbd4c/lint/rules/changelog.js#L51-L71
|
||||
# TODO: adhere to, or overwrite above rule and uncomment rules
|
||||
# rules: "/lint/rules/changelog.js"
|
||||
config: "/lint/config/changelog.yml"
|
||||
args: "./CHANGELOG.md"
|
||||
|
||||
- name: Lint markdown files
|
||||
uses: avto-dev/markdown-lint@v1
|
||||
with:
|
||||
args: "./**/*.md"
|
||||
ignore: './CHANGELOG.md ./experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/protos ./experimental/packages/opentelemetry-exporter-metrics-otlp-proto/protos ./packages/exporter-trace-otlp-grpc/protos ./packages/exporter-trace-otlp-proto/protos'
|
||||
|
||||
- name: restore lerna
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
packages/*/node_modules
|
||||
packages/*/package-lock.json
|
||||
experimental/packages/*/node_modules
|
||||
experimental/packages/*/package-lock.json
|
||||
key: lint-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04142022
|
||||
node-version: '22'
|
||||
|
||||
# On a cache miss, install dependencies
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
npm install --ignore-scripts
|
||||
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
name: OSSF Scorecard
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
schedule:
|
||||
- cron: "44 18 * * 6" # once a week
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed for Code scanning upload
|
||||
security-events: write
|
||||
# Needed for GitHub OIDC token if publish_results is true
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
publish_results: true
|
||||
|
||||
# Upload the results as artifacts (optional). Commenting out will disable
|
||||
# uploads of run results in SARIF format to the repository Actions tab.
|
||||
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard (optional).
|
||||
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
|
||||
with:
|
||||
sarif_file: results.sarif
|
|
@ -7,20 +7,23 @@ on:
|
|||
pull_request:
|
||||
merge_group:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
peer-api-check:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:20
|
||||
image: node:22
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install lerna
|
||||
run: npm install -g lerna
|
||||
run: npm install -g lerna@6.6.2
|
||||
|
||||
- name: Install semver
|
||||
run: npm install semver
|
||||
run: npm install -g semver
|
||||
|
||||
- name: Check API dependency semantics
|
||||
working-directory: packages
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
name: Publish packages to NPM
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
release-to-npm:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# needed for NPM provenance
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- run: npm ci
|
||||
|
||||
# NOTE: in the past, we've had situations where the compiled files were missing as the `prepublishOnly` script was
|
||||
# missing in some packages. `npx lerna publish` *should* also run compile, but this is intended as a safeguard
|
||||
# when that does not happen for whatever reason.
|
||||
- run: npm run compile
|
||||
|
||||
- name: Publish to npm
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
NPM_CONFIG_PROVENANCE: true
|
||||
# NOTE: using --concurrency 1 to reduce the likelihood of a race when publishing,
|
||||
# which happens when the npm registry is not fully consistent yet. This can cause the publishing of a package to be
|
||||
# rejected because dependencies are not available yet. `lerna` does ensure that this is not the case locally
|
||||
# (packages are in-fact published in the correct order), but the race on the registry still applies.
|
||||
# If this happens, run the workflow again - there should be enough time for everything to settle until this workflow
|
||||
# attempts to publish again.
|
||||
run: npx lerna publish --concurrency 1 from-package --no-push --no-private --no-git-tag-version --no-verify-access --dist-tag=latest --yes
|
|
@ -0,0 +1,79 @@
|
|||
name: SBOM
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
generate-sboms:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NPM_CONFIG_UNSAFE_PERM: true
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- run: npm install -g npm@latest
|
||||
|
||||
- name: Bootstrap
|
||||
run: npm ci
|
||||
|
||||
- name: Generate SBOM for core packages
|
||||
if: ${{ ! startsWith(github.ref, 'refs/tags/experimental') && ! startsWith(github.ref, 'refs/tags/api') }}
|
||||
run: |
|
||||
for dir in $(find packages -mindepth 1 -maxdepth 1 -type d)
|
||||
do
|
||||
dir_name=$(basename "$dir")
|
||||
echo "Generating SBOM for $dir_name"
|
||||
npm sbom --sbom-format=spdx --legacy-peer-deps --workspace ${dir} > "opentelemetry-js_${dir_name}.spdx.json"
|
||||
done
|
||||
|
||||
- name: Generate SBOM for the API package
|
||||
if: startsWith(github.ref, 'refs/tags/api/')
|
||||
run: |
|
||||
npm sbom --sbom-format=spdx --legacy-peer-deps --workspace api > opentelemetry-js_api.spdx.json
|
||||
|
||||
- name: Generate SBOMs for experimental packages
|
||||
if: startsWith(github.ref, 'refs/tags/experimental/')
|
||||
run: |
|
||||
for dir in $(find experimental/packages -mindepth 1 -maxdepth 1 -type d)
|
||||
do
|
||||
dir_name=$(basename "$dir")
|
||||
echo "Generating SBOM for $dir_name"
|
||||
npm sbom --sbom-format=spdx --legacy-peer-deps --workspace ${dir} > "opentelemetry-js_${dir_name}.spdx.json"
|
||||
done
|
||||
|
||||
- name: Zip all SBOM files
|
||||
run: |
|
||||
zip sbom.zip *.spdx.json
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: SBOM.zip
|
||||
path: ./sbom.zip
|
||||
|
||||
add-release-artifact:
|
||||
needs: generate-sboms
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Download artifact from generate-sboms
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: SBOM.zip
|
||||
- name: Upload release asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: ./sbom.zip
|
||||
asset_name: SBOM.zip
|
||||
asset_content_type: application/zip
|
|
@ -0,0 +1,44 @@
|
|||
name: Survey on Merged PR by Non-Member
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [closed]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
PR_NUM: ${{ github.event.pull_request.number }}
|
||||
SURVEY_URL: https://docs.google.com/forms/d/e/1FAIpQLSf2FfCsW-DimeWzdQgfl0KDzT2UEAqu69_f7F2BVPSxVae1cQ/viewform?entry.1540511742=open-telemetry/opentelemetry-js
|
||||
|
||||
jobs:
|
||||
comment-on-pr:
|
||||
name: Add survey to PR if author is not a member
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
if: github.event.pull_request.merged == true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check if user is a member of the org
|
||||
id: check-membership
|
||||
run: |
|
||||
USERNAME=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH")
|
||||
ORG="${{ github.repository_owner }}"
|
||||
STATUS=$(gh api "orgs/$ORG/members/$USERNAME" --silent && echo "true" || echo "false")
|
||||
if [[ "$STATUS" == "true" ]]; then
|
||||
echo "MEMBER_FOUND=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "MEMBER_FOUND=false" >> $GITHUB_ENV
|
||||
fi
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
|
||||
|
||||
- name: Add comment to PR if author is not a member
|
||||
if: env.MEMBER_FOUND == 'false'
|
||||
run: |
|
||||
USERNAME=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH")
|
||||
gh pr comment ${PR_NUM} --repo open-telemetry/opentelemetry-js --body "Thank you for your contribution @${USERNAME}! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this [survey](${SURVEY_URL})."
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
|
|
@ -6,15 +6,22 @@ on:
|
|||
pull_request:
|
||||
merge_group:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
node-tests:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node_version:
|
||||
- "14"
|
||||
- "16"
|
||||
- "18.19.0"
|
||||
- "18"
|
||||
- "20.6.0"
|
||||
- "20"
|
||||
- "22"
|
||||
- "23"
|
||||
- "24"
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NPM_CONFIG_UNSAFE_PERM: true
|
||||
|
@ -22,53 +29,51 @@ jobs:
|
|||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
node-version: ${{ matrix.node_version }}
|
||||
|
||||
# npm@11.0.0 drops support for Node.js v18
|
||||
# Install the latest npm compatible with this version of Node.js
|
||||
# - npm@11.1.0 supports: {"node":"^20.17.0 || >=22.9.0"}
|
||||
- run: npm install -g npm@"<11.0.0"
|
||||
if: ${{
|
||||
matrix.node_version == '18.19.0' ||
|
||||
matrix.node_version == '18' ||
|
||||
matrix.node_version == '20.6.0'
|
||||
}}
|
||||
- run: npm install -g npm@latest
|
||||
if: ${{ matrix.node_version == '18' || matrix.node_version == '20' }}
|
||||
|
||||
# npm@10.0.0 drops support for Node.js v14 and v16
|
||||
- run: npm install -g npm@"<10.0.0"
|
||||
if: ${{ matrix.node_version == '14' || matrix.node_version == '16' }}
|
||||
|
||||
- name: restore lerna
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
package-lock.json
|
||||
packages/*/node_modules
|
||||
packages/*/package-lock.json
|
||||
experimental/packages/*/node_modules
|
||||
experimental/packages/*/package-lock.json
|
||||
key: node-tests-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022
|
||||
|
||||
# temporary fix for https://github.com/nrwl/nx/issues/19022
|
||||
- run: npm install --save-dev nx@16.7.4 @nx/devkit@16.7.4
|
||||
if: ${{ matrix.node_version == '14' }}
|
||||
if: ${{
|
||||
matrix.node_version == '20' ||
|
||||
matrix.node_version == '22' ||
|
||||
matrix.node_version == '23' ||
|
||||
matrix.node_version == '24'
|
||||
}}
|
||||
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
npm install --ignore-scripts
|
||||
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
|
||||
run: npm ci
|
||||
|
||||
- name: Build 🔧
|
||||
run: |
|
||||
npm run compile
|
||||
run: npm run compile
|
||||
|
||||
- run: npm test
|
||||
if: ${{ matrix.node_version != '23' && matrix.node_version != '24' }}
|
||||
# Node.js >= 23 type stripping conflicts with mocha usage of ts-node.
|
||||
# See https://github.com/open-telemetry/opentelemetry-js/issues/5415
|
||||
- run: npm test
|
||||
env:
|
||||
NODE_OPTIONS: '--no-experimental-strip-types'
|
||||
if: ${{ matrix.node_version == '23' || matrix.node_version == '24' }}
|
||||
|
||||
- name: Unit tests
|
||||
run: |
|
||||
# TODO(legendecas): webpack https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported
|
||||
if [ "${{ matrix.node_version }}" = "18" ]; then
|
||||
export NODE_OPTIONS=--openssl-legacy-provider
|
||||
fi
|
||||
npm run test
|
||||
- name: Report Coverage
|
||||
run: npm run codecov
|
||||
if: ${{ matrix.node_version == '14' }}
|
||||
uses: codecov/codecov-action@v5
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
with:
|
||||
verbose: true
|
||||
node-windows-tests:
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
|
@ -77,29 +82,17 @@ jobs:
|
|||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
node-version: '22'
|
||||
|
||||
- run: npm install -g npm@latest
|
||||
|
||||
- name: restore lerna
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
package-lock.json
|
||||
packages/*/node_modules
|
||||
packages/*/package-lock.json
|
||||
experimental/packages/*/node_modules
|
||||
experimental/packages/*/package-lock.json
|
||||
key: node-windows-tests-${{ runner.os }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}
|
||||
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
npm install --ignore-scripts
|
||||
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
|
||||
run: npm ci
|
||||
|
||||
- name: Build 🔧
|
||||
run: |
|
||||
|
@ -107,8 +100,6 @@ jobs:
|
|||
npm run compile
|
||||
|
||||
- name: Unit tests
|
||||
env:
|
||||
NODE_OPTIONS: --openssl-legacy-provider
|
||||
run: npm run test
|
||||
browser-tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -118,103 +109,52 @@ jobs:
|
|||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: restore lerna
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
packages/*/node_modules
|
||||
packages/*/package-lock.json
|
||||
experimental/packages/*/node_modules
|
||||
experimental/packages/*/package-lock.json
|
||||
key: browser-tests-${{ runner.os }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022
|
||||
node-version: 22
|
||||
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
npm install --ignore-scripts
|
||||
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
|
||||
run: npm ci
|
||||
|
||||
- name: Build 🔧
|
||||
run: |
|
||||
npm run compile
|
||||
run: npm run compile
|
||||
|
||||
- name: Unit tests
|
||||
run: npm run test:browser
|
||||
- name: Report Coverage
|
||||
run: npm run codecov:browser
|
||||
uses: codecov/codecov-action@v5
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
with:
|
||||
verbose: true
|
||||
webworker-tests:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NPM_CONFIG_UNSAFE_PERM: true
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.0.0
|
||||
- uses: actions/setup-node@v3
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: restore lerna
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
packages/*/node_modules
|
||||
packages/*/package-lock.json
|
||||
experimental/packages/*/node_modules
|
||||
experimental/packages/*/package-lock.json
|
||||
key: webworker-tests-${{ runner.os }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022
|
||||
node-version: 22
|
||||
|
||||
- name: Bootstrap
|
||||
run: |
|
||||
npm install --ignore-scripts
|
||||
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
|
||||
run: npm ci
|
||||
|
||||
- name: Build 🔧
|
||||
run: |
|
||||
npm run compile
|
||||
run: npm run compile
|
||||
|
||||
- name: Unit tests
|
||||
run: npm run test:webworker
|
||||
- name: Report Coverage
|
||||
run: npm run codecov:webworker
|
||||
api-eol-node-test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node_version:
|
||||
- "8"
|
||||
- "10"
|
||||
- "12"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
uses: codecov/codecov-action@v5
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
|
||||
- name: Build
|
||||
working-directory: ./api
|
||||
run: |
|
||||
npm install --ignore-scripts
|
||||
npm install @types/mocha@^7 mocha@^7 ts-loader@^8 ts-mocha@^8
|
||||
node ../scripts/version-update.js
|
||||
npx tsc --build tsconfig.json tsconfig.esm.json
|
||||
|
||||
- name: Test
|
||||
working-directory: ./api
|
||||
# running test:eol as node 8 is not supported anymore by the version of nyc we use, as we don't report coverage
|
||||
# for this step we leave it out.
|
||||
# Details: nyc requires istanbul-lib-report, which silently dropped support for Node.js v8 when going from
|
||||
# 3.0.0 to 3.0.1 by requiring make-dir@^4.0.0 to fix https://github.com/advisories/GHSA-c2qf-rxjj-qqgw.
|
||||
# make-dir does not support Node.js v8 anymore.
|
||||
run: npm run test:eol
|
||||
verbose: true
|
||||
|
|
|
@ -7,6 +7,9 @@ on:
|
|||
pull_request:
|
||||
merge_group:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -14,37 +17,18 @@ jobs:
|
|||
- name: Checkout 🛎️
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '16'
|
||||
|
||||
- name: restore lock files
|
||||
uses: actions/cache@master # must use unreleased master to cache multiple paths
|
||||
id: cache
|
||||
with:
|
||||
# must be done before bootstrap to not include node_modules files in the cache paths
|
||||
path: |
|
||||
cache: 'npm'
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
packages/*/package-lock.json
|
||||
metapackages/*/package-lock.json
|
||||
packages/*/package-lock.json
|
||||
integration-tests/*/package-lock.json
|
||||
key: ${{ runner.os }}-w3c_integration-${{ hashFiles('**/package.json') }}
|
||||
node-version: 18
|
||||
|
||||
- name: Install and Bootstrap (cache miss) 🔧
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm install --ignore-scripts
|
||||
npx lerna bootstrap --no-ci --hoist --scope=propagation-validation-server --include-dependencies
|
||||
|
||||
- name: Install and Bootstrap (cache hit) 🔧
|
||||
if: steps.cache.outputs.cache-hit == 'true'
|
||||
run: |
|
||||
npm ci --ignore-scripts
|
||||
npx lerna bootstrap --hoist --scope=propagation-validation-server --include-dependencies
|
||||
- name: Install and Bootstrap 🔧
|
||||
run: npm ci
|
||||
|
||||
- name: Generate version.ts files
|
||||
run: lerna run version
|
||||
run: npm run version:update
|
||||
|
||||
- name: Build 🔧
|
||||
run: npm run compile
|
||||
|
|
|
@ -66,7 +66,6 @@ typings/
|
|||
|
||||
# lock files
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
|
||||
# docs files
|
||||
docs
|
||||
|
@ -89,3 +88,9 @@ package.json.lerna_backup
|
|||
#IDEA
|
||||
.idea
|
||||
*.iml
|
||||
|
||||
# non-aggregated benchmark results
|
||||
.benchmark-results.txt
|
||||
|
||||
# release notes for release creation
|
||||
.tmp/
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
[submodule "experimental/packages/otlp-grpc-exporter-base/protos"]
|
||||
path = experimental/packages/otlp-grpc-exporter-base/protos
|
||||
url = https://github.com/open-telemetry/opentelemetry-proto.git
|
||||
[submodule "experimental/packages/otlp-proto-exporter-base/protos"]
|
||||
path = experimental/packages/otlp-proto-exporter-base/protos
|
||||
[submodule "experimental/packages/otlp-transformer/protos"]
|
||||
path = experimental/packages/otlp-transformer/protos
|
||||
url = https://github.com/open-telemetry/opentelemetry-proto.git
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
// https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2jsonc
|
||||
{
|
||||
"config": {
|
||||
// https://github.com/DavidAnson/markdownlint/blob/main/README.md#rules--aliases
|
||||
"MD013": false,
|
||||
"MD024": false,
|
||||
"MD033": false,
|
||||
"MD041": false,
|
||||
"MD026": false,
|
||||
"MD004": { "style": "dash" } // ul-style
|
||||
},
|
||||
"gitignore": true,
|
||||
"noBanner": true,
|
||||
"noProgress": true
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"MD013": false,
|
||||
"MD024": false,
|
||||
"MD033": false,
|
||||
"MD041": false,
|
||||
"MD026": false
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
require: 'ts-node/register'
|
1
.nycrc
1
.nycrc
|
@ -3,6 +3,7 @@
|
|||
"extension": [
|
||||
".ts"
|
||||
],
|
||||
"reporter": ["text", "json"],
|
||||
"exclude": [
|
||||
"**/*.d.ts",
|
||||
"build/**/*.*",
|
||||
|
|
490
CHANGELOG.md
490
CHANGELOG.md
|
@ -1,22 +1,498 @@
|
|||
<!-- markdownlint-disable MD004 -->
|
||||
# CHANGELOG
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
For API changes, see the [API CHANGELOG](api/CHANGELOG.md).
|
||||
For experimental package changes, see the [experimental CHANGELOG](experimental/CHANGELOG.md).
|
||||
For semantic convention package changes, see the [semconv CHANGELOG](semantic-conventions/CHANGELOG.md).
|
||||
For notes on migrating to 2.x / 0.200.x see [the upgrade guide](doc/upgrade-to-2.x.md).
|
||||
|
||||
## Unreleased
|
||||
|
||||
* feat(instrumentation-http): Added support for redacting specific url query string values and url credentials in instrumentations [#5743](https://github.com/open-telemetry/opentelemetry-js/pull/5743) @rads-1996
|
||||
|
||||
### :boom: Breaking Changes
|
||||
|
||||
### :rocket: Features
|
||||
|
||||
### :bug: Bug Fixes
|
||||
|
||||
* fix(sdk-metrics): Remove invalid default value for `startTime` param to ExponentialHistogramAccumulation. This only impacted the closurescript compiler. [#5763](https://github.com/open-telemetry/opentelemetry-js/pull/5763) @trentm
|
||||
|
||||
### :books: Documentation
|
||||
|
||||
### :house: Internal
|
||||
|
||||
* chore: enable tsconfig isolatedModules [#5697](https://github.com/open-telemetry/opentelemetry-js/pull/5697) @legendecas
|
||||
|
||||
## 2.0.1
|
||||
|
||||
### :bug: Bug Fixes
|
||||
|
||||
* fix(resources): guard asynchronous resource attribute rejections from causing unhandled promise rejection [#5544](https://github.com/open-telemetry/opentelemetry-js/pull/5544) @dyladan
|
||||
* fix(resource): do not trigger `Accessing resource attributes before async attributes settled` warning when detecting resources [#5546](https://github.com/open-telemetry/opentelemetry-js/pull/5546) @dyladan
|
||||
* verbose logging of detected resource removed
|
||||
* fix(resource): use dynamic import over require to improve ESM compliance [#5298](https://github.com/open-telemetry/opentelemetry-js/pull/5298) @xiaoxiangmoe
|
||||
|
||||
### :books: Documentation
|
||||
|
||||
* refactor(metrics): Updated metrics samples to no longer treat `sdk.start()` as async [#5617](https://github.com/open-telemetry/opentelemetry-js/pull/5617) @JacksonWeber
|
||||
|
||||
### :house: Internal
|
||||
|
||||
* refactor(sdk-trace-base): update semconv usage to ATTR_ exports [#5669](https://github.com/open-telemetry/opentelemetry-js/pull/5669) @trentm
|
||||
* refactor(sdk-trace-web): update semconv usage to ATTR_ exports [#5672](https://github.com/open-telemetry/opentelemetry-js/pull/5672) @trentm
|
||||
* refactor(resources): update semconv usage to ATTR_ exports [#5666](https://github.com/open-telemetry/opentelemetry-js/pull/5666) @trentm
|
||||
* test(sdk-metrics): fix multiple problematic assertRejects() calls [#5611](https://github.com/open-telemetry/opentelemetry-js/pull/5611) @cjihrig
|
||||
* refactor: replace assertRejects() with assert.rejects() [#5614](https://github.com/open-telemetry/opentelemetry-js/pull/5614) @cjihrig
|
||||
* refactor(core): migrate from deprecated semconv constants [#5575](https://github.com/open-telemetry/opentelemetry-js/pull/5575) @alumni55748
|
||||
* refactor(opentelemetry-core): simplify `parseKeyPairsIntoRecord()` [#5610](https://github.com/open-telemetry/opentelemetry-js/pull/5610) @cjihrig
|
||||
|
||||
## 2.0.0
|
||||
|
||||
### Summary
|
||||
|
||||
- The **minimum supported Node.js has been raised to `^18.19.0 || >=20.6.0`**. This means that support for Node.js 14 and 16 has been dropped.
|
||||
- The **minimum supported TypeScript version has been raised to 5.0.4**.
|
||||
- The **compilation target for transpiled TypeScript has been raised to ES2022** (from ES2017).
|
||||
- The **public interface has changed**
|
||||
- for notes on migrating to 2.x / 0.200.x see [the upgrade guide](https://github.com/open-telemetry/opentelemetry-js/tree/main/doc/upgrade-to-2.x.md)
|
||||
- Only experimental versions `0.200.0` are compatible with this release
|
||||
|
||||
### :boom: Breaking Change
|
||||
|
||||
* feat(sdk-trace-base)!: Add `parentSpanContext` and remove `parentSpanId` from `Span` and `ReadableSpan` [#5450](https://github.com/open-telemetry/opentelemetry-js/pull/5450) @JacksonWeber
|
||||
* (user-facing): the SDK's `Span`s `parentSpanId` was replaced by `parentSpanContext`, to migrate to the new property, please replace `span.parentSpanId` -> `span.parentSpanContext?.spanId`
|
||||
* feat(sdk-metrics)!: drop deprecated `type` field on `MetricDescriptor` [#5291](https://github.com/open-telemetry/opentelemetry-js/pull/5291) @chancancode
|
||||
* feat(sdk-metrics)!: drop deprecated `InstrumentDescriptor` type; use `MetricDescriptor` instead [#5277](https://github.com/open-telemetry/opentelemetry-js/pull/5266) @chancancode
|
||||
* feat(sdk-metrics)!: bump minimum version of `@opentelemetry/api` peer dependency to 1.9.0 [#5254](https://github.com/open-telemetry/opentelemetry-js/pull/5254) @chancancode
|
||||
* chore(shim-opentracing): replace deprecated SpanAttributes [#4430](https://github.com/open-telemetry/opentelemetry-js/pull/4430) @JamieDanielson
|
||||
* chore(otel-core): replace deprecated SpanAttributes [#4408](https://github.com/open-telemetry/opentelemetry-js/pull/4408) @JamieDanielson
|
||||
* feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option [#4419](https://github.com/open-telemetry/opentelemetry-js/pull/4419) @pichlermarc
|
||||
* chore(otel-resources): replace deprecated SpanAttributes [#4428](https://github.com/open-telemetry/opentelemetry-js/pull/4428) @JamieDanielson
|
||||
* feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option [#4419](https://github.com/open-telemetry/opentelemetry-js/pull/4419) @pichlermarc
|
||||
* feat(sdk-metrics)!: replace attributeKeys with custom processors option [#4532](https://github.com/open-telemetry/opentelemetry-js/pull/4532) @pichlermarc
|
||||
* refactor(sdk-trace-base)!: replace `SpanAttributes` with `Attributes` [#5009](https://github.com/open-telemetry/opentelemetry-js/pull/5009) @david-luna
|
||||
* refactor(resources)!: replace `ResourceAttributes` with `Attributes` [#5016](https://github.com/open-telemetry/opentelemetry-js/pull/5016) @david-luna
|
||||
* feat(sdk-metrics)!: drop `View` and `Aggregation` in favor of `ViewOptions` and `AggregationOption` [#4931](https://github.com/open-telemetry/opentelemetry-js/pull/4931) @pichlermarc
|
||||
* refactor(sdk-trace-base)!: remove `new Span` constructor in favor of `Tracer.startSpan` API [#5048](https://github.com/open-telemetry/opentelemetry-js/pull/5048) @david-luna
|
||||
* refactor(sdk-trace-base)!: remove `BasicTracerProvider.addSpanProcessor` API in favor of constructor options. [#5134](https://github.com/open-telemetry/opentelemetry-js/pull/5134) @david-luna
|
||||
* refactor(sdk-trace-base)!: make `resource` property private in `BasicTracerProvider` and remove `getActiveSpanProcessor` API. [#5192](https://github.com/open-telemetry/opentelemetry-js/pull/5192) @david-luna
|
||||
* feat(sdk-metrics)!: extract `IMetricReader` interface and use it over abstract class [#5311](https://github.com/open-telemetry/opentelemetry-js/pull/5311)
|
||||
* (user-facing): `MeterProviderOptions` now provides the more general `IMetricReader` type over `MetricReader`
|
||||
* If you accept `MetricReader` in your public interface, consider accepting the more general `IMetricReader` instead to avoid unintentional breaking changes
|
||||
* feat(sdk-trace)!: remove ability to have BasicTracerProvider instantiate exporters [#5239](https://github.com/open-telemetry/opentelemetry-js/pull/5239) @pichlermarc
|
||||
* When extending `BasicTracerProvider`, the class offered multiple methods to facilitate the creation of exporters and auto-pairing with `SpanProcessor`s.
|
||||
* This functionality has been removed - users may now pass `SpanProcessor`s to the base class constructor when extending
|
||||
* (user-facing): `_registeredExporters` has been removed
|
||||
* (user-facing): `_getSpanExporter` has been removed
|
||||
* (user-facing): `_buildExporterFromEnv` has been removed
|
||||
* feat(core)!: remove deprecated `IdGenerator` and `RandomIdGenerator` [#5309](https://github.com/open-telemetry/opentelemetry-js/pull/5309) @pichlermarc
|
||||
* feat(core)!: remove deprecated type `InstrumentationLibrary` [#5308](https://github.com/open-telemetry/opentelemetry-js/pull/5308) @pichlermarc
|
||||
* (user-facing): please use equivalent type `InstrumentationScope` instead
|
||||
* feat(sdk-trace-base)!: replace usages fo `InstrumentationLibrary` with `InstrumentationScope` [#5308](https://github.com/open-telemetry/opentelemetry-js/pull/5308) @pichlermarc
|
||||
* (user-facing) rename `Tracer.instrumentationLibrary` -> `Tracer.instrumentationScope`
|
||||
* (user-facing) rename `ReadableSpan.instrumentationLibrary` -> `ReadableSpan.instrumentationScope`
|
||||
* also renames the property in implementations of `ReadableSpan`
|
||||
* feat(exporter-jaeger): use `ReadableSpan.instrumentationScope` over `ReadableSpan.instrumentationLibrary` [#5308](https://github.com/open-telemetry/opentelemetry-js/pull/5308) @pichlermarc
|
||||
* feat(exporter-zipkin): use `ReadableSpan.instrumentationScope` over `ReadableSpan.instrumentationLibrary` [#5308](https://github.com/open-telemetry/opentelemetry-js/pull/5308) @pichlermarc
|
||||
* chore!: update typescript to version `5.0.4` [#5145](https://github.com/open-telemetry/opentelemetry-js/pull/5145) @david-luna
|
||||
* (user-facing) dropped support for `typescript@<5.0.4`
|
||||
* (user-facing) all packages published from this repository will from now on drop support for old versions of `typescript` in minor releases. We will only drop support for versions that are older than 2 years.
|
||||
* feat(core)!: remove deprecated samplers [#5316](https://github.com/open-telemetry/opentelemetry-js/pull/5316) @pichlermarc
|
||||
* (user-facing): deprecated `AlwaysOnSampler` has moved to `@opentelemetry/sdk-trace-base`
|
||||
* (user-facing): deprecated `AlwaysOffSampler` has moved to `@opentelemetry/sdk-trace-base`
|
||||
* (user-facing): deprecated `ParentBasedSampler` has moved to `@opentelemetry/sdk-trace-base`
|
||||
* (user-facing): deprecated `TraceIdRatioSampler` has moved to `@opentelemetry/sdk-trace-base`
|
||||
* feat(resource): Merge sync and async resource interfaces into a single interface [#5350](https://github.com/open-telemetry/opentelemetry-js/pull/5350) @dyladan
|
||||
* Resource constructor now takes a single argument which contains an optional `attributes` object
|
||||
* Detected resource attribute values may be a promise or a synchronous value
|
||||
* Resources are now merged by the order in which their detectors are configured instead of async attributes being last
|
||||
* Resource detectors now return `DetectedResource` plain objects instead of `new Resource()`
|
||||
* feat(sdk-trace-base)!: drop ability to instantiate propagators beyond defaults [#5355](https://github.com/open-telemetry/opentelemetry-js/pull/5355) @pichlermarc
|
||||
* (user-facing): only a non-env-var based default is now used on `BasicTracerProvider#register()`.
|
||||
* propagators can now not be configured via `OTEL_PROPAGATORS` or `window.OTEL_PROPAGATORS` anymore, please pass the propagator to `NodeTracerProvider#register()` instead.
|
||||
* if not configured directly via code, `BasicTracerProvider#register()` will now fall back to defaults (`tracecontext` and `baggage`)
|
||||
* feat(sdk-trace-node)!: drop ability to instantiate propagators beyond defaults [#5355](https://github.com/open-telemetry/opentelemetry-js/pull/5355) @pichlermarc
|
||||
* (user-facing): only a non-env-var based default is now used on `NodeTracerProvider#register()`.
|
||||
* propagators can now not be configured via `OTEL_PROPAGATORS` anymore, please pass the propagator to `NodeTracerProvider#register()` instead.
|
||||
* if not configured via code, `NodeTracerProvider#register()` will now fall back to the defaults (`tracecontext` and `baggage`)
|
||||
* if autoconfiguration based on enviornment variables is needed, please use `NodeSDK` from `@opentelemetry/sdk-node`.
|
||||
* feat(sdk-trace-web)!: drop ability to instantiate propagators beyond defaults [#5355](https://github.com/open-telemetry/opentelemetry-js/pull/5355) @pichlermarc
|
||||
* (user-facing): only a non-env-var based default is now used on `WebTracerProvider#register()`.
|
||||
* propagators can now not be configured via `window.OTEL_PROPAGATORS` anymore, please pass the propagator to `WebTracerProvider#register()` instead.
|
||||
* if not configured via code, `WebTracerProvider#register()` will now fall back to defaults (`tracecontext` and `baggage`)
|
||||
* feat(sdk-trace)!: drop unnecessary exports [#5405](https://github.com/open-telemetry/opentelemetry-js/pull/5405) @pichlermarc
|
||||
* (user-facing): `EXPORTER_FACTORY` is not used anymore and has been removed
|
||||
* (user-facing): `PROPAGATOR_FACTORY` is not used anymore and has been removed
|
||||
* (user-facing): `ForceFlushState` was intended for internal use and has been removed
|
||||
* (user-facing): the `Tracer` class was unintentionally exported and has been removed
|
||||
* to obtain a `Tracer`, please use `BasicTracerProvider#getTracer()`, `NodeTracerProvider#getTracer()` or `WebTracerProvider#getTracer()`
|
||||
* to reference a `Tracer`, please use the `Tracer` type from `@opentelemetry/api`
|
||||
* chore!: Raise the minimum supported Node.js version to `^18.19.0 || >=20.6.0`. Support for Node.js 14, 16, and early minor versions of 18 and 20 have been dropped. This applies to all packages except the 'api' and 'semantic-conventions' packages. [#5395](https://github.com/open-telemetry/opentelemetry-js/issues/5395) @trentm
|
||||
* feat(core)!: remove TracesSamplerValues from exports [#5406](https://github.com/open-telemetry/opentelemetry-js/pull/5406) @pichlermarc
|
||||
* (user-facing): TracesSamplerValues was only consumed internally and has been removed from exports without replacement
|
||||
* chore(resources)!: Remove deprecated duplicate browser detector from `@opentelemetry/resource` in favor of `@opentelemetry/opentelemetry-browser-detector` [#5420](https://github.com/open-telemetry/opentelemetry-js/pull/5420)
|
||||
* feat(core)!: remove unused and obsolete functions and types [#5444](https://github.com/open-telemetry/opentelemetry-js/pull/5444) @pichlermarc
|
||||
* (user-facing): `VERSION` was an internal constant that was unintentionally exported. It has been removed without replacement.
|
||||
* (user-facing): `isWrapped` has been removed in favor of `isWrapped` from `@opentelemetry/instrumentation`
|
||||
* (user-facing): `ShimWrapped` has been removed in favor of `ShimWrapped` from `@opentelemetry/instrumentation`
|
||||
* (user-facing): `hexToBase64` was a utility function that is not used by the SDK anymore. It has been removed without replacement.
|
||||
* (user-facing): `hexToBinary` was a utility function that now internal to `@opentelemetry/otlp-tranformer`. It has been removed without replacement.
|
||||
* (user-facing): `baggageUtils.getKeyParis` was an internal utility function that was unintentionally exported. It has been removed without replacement.
|
||||
* (user-facing): `baggageUtils.serializeKeyPairs` was an internal utility function that was unintentionally exported. It has been removed without replacement.
|
||||
* (user-facing): `baggageUtils.parseKeyPairsIntoRecord,` has been removed in favor of `parseKeyPairsIntoRecord`
|
||||
* (user-facing): `baggageUtils.parsePairKeyValue` was an internal utility function that was unintentionally exported. It has been removed without replacement.
|
||||
* (user-facing): `TimeOriginLegacy` has been removed without replacement.
|
||||
* (user-facing): `isAttributeKey` was an internal utility function that was unintentionally exported. It has been removed without replacement.
|
||||
* feat(sdk-trace-base)!: do not read environment variables from window in browsers [#5445](https://github.com/open-telemetry/opentelemetry-js/pull/5455) @pichlermarc
|
||||
* (user-facing): all configuration previously possible via `window.OTEL_*` is now not supported anymore, please pass configuration options to constructors instead.
|
||||
* Note: Node.js environment variable configuration continues to work as-is.
|
||||
* feat(exporter-zipkin)!: do not read environment variables from window in browsers [#5465](https://github.com/open-telemetry/opentelemetry-js/pull/5465) @pichlermarc
|
||||
* (user-facing): all configuration previously possible via `window.OTEL_*` is now not supported anymore, please pass configuration options to constructors instead.
|
||||
* Note: Node.js environment variable configuration continues to work as-is.
|
||||
* feat(resource)!: Remove resource class export in favor of functions and types only to aid in cross-version compatibility [#5421](https://github.com/open-telemetry/opentelemetry-js/pull/5421)
|
||||
* Renames `Resource` class to `ResourceImpl` and makes it package-private
|
||||
* Renames `IResource` interface to `Resource`
|
||||
* Export function `resourceFromAttributes` to create a `Resource` from a `DetectedAttributes` object
|
||||
* Export function `defaultResource` to create a default resource [#5467](https://github.com/open-telemetry/opentelemetry-js/pull/5467) @pichlermarc
|
||||
* Export function `emptyResource` to create an empty resource [#5467](https://github.com/open-telemetry/opentelemetry-js/pull/5467) @pichlermarc
|
||||
* Only export types and functions. This aids in cross-version compatibility and makes it more easily extensible in the future.
|
||||
* feat(resources)!: do not read environment variables from window in browsers [#5466](https://github.com/open-telemetry/opentelemetry-js/pull/5466) @pichlermarc
|
||||
* (user-facing): all configuration previously possible via `window.OTEL_*` is now not supported anymore
|
||||
* If you have been using the `envDetector` in browser environments, please migrate to manually creating a resource.
|
||||
* Note: Node.js environment variable configuration continues to work as-is.
|
||||
* fix(sdk-trace-base)!: use `ParentBasedAlwaysOnSampler` over `AlwaysOnSampler` when bogus data is supplied to `OTEL_TRACES_SAMPLER`
|
||||
* this aligns the SDK implementation with the specification
|
||||
* feat(core)!: drop `getEnv()`, `getEnvWithoutDefaults()` [#5481](https://github.com/open-telemetry/opentelemetry-js/pull/5481) @pichlermarc
|
||||
* (user-facing): `getEnv()` has been replaced by `getStringFromEnv()`, `getNumberFromEnv()`, `getBooleanFromEnv()`, `getStringListFromEnv()`
|
||||
* these new functions do not include defaults, please inline any defaults if necessary (example: `getStringFromEnv("OTEL_FOO") ?? "my-default"`)
|
||||
* to find the previously used defaults, please see [here](https://github.com/open-telemetry/opentelemetry-js/blob/e9d3c71918635d490b6a9ac9f8259265b38394d0/packages/opentelemetry-core/src/utils/environment.ts#L154-L239)
|
||||
* (user-facing): `getEnvWithoutDefaults()` has been replaced by `getStringFromEnv()`, `getNumberFromEnv()`, `getBooleanFromEnv()`, `getStringListFromEnv()`
|
||||
* (user-facing): `DEFAULT_ENVIRONMENT` has been removed, please inline any defaults from now on
|
||||
* to find the previously used defaults, please see [here](https://github.com/open-telemetry/opentelemetry-js/blob/e9d3c71918635d490b6a9ac9f8259265b38394d0/packages/opentelemetry-core/src/utils/environment.ts#L154-L239)
|
||||
* (user-facing): `ENVIRONMENT` has been removed without replacement
|
||||
* (user-facing): `RAW_ENVIRONMENT` has been removed without replacement
|
||||
* (user-facing): `parseEnvironment` has been removed without replacement
|
||||
* feat(sdk-trace-base): remove `BasicTracerProvider#register()` to improve tree-shaking [#5503](https://github.com/open-telemetry/opentelemetry-js/pull/5503) @pichlermarc
|
||||
* (user-facing): `BasicTracerProvider#register()` has been removed
|
||||
* to register a global propagator, please use `propagation.setGlobalPropagator()` from `@opentelemetry/api`
|
||||
* to register a global context manager, please use `context.setGlobalContextManager()` from `@opentelemetry/api`
|
||||
* feat!: set compilation target to ES2022 for all packages except `@opentelemetry/api`, `@opentelemetry/api-logs`, `@opentelemetry/api-events`, and `@opentelemetry/semantic-conventions` [#5456](https://github.com/open-telemetry/opentelemetry-js/pull/5456) @david-luna
|
||||
* (user-facing): drops browser runtimes which do not support ES2022 features
|
||||
* feat(core)! drop unused constants [#5504](https://github.com/open-telemetry/opentelemetry-js/pull/5504) @pichlermarc
|
||||
* (user-facing): `DEFAULT_ATTRIBUTE_VALUE_LENTGHT_LIMIT` has been removed, please use `Infinity` instead
|
||||
* (user-facing): `DEFAULT_ATTRIBUTE_VALUE_COUNT_LIMIT` has been removed, please use `128` instead
|
||||
* (user-facing): `DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT` has been removed, please use `128` instead
|
||||
* (user-facing): `DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT` has been removed, please use `128` instead
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(sdk-trace-web): do not throw when passing extra options [#5357](https://github.com/open-telemetry/opentelemetry-js/pull/5357) @pichlermarc
|
||||
* `WebTracerProvider` constructor now does not throw anymore when `contextManager` or `propagator` are passed as extra options to the constructor
|
||||
* feat(sdk-trace-base): add stack trace warning to debug instrumentation [#5363](https://github.com/open-telemetry/opentelemetry-js/pull/5363) @neilfordyce
|
||||
* feat(core): add more scalable replacements for getEnv(), getEnvWithoutDefaults() [#5443](https://github.com/open-telemetry/opentelemetry-js/pull/5443) @pichlermarc
|
||||
* refactor(exporter-jaeger): migrate away from getEnv() [#5464](https://github.com/open-telemetry/opentelemetry-js/pull/5464) @pichlermarc
|
||||
* feat(core): add `diagLogLevelFromString` utility [#5475](https://github.com/open-telemetry/opentelemetry-js/pull/5475) @pichlermarc
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(exporter-zipkin): remove usages of deprecated `url.parse` from `node:url` [#5390](https://github.com/open-telemetry/opentelemetry-js/pull/5390) @chancancode
|
||||
* fix(sdk-metrics): do not export from `PeriodicExportingMetricReader` when there are no metrics to export. [#5288](https://github.com/open-telemetry/opentelemetry-js/pull/5288) @jacksonweber
|
||||
* fix(sdk-trace-base): always wait on pending export in SimpleSpanProcessor. [#5303](https://github.com/open-telemetry/opentelemetry-js/pull/5303) @anuraaga
|
||||
* fix(core): avoid using util in configuration.ts for browser compatibility [#5524](https://github.com/open-telemetry/opentelemetry-js/pull/5524) @sriraamas
|
||||
|
||||
### :house: (Internal)
|
||||
|
||||
* refactor(sdk-metrics): the internal `InstrumentDescriptor` type now extends `MetricDescriptor`; moved public `InstrumentType` type enum into `./src/export/MetricData.ts` [#5277](https://github.com/open-telemetry/opentelemetry-js/pull/5266)
|
||||
* refactor(sdk-metrics): remove `Gauge` and `MetricAdvice` workaround types in favor of the upstream `@opentelemetry/api` types [#5254](https://github.com/open-telemetry/opentelemetry-js/pull/5254) @chancancode
|
||||
* chore: remove checks for unsupported node versions [#4341](https://github.com/open-telemetry/opentelemetry-js/pull/4341) @dyladan
|
||||
* refactor(sdk-trace-base): remove `BasicTracerProvider._registeredSpanProcessors` private property. [#5134](https://github.com/open-telemetry/opentelemetry-js/pull/5134) @david-luna
|
||||
* refactor(sdk-trace-base): rename `BasicTracerProvider.activeSpanProcessor` private property. [#5211](https://github.com/open-telemetry/opentelemetry-js/pull/5211) @david-luna
|
||||
* chore(selenium-tests): remove internal selenium-tests/ package, it wasn't being used @trentm
|
||||
* chore: update typescript `module` compiler option to `node16`. [#5347](https://github.com/open-telemetry/opentelemetry-js/pull/5347) @david-luna
|
||||
* feat(opentelemetry-instrumentation): replace `semver` package with internal semantic versioning check implementation to get rid of `semver` package initialization overhead especially in the AWS Lambda environment during coldstart [#5305](https://github.com/open-telemetry/opentelemetry-js/pull/5305) @serkan-ozal
|
||||
* chore: unpin `@opentelemetry/semantic-conventions` dep to allow better de-duplication in installs [#5439](https://github.com/open-telemetry/opentelemetry-js/pull/5439) @trentm
|
||||
|
||||
## 1.30.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(sdk-metrics): PeriodicExportingMetricReader now flushes pending tasks at shutdown [#5242](https://github.com/open-telemetry/opentelemetry-js/pull/5242)
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(sdk-trace-base): do not load OTEL_ env vars on module load, but when needed [#5233](https://github.com/open-telemetry/opentelemetry-js/pull/5233)
|
||||
* fix(instrumentation-xhr, instrumentation-fetch): content length attributes no longer get removed with `ignoreNetworkEvents: true` being set [#5229](https://github.com/open-telemetry/opentelemetry-js/issues/5229)
|
||||
|
||||
## 1.29.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(sdk-metrics): Add support for aggregation cardinality limit with a default limit of 2000. This limit can be customized via views [#5128](https://github.com/open-telemetry/opentelemetry-js/pull/5128)
|
||||
|
||||
## 1.28.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(sdk-metrics, sdk-trace): add `mergeResourceWithDefaults` flag, which allows opting-out of resources getting merged with the default resource [#4617](https://github.com/open-telemetry/opentelemetry-js/pull/4617)
|
||||
* default: `true` (no change in behavior)
|
||||
* note: `false` will become the default behavior in the next major version in order to comply with [specification requirements](https://github.com/open-telemetry/opentelemetry-specification/blob/f3511a5ccda376dfd1de76dfa086fc9b35b54757/specification/resource/sdk.md?plain=1#L31-L36)
|
||||
|
||||
* feat(sdk-trace-base): add `spanProcessors` property in `TracerConfig` interface. [#5138](https://github.com/open-telemetry/opentelemetry-js/pull/5138) @david-luna
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(sdk-metrics): await exports in `PeriodicExportingMetricReader` when async resource attributes have not yet settled [#5119](https://github.com/open-telemetry/opentelemetry-js/pull/5119/) @pichlermarc
|
||||
* fix(sdk-trace): performance.now() may return the same value for consecutive calls [#5150](https://github.com/open-telemetry/opentelemetry-js/pull/5150) @dyladan
|
||||
* fix(sdk-trace-base): pass BatchSpanProcessor#forceFlush() errors on visibilitychange/pagehide to globalErrorHandler [#5143](https://github.com/open-telemetry/opentelemetry-js/pull/5143) @pichlermarc
|
||||
* fixes a bug where switching browser tabs with a failing exporter would cause an unhandled error
|
||||
|
||||
## 1.27.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat: add processors for adding session.id attribute to spans and logs [#4972](https://github.com/open-telemetry/opentelemetry-js/pull/4972)
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(sdk-trace-base): avoid keeping non-string `status.message` on `Span#setStatus()` [#4999](https://github.com/open-telemetry/opentelemetry-js/pull/4999) @pichlermarc
|
||||
* fix(sdk-metrics): Add missing catch and handle error in promise of `PeriodicExportingMetricReader` [#5006](https://github.com/open-telemetry/opentelemetry-js/pull/5006) @jj22ee
|
||||
* fix(opentelemetry-core): confusing log extract of composite propagator [#5017](https://github.com/open-telemetry/opentelemetry-js/pull/5017) @rv2673
|
||||
* fix(propagator-aws-xray-*): move propagators back to contrib repository [#4966](https://github.com/open-telemetry/opentelemetry-js/pull/4966) @pichlermarc
|
||||
* The [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/6672dbc97ddeb34f36c020a0f0a30323c8bc4d95/specification/context/api-propagators.md?plain=1#L354-L356) prohibits hosting these packages in the core repository
|
||||
* `@opentelemetry/propagator-aws-xray` is now located in [open-telemetry/opentelemetry-js-contrib](https://github.com/open-telemetry/opentelemetry-js-contrib)
|
||||
* `@opentelemetry/propagator-aws-xray-lambda` is now located in [open-telemetry/opentelemetry-js-contrib](https://github.com/open-telemetry/opentelemetry-js-contrib)
|
||||
|
||||
* docs: [Browser] Define the supported browser runtimes [Issue #4168](https://github.com/open-telemetry/opentelemetry-js/issues/4168) PR:[#5059](https://github.com/open-telemetry/opentelemetry-js/pull/5059) @MSNev
|
||||
|
||||
### :house: (Internal)
|
||||
|
||||
* deps: set `@opentelemetry/api` dependency min version to 1.3.0 in `examples`, `experimental/packages`, `integration-tests` and `selenium-tests`
|
||||
[#4992](https://github.com/open-telemetry/opentelemetry-js/pull/4992)
|
||||
* refactor(sdk-metrics): replace `MetricsAttributes` with `Attributes` [#5021](https://github.com/open-telemetry/opentelemetry-js/pull/5021) @david-luna
|
||||
* refactor(instrumentation-http): replace `SpanAttributes` and `MetricsAttributes` with `Attributes` [#5023](https://github.com/open-telemetry/opentelemetry-js/pull/5023) @david-luna
|
||||
* chore(exporter-zipkin): remove usages of Span constructor [#5030](https://github.com/open-telemetry/opentelemetry-js/pull/5030) @david-luna
|
||||
* test(instrumentation-http): remove usages of `new Span` in tests [#5035](https://github.com/open-telemetry/opentelemetry-js/pull/5035) @david-luna
|
||||
|
||||
## 1.26.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat: include instrumentation scope info in console span and log record exporters [#4848](https://github.com/open-telemetry/opentelemetry-js/pull/4848) @blumamir
|
||||
* feat(semconv): update semantic conventions to 1.27 (from 1.7.0) [#4690](https://github.com/open-telemetry/opentelemetry-js/pull/4690) @dyladan
|
||||
* Exported names have changed to `ATTR_{name}` for attributes (e.g. `ATTR_HTTP_REQUEST_METHOD`), `{name}_VALUE_{value}` for enumeration values (e.g. `HTTP_REQUEST_METHOD_VALUE_POST`), and `METRIC_{name}` for metrics. Exported names from previous versions are deprecated.
|
||||
* Import `@opentelemetry/semantic-conventions` for *stable* semantic conventions. Import `@opentelemetry/semantic-conventions/incubating` for all semantic conventions, stable and unstable.
|
||||
* Note: Semantic conventions are now versioned separately from other stable artifacts, to correspond to the version of semantic conventions they provide. Changes will be in a separate changelog.
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(sdk-node): avoid spurious diag errors for unknown OTEL_NODE_RESOURCE_DETECTORS values [#4879](https://github.com/open-telemetry/opentelemetry-js/pull/4879) @trentm
|
||||
* deps(opentelemetry-instrumentation): Bump `shimmer` types to 1.2.0 [#4865](https://github.com/open-telemetry/opentelemetry-js/pull/4865) @lforst
|
||||
* fix(instrumentation): Fix optional property types [#4833](https://github.com/open-telemetry/opentelemetry-js/pull/4833) @alecmev
|
||||
* fix(sdk-metrics): fix(sdk-metrics): use inclusive upper bounds in histogram [#4829](https://github.com/open-telemetry/opentelemetry-js/pull/4829)
|
||||
|
||||
### :house: (Internal)
|
||||
|
||||
* refactor: Simplify the code for the `getEnv` function [#4799](https://github.com/open-telemetry/opentelemetry-js/pull/4799) @danstarns
|
||||
* refactor: remove "export *" in favor of explicit named exports [#4880](https://github.com/open-telemetry/opentelemetry-js/pull/4880) @robbkidd
|
||||
* Packages updated:
|
||||
* opentelemetry-context-zone
|
||||
* opentelemetry-core
|
||||
* opentelemetry-exporter-jaeger
|
||||
* opentelemetry-exporter-zipkin
|
||||
* opentelemetry-propagator-b3
|
||||
* opentelemetry-propagator-jaeger
|
||||
* opentelemetry-sdk-trace-base
|
||||
* opentelemetry-sdk-trace-node
|
||||
* opentelemetry-sdk-trace-web
|
||||
* propagator-aws-xray
|
||||
* sdk-metrics
|
||||
* deps(sdk-metrics): remove unused lodash.merge dependency [#4905](https://github.com/open-telemetry/opentelemetry-js/pull/4905) @pichlermarc
|
||||
|
||||
## 1.25.1
|
||||
|
||||
### :books: (Refine Doc)
|
||||
|
||||
* refactor(examples): added usage of @opentelemetry/semantic-conventions and @opentelemetry/resources to the examples in examples/opentelemetry-web for maintaining consistency across all examples. [#4764](https://github.com/open-telemetry/opentelemetry-js/pull/4764) @Zen-cronic
|
||||
|
||||
### :house: (Internal)
|
||||
|
||||
* refactor(context-zone-peer-dep): use explicit exports [#4785](https://github.com/open-telemetry/opentelemetry-js/pull/4787) @pichlermarc
|
||||
* refactor(context-async-hooks): use explicit exports [#4785](https://github.com/open-telemetry/opentelemetry-js/pull/4786) @pichlermarc
|
||||
|
||||
## 1.25.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat: support node 22 [#4666](https://github.com/open-telemetry/opentelemetry-js/pull/4666) @dyladan
|
||||
* feat(context-zone*): support zone.js 0.12.x [#4376](https://github.com/open-telemetry/opentelemetry-js/pull/4736) @maldago
|
||||
* refactor(core): Use tree-shakeable string constants for semconv [#4739](https://github.com/open-telemetry/opentelemetry-js/pull/4739) @JohannesHuster
|
||||
* refactor(shim-opentracing): Use tree-shakeable string constants for semconv [#4746](https://github.com/open-telemetry/opentelemetry-js/pull/4746) @JohannesHuster
|
||||
* refactor(sdk-trace-web): Use tree-shakeable string constants for semconv [#4747](https://github.com/open-telemetry/opentelemetry-js/pull/4747) @JohannesHuster
|
||||
* refactor(sdk-trace-node): Use tree-shakeable string constants for semconv [#4748](https://github.com/open-telemetry/opentelemetry-js/pull/4748) @JohannesHuster
|
||||
* refactor(sdk-trace-base): Use tree-shakeable string constants for semconv [#4749](https://github.com/open-telemetry/opentelemetry-js/pull/4749) @JohannesHuster
|
||||
* refactor(resources): update deprecated semconv to use exported strings [#4755](https://github.com/open-telemetry/opentelemetry-js/pull/#4755) @JamieDanielson
|
||||
* refactor(exporters): update deprecated semconv to use exported strings [#4756](https://github.com/open-telemetry/opentelemetry-js/pull/#4756) @JamieDanielson
|
||||
|
||||
### :books: (Refine Doc)
|
||||
|
||||
* refactor(examples): use new exported string constants for semconv in examples/esm-http-ts [#4758](https://github.com/open-telemetry/opentelemetry-js/pull/4758) @Zen-cronic
|
||||
* refactor(examples): use new exported string constants for semconv in examples/basic-tracer-node [#4759](https://github.com/open-telemetry/opentelemetry-js/pull/4759#pull) @Zen-cronic
|
||||
* refactor(examples): use new exported string constants for semconv in examples/http [#4750](https://github.com/open-telemetry/opentelemetry-js/pull/4750) @Zen-cronic
|
||||
* refactor(examples): use new exported string constants for semconv in examples/grpc-js [#4760](https://github.com/open-telemetry/opentelemetry-js/pull/4760#pull) @Zen-cronic
|
||||
* refactor(examples): use new exported string constants for semconv in examples/otlp-exporter-node [#4762](https://github.com/open-telemetry/opentelemetry-js/pull/4762) @Zen-cronic
|
||||
* refactor(examples): use new exported string constants for semconv in examples/opentracing-shim [#4761](https://github.com/open-telemetry/opentelemetry-js/pull/4761) @Zen-cronic
|
||||
|
||||
## 1.24.1
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(core): align inconsistent behavior of `getEnv()` and `getEnvWithoutDefaults()` when a `process` polyfill is used [#4648](https://github.com/open-telemetry/opentelemetry-js/pull/4648) @pichlermarc
|
||||
* `getEnvWithoutDefaults()` would use `process.env` if it was defined when running in a browser, while `getEnv()` would always use `_globalThis`. Now both use `_globalThis` when running in a browser.
|
||||
* fix(resources): prevent circular import (resource -> detector -> resource -> ...) [#4653](https://github.com/open-telemetry/opentelemetry-js/pull/4653) @pichlermarc
|
||||
* fixes a circular import warning which would appear in rollup when bundling `@opentelemetry/resources`
|
||||
* fix(exporter-metrics-otlp-grpc): add explicit otlp-exporter-base dependency to exporter-metrics-otlp-grpc [#4678](https://github.com/open-telemetry/opentelemetry-js/pull/4678) @AkselAllas
|
||||
* fix(resources) wait for async attributes for detecting resources [#4687](https://github.com/open-telemetry/opentelemetry-js/pull/4687) @ziolekjj
|
||||
|
||||
## 1.24.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(sdk-trace-base): log resource attributes in ConsoleSpanExporter [#4605](https://github.com/open-telemetry/opentelemetry-js/pull/4605) @pichlermarc
|
||||
* feat(propagator-aws-xray): moved AWS Xray propagator from contrib [4603](https://github.com/open-telemetry/opentelemetry-js/pull/4603) @martinkuba
|
||||
* feat(resources): new experimental detector ServiceInstanceIdDetectorSync that sets the value for `service.instance.id` as random UUID. [#4608](https://github.com/open-telemetry/opentelemetry-js/pull/4608) @maryliag
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(sdk-trace-web): fix invalid timings in span events [#4486](https://github.com/open-telemetry/opentelemetry-js/pull/4486) @Abinet18
|
||||
* fix(resources): ensure BrowserDetector does not think Node.js v21 is a browser [#4561](https://github.com/open-telemetry/opentelemetry-js/issues/4561) @trentm
|
||||
* fix(core): align inconsistent behavior of `getEnv()` and `getEnvWithoutDefaults()` when a `process` polyfill is used [#4648](https://github.com/open-telemetry/opentelemetry-js/pull/4648) @pichlermarc
|
||||
* `getEnvWithoutDefaults()` would use `process.env` if it was defined when running in a browser, while `getEnv()` would always use `_globalThis`. Now both use `_globalThis` when running in a browser.
|
||||
|
||||
## 1.23.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* perf(sdk-trace-base): do not allocate arrays if resource has no pending async attributes [#4576](https://github.com/open-telemetry/opentelemetry-js/pull/4576) @Samuron
|
||||
* feat(sdk-metrics): added experimental synchronous gauge to SDK [#4565](https://github.com/open-telemetry/opentelemetry-js/pull/4565) @clintonb
|
||||
* this change will become user-facing in an upcoming release
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(sdk-metrics): increase the depth of the output to the console such that objects in the metric are printed fully to the console [#4522](https://github.com/open-telemetry/opentelemetry-js/pull/4522) @JacksonWeber
|
||||
|
||||
## 1.22.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(sdk-metrics): allow single bucket histograms [#4456](https://github.com/open-telemetry/opentelemetry-js/pull/4456) @pichlermarc
|
||||
* feat(instrumentation): Make `init()` method public [#4418](https://github.com/open-telemetry/opentelemetry-js/pull/4418)
|
||||
* feat(context-zone-peer-dep, context-zone): support zone.js 0.13.x, 0.14.x [#4469](https://github.com/open-telemetry/opentelemetry-js/pull/4469) @pichlermarc
|
||||
* chore: Semantic Conventions export individual strings [4185](https://github.com/open-telemetry/opentelemetry-js/issues/4185)
|
||||
* feat(sdk-trace-base): allow adding span links after span creation [#4536](https://github.com/open-telemetry/opentelemetry-js/pull/4536) @seemk
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(sdk-metrics): handle zero bucket counts in exponential histogram merge [#4459](https://github.com/open-telemetry/opentelemetry-js/pull/4459) @mwear
|
||||
* fix(sdk-metrics): ignore `NaN` value recordings in Histograms [#4455](https://github.com/open-telemetry/opentelemetry-js/pull/4455) @pichlermarc
|
||||
* fixes a bug where recording `NaN` on a histogram would result in the sum of bucket count values not matching the overall count
|
||||
* fix(sdk-metrics): allow single bucket histograms [#4456](https://github.com/open-telemetry/opentelemetry-js/pull/4456) @pichlermarc
|
||||
* fixes a bug where `Meter.createHistogram()` with the advice `explicitBucketBoundaries: []` would throw
|
||||
* fix(context-zone-peer-dep, context-zone): support zone.js 0.13.x, 0.14.x [#4469](https://github.com/open-telemetry/opentelemetry-js/pull/4469) @pichlermarc
|
||||
* fixes a bug where old versions of `zone.js` affected by <https://github.com/angular/angular/issues/53507> would be pulled in
|
||||
|
||||
### :books: (Refine Doc)
|
||||
|
||||
* docs: shorten readme sections [#4460](https://github.com/open-telemetry/opentelemetry-js/pull/4460) @legendecas
|
||||
|
||||
## 1.21.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(sdk-metrics): add constructor option to add metric readers [#4427](https://github.com/open-telemetry/opentelemetry-js/pull/4427) @pichlermarc
|
||||
* deprecates `MeterProvider.addMetricReader()` please use the constructor option `readers` instead.
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(sdk-trace-base): ensure attribute value length limit is enforced on span creation [#4417](https://github.com/open-telemetry/opentelemetry-js/pull/4417) @pichlermarc
|
||||
* fix(sdk-trace-base): Export processed spans while exporter failed [#4287](https://github.com/open-telemetry/opentelemetry-js/pull/4287) @Zirak
|
||||
|
||||
### :house: (Internal)
|
||||
|
||||
* chore(opentelemetry-context-zone-peer-dep): support zone.js ^v0.13.0 [#4320](https://github.com/open-telemetry/opentelemetry-js/pull/4320)
|
||||
* refactor(core): drop unnecessary assignment of HOSTNAME [#4421](https://github.com/open-telemetry/opentelemetry-js/pull/4421) @pichlermarc
|
||||
* test(opentelemetry-context-zone-peer-dep): transpile zone.js in tests [#4423](https://github.com/open-telemetry/opentelemetry-js/pull/4423) @legendecas
|
||||
|
||||
## 1.20.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* perf(otlp-transformer): skip unnecessary base64 encode of span contexts [#4343](https://github.com/open-telemetry/opentelemetry-js/pull/4343) @seemk
|
||||
* feat(sdk-trace-base): improve log messages when dropping span events [#4223](https://github.com/open-telemetry/opentelemetry-js/pull/4223) @mkubliniak
|
||||
|
||||
## 1.19.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat: add node 20 support [#4336](https://github.com/open-telemetry/opentelemetry-js/pull/4336) @dyladan
|
||||
|
||||
### :house: (Internal)
|
||||
|
||||
* chore: type reference on zone.js [#4257](https://github.com/open-telemetry/opentelemetry-js/pull/4257) @legendecas
|
||||
* chore: no need for 'packages' in lerna.json [#4264](https://github.com/open-telemetry/opentelemetry-js/pull/4264) @trentm
|
||||
* test: add node 20 to test matrix [#4336](https://github.com/open-telemetry/opentelemetry-js/pull/4336) @dyladan
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(api-logs): allow for TimeInput type for LogRecord timestamps [#4345](https://github.com/open-telemetry/opentelemetry-js/pull/4345)
|
||||
* fix(sdk-trace-web): only access location if it is defined [#4063](https://github.com/open-telemetry/opentelemetry-js/pull/4063)
|
||||
* fix(sdk-trace-base): processor onStart called with a span having empty attributes
|
||||
|
||||
## 1.18.1
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(sdk-metrics): hand-roll MetricAdvice type as older API versions do not include it #4260
|
||||
|
||||
## 1.18.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(metrics): prototype experimental advice support [#3876](https://github.com/open-telemetry/opentelemetry-js/pull/3876) @legendecas
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(core): remove re-export of `version.ts` [#4225](https://github.com/open-telemetry/opentelemetry-js/pull/4225) @david-luna
|
||||
|
||||
### :house: (Internal)
|
||||
|
||||
* chore: track package-lock.json [#4238](https://github.com/open-telemetry/opentelemetry-js/pull/4238) @legendecas
|
||||
* Switched to npm workspaces to bootstrap dependencies.
|
||||
|
||||
## 1.17.1
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(sdk-trace-base): BatchSpanProcessor flushes when `maxExportBatchSize` is reached [#3958](https://github.com/open-telemetry/opentelemetry-js/pull/3958) @nordfjord
|
||||
* fix(sdk-metrics): allow instrument names to contain '/' [#4155](https://github.com/open-telemetry/opentelemetry-js/pull/4155)
|
||||
* fix(sdk-metrics): prevent per-reader storages from keeping unreported accumulations in memory [#4163](https://github.com/open-telemetry/opentelemetry-js/pull/4163) @pichlermarc
|
||||
* fixes a memory leak which occurred when two or more `MetricReader` instances are registered to a `MeterProvider`
|
||||
* fix(sdk-metrics): do not report empty scopes and metrics [#4135](https://github.com/open-telemetry/opentelemetry-js/pull/4135) @pichlermarc
|
||||
* Instruments that were created, but did not have measurements will not be exported anymore
|
||||
* Meters (Scopes) that were created, but did not have any instruments with measurements under them will not be exported anymore.
|
||||
* fix(exporter-zipkin): round duration to the nearest int in annotations to be compliant with zipkin protocol [#4167](https://github.com/open-telemetry/opentelemetry-js/pull/4167) @FelipeEmerim
|
||||
|
||||
### :books: (Refine Doc)
|
||||
|
||||
* docs(contributing): added guidelines for adding benchmark tests [#4169](https://github.com/open-telemetry/opentelemetry-js/pull/4169)
|
||||
|
||||
### :house: (Internal)
|
||||
|
||||
* test: added a performance benchmark test for span creation [#4105](https://github.com/open-telemetry/opentelemetry-js/pull/4105)
|
||||
* test: added a workflow to run performance benchmark tests automatically [#4144](https://github.com/open-telemetry/opentelemetry-js/pull/4144)
|
||||
|
||||
## 1.17.0
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
@ -316,16 +792,8 @@ There are no changes between 1.0.0 and the previous 0.33.0 version.
|
|||
|
||||
* fix(sdk-web): parse url with relative url string [#2972](https://github.com/open-telemetry/opentelemetry-js/pull/2972) @legendecas
|
||||
|
||||
### :books: (Refine Doc)
|
||||
|
||||
### :house: (Internal)
|
||||
|
||||
## 1.2.0
|
||||
|
||||
### :boom: Breaking Change
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix: sanitize attributes inputs [#2881](https://github.com/open-telemetry/opentelemetry-js/pull/2881) @legendecas
|
||||
|
@ -1775,7 +2243,7 @@ No changes
|
|||
* `opentelemetry-api`, `opentelemetry-exporter-prometheus`, `opentelemetry-metrics`
|
||||
* [#1137](https://github.com/open-telemetry/opentelemetry-js/pull/1137) Batch observer ([@obecny](https://github.com/obecny))
|
||||
* `opentelemetry-exporter-collector`
|
||||
* [#1256](https://github.com/open-telemetry/opentelemetry-js/pull/1256) feat: [Collector Metric Exporter][1/x] Rename CollectorExporter to CollectorTraceExporter ([@davidwitten](https://github.com/davidwitten))
|
||||
* [#1256](https://github.com/open-telemetry/opentelemetry-js/pull/1256) feat: Collector Metric Exporter [1/x] Rename CollectorExporter to CollectorTraceExporter ([@davidwitten](https://github.com/davidwitten))
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
|
@ -2241,7 +2709,9 @@ Released 2020-03-19
|
|||
|
||||
Released 2020-03-16
|
||||
|
||||
### This is a first official beta release, which provides almost fully complete metrics, tracing, and context propagation functionality but makes no promises around breaking changes
|
||||
### First official beta release
|
||||
|
||||
* provides almost fully complete metrics, tracing, and context propagation functionality but makes **no promises** around breaking changes
|
||||
|
||||
### :boom: Breaking Change
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ detailed instructions, see [development](#development) below.
|
|||
```sh
|
||||
git clone https://github.com/open-telemetry/opentelemetry-js.git
|
||||
cd opentelemetry-js
|
||||
npm install
|
||||
npm ci
|
||||
npm run compile
|
||||
npm test
|
||||
npm run test
|
||||
```
|
||||
|
||||
## Pull Request Merge Guidelines
|
||||
|
@ -79,21 +79,14 @@ Reporting bugs is an important contribution. Please make sure to include:
|
|||
### Before you start
|
||||
|
||||
Please read project contribution
|
||||
[guide](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md)
|
||||
[guide](https://github.com/open-telemetry/community/blob/main/guides/contributor)
|
||||
for general practices for OpenTelemetry project.
|
||||
|
||||
#### Conventional commit
|
||||
|
||||
The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages. You can see examples [here](https://www.conventionalcommits.org/en/v1.0.0-beta.4/#examples).
|
||||
We use [commitlint](https://github.com/conventional-changelog/commitlint) and [husky](https://github.com/typicode/husky) to prevent bad commit message.
|
||||
For example, you want to submit the following commit message `git commit -s -am "my bad commit"`.
|
||||
You will receive the following error :
|
||||
|
||||
```text
|
||||
✖ type must be one of [ci, feat, fix, docs, style, refactor, perf, test, revert, chore] [type-enum]
|
||||
```
|
||||
|
||||
Here an example that will pass the verification: `git commit -s -am "chore(opentelemetry-core): update deps"`
|
||||
It is recommended to have your commit messages follow the Conventional Commits specification, with possible types listed in [.commitlint.rc.yml](.commitlintrc.yml). Here an example that uses the recommended format: `git commit -s -am "chore(opentelemetry-core): update deps"`
|
||||
|
||||
### Changelog
|
||||
|
||||
|
@ -104,7 +97,7 @@ An entry into `CHANGELOG.md` or `experimental/CHANGELOG.md` is required for the
|
|||
- Changes to default settings
|
||||
- New components being added
|
||||
|
||||
It is reasonable to omit an entry to the changelog under these circuimstances:
|
||||
It is reasonable to omit an entry to the changelog under these circumstances:
|
||||
|
||||
- Updating test to remove flakiness or improve coverage
|
||||
- Updates to the CI/CD process
|
||||
|
@ -145,7 +138,7 @@ git merge upstream/main
|
|||
|
||||
Remember to always work in a branch of your local copy, as you might otherwise have to contend with conflicts in main.
|
||||
|
||||
Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#github-workflow) section of general project contributing guide.
|
||||
Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/main/guides/contributor/processes.md#github-workflow) section of general project contributing guide.
|
||||
|
||||
## Development
|
||||
|
||||
|
@ -161,10 +154,10 @@ Most of the commands needed for development are accessed as [npm scripts](https:
|
|||
|
||||
### Install dependencies
|
||||
|
||||
This will install all dependencies for the root project and all modules managed by `lerna`. By default, a `postinstall` script will run `lerna bootstrap` automatically after an install. This can be avoided using the `--ignore-scripts` option if desired.
|
||||
This will install all dependencies for the root project and all modules managed by `npm workspaces`.
|
||||
|
||||
```sh
|
||||
npm install
|
||||
npm ci
|
||||
```
|
||||
|
||||
### Compile modules
|
||||
|
@ -203,6 +196,15 @@ cd packages/opentelemetry-module-name
|
|||
npm run watch
|
||||
```
|
||||
|
||||
#### TypeScript version & update policy
|
||||
|
||||
TypeScript version used to compile the pacakges is `v5.0.4`. If you plan to use any of the packages from this
|
||||
repository to make your own application or package instrumentation make sure to use same version or higher.
|
||||
|
||||
<!-- Ref: https://github.com/open-telemetry/opentelemetry-js/pull/5145#issuecomment-2518263890 -->
|
||||
As update policy OpenTelemetry JS will follow DefinitelyType's [support policy for TypeScript](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window)
|
||||
which sets a support window of 2 years.
|
||||
|
||||
### Running tests
|
||||
|
||||
Similar to compilations, tests can be run from the root to run all tests or from a single module to run only the tests for that module.
|
||||
|
@ -223,6 +225,16 @@ To run the unit tests continuously in watch mode while developing, use:
|
|||
npm run tdd
|
||||
```
|
||||
|
||||
Packages that are expected to run in the browser have browser specific tests:
|
||||
|
||||
```sh
|
||||
# Run browser-specific test
|
||||
npm run test:browser
|
||||
|
||||
# Run web worker test
|
||||
npm run test:webworker
|
||||
```
|
||||
|
||||
### Linting
|
||||
|
||||
This project uses `eslint` to lint source code. Just like tests and compilation, linting can be done for all packages or only a single package.
|
||||
|
@ -247,6 +259,21 @@ cd packages/opentelemetry-module-name
|
|||
npm run lint:fix
|
||||
```
|
||||
|
||||
The default lint command will check majority of files, including Markdown files (such as README.md files), but you
|
||||
also have the option to check just the Markdown files with:
|
||||
|
||||
```sh
|
||||
npm run lint:markdown
|
||||
npm run lint:markdown:fix # can automatically fix some Markdown rules
|
||||
```
|
||||
|
||||
The default command doesn't check the examples folder. To lint just the examples, use the script:
|
||||
|
||||
```sh
|
||||
npm run lint:examples
|
||||
npm run lint:examples:fix # can automatically fix some errors
|
||||
```
|
||||
|
||||
### Generating docs
|
||||
|
||||
We use [typedoc](https://www.npmjs.com/package/typedoc) to generate the api documentation.
|
||||
|
@ -286,10 +313,10 @@ export const _globalThis = typeof globalThis === 'object' ? globalThis : global;
|
|||
/// packages/opentelemetry-core/src/platform/browser/globalThis.ts
|
||||
export const _globalThis: typeof globalThis =
|
||||
typeof globalThis === 'object' ? globalThis :
|
||||
typeof self === 'object' ? self :
|
||||
typeof window === 'object' ? window :
|
||||
typeof global === 'object' ? global :
|
||||
{} as typeof globalThis;
|
||||
typeof self === 'object' ? self :
|
||||
typeof window === 'object' ? window :
|
||||
typeof global === 'object' ? global :
|
||||
{} as typeof globalThis;
|
||||
```
|
||||
|
||||
Even though the implementation may differ, the exported names must be aligned.
|
||||
|
|
455
README.md
455
README.md
|
@ -2,7 +2,7 @@
|
|||
---
|
||||
<p align="center">
|
||||
<strong>
|
||||
<a href="https://opentelemetry.io/docs/js/getting-started/">Getting Started</a>
|
||||
<a href="https://opentelemetry.io/docs/languages/js/getting-started/">Getting Started</a>
|
||||
•
|
||||
<a href="https://open-telemetry.github.io/opentelemetry-js">API and SDK Reference</a>
|
||||
</strong>
|
||||
|
@ -19,8 +19,8 @@
|
|||
<img alt="license" src="https://img.shields.io/badge/license-Apache_2.0-green.svg?style=for-the-badge">
|
||||
</a>
|
||||
<br/>
|
||||
<a href="https://circleci.com/gh/open-telemetry/opentelemetry-js">
|
||||
<img alt="Build Status" src="https://circleci.com/gh/open-telemetry/opentelemetry-js.svg?style=shield">
|
||||
<a href="https://github.com/open-telemetry/opentelemetry-js/actions">
|
||||
<img alt="Build Status" src="https://github.com/open-telemetry/opentelemetry-js/actions/workflows/unit-test.yml/badge.svg?style=shield">
|
||||
</a>
|
||||
<img alt="Beta" src="https://img.shields.io/badge/status-beta-informational?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAACQAAAAAQAAAJAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAABigAwAEAAAAAQAAABgAAAAA8A2UOAAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAABK5JREFUSA2dVm1sFEUYfmd2b/f2Pkqghn5eEQWKrRgjpkYgpoRCLC0oxV5apAiGUDEpJvwxEQ2raWPU+Kf8INU/RtEedwTCR9tYPloxGNJYTTQUwYqJ1aNpaLH3sXu3t7vjvFevpSqt7eSyM+/czvM8877PzB3APBoLgoDLsNePF56LBwqa07EKlDGg84CcWsI4CEbhNnDpAd951lXE2NkiNknCCTLv4HtzZuvPm1C/IKv4oDNXqNDHragety2XVzjECZsJARuBMyRzJrh1O0gQwLXuxofxsPSj4hG8fMLQo7bl9JJD8XZfC1E5yWFOMtd07dvX5kDwg6+2++Chq8txHGtfPoAp0gOFmhYoNFkHjn2TNUmrwRdna7W1QSkU8hvbGk4uThLrapaiLA2E6QY4u/lS9ItHfvJkxYsTMVtnAJLipYIWtVrcdX+8+b8IVnPl/R81prbuPZ1jpYw+0aEUGSkdFsgyBIaFTXCm6nyaxMtJ4n+TeDhJzGqZtQZcuYDgqDwDbqb0JF9oRpIG1Oea3bC1Y6N3x/WV8Zh83emhCs++hlaghDw+8w5UlYKq2lU7Pl8IkvS9KDqXmKmEwdMppVPKwGSEilmyAwJhRwWcq7wYC6z4wZ1rrEoMWxecdOjZWXeAQClBcYDN3NwVwD9pGwqUSyQgclcmxpNJqCuwLmDh3WtvPqXdlt+6Oz70HPGDNSNBee/EOen+rGbEFqDENBPDbtdCp0ukPANmzO0QQJYUpyS5IJJI3Hqt4maS+EB3199ozm8EDU/6fVNU2dQpdx3ZnKzeFXyaUTiasEV/gZMzJMjr3Z+WvAdQ+hs/zw9savimxUntDSaBdZ2f+Idbm1rlNY8esFffBit9HtK5/MejsrJVxikOXlb1Ukir2X+Rbdkd1KG2Ixfn2Ql4JRmELnYK9mEM8G36fAA3xEQ89fxXihC8q+sAKi9jhHxNqagY2hiaYgRCm0f0QP7H4Fp11LSXiuBY2aYFlh0DeDIVVFUJQn5rCnpiNI2gvLxHnASn9DIVHJJlm5rXvQAGEo4zvKq2w5G1NxENN7jrft1oxMdekETjxdH2Z3x+VTVYsPb+O0C/9/auN6v2hNZw5b2UOmSbG5/rkC3LBA+1PdxFxORjxpQ81GcxKc+ybVjEBvUJvaGJ7p7n5A5KSwe4AzkasA+crmzFtowoIVTiLjANm8GDsrWW35ScI3JY8Urv83tnkF8JR0yLvEt2hO/0qNyy3Jb3YKeHeHeLeOuVLRpNF+pkf85OW7/zJxWdXsbsKBUk2TC0BCPwMq5Q/CPvaJFkNS/1l1qUPe+uH3oD59erYGI/Y4sce6KaXYElAIOLt+0O3t2+/xJDF1XvOlWGC1W1B8VMszbGfOvT5qaRRAIFK3BCO164nZ0uYLH2YjNN8thXS2v2BK9gTfD7jHVxzHr4roOlEvYYz9QIz+Vl/sLDXInsctFsXjqIRnO2ZO387lxmIboLDZCJ59KLFliNIgh9ipt6tLg9SihpRPDO1ia5byw7de1aCQmF5geOQtK509rzfdwxaKOIq+73AvwCC5/5fcV4vo3+3LpMdtWHh0ywsJC/ZGoCb8/9D8F/ifgLLl8S8QWfU8cAAAAASUVORK5CYII=">
|
||||
</p>
|
||||
|
@ -41,6 +41,9 @@ This is the JavaScript version of [OpenTelemetry](https://opentelemetry.io/), a
|
|||
|
||||
## Quick Start
|
||||
|
||||
**Much of OpenTelemetry JS documentation is written assuming the compiled application is run as CommonJS.**
|
||||
For more details on ECMAScript Modules vs CommonJS, refer to [esm-support](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md).
|
||||
|
||||
The following describes how to set up tracing for a basic web application.
|
||||
For more detailed documentation, see the website at <https://opentelemetry.io/docs/instrumentation/js/>.
|
||||
|
||||
|
@ -68,15 +71,15 @@ const process = require('process');
|
|||
const opentelemetry = require('@opentelemetry/sdk-node');
|
||||
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
|
||||
const { ConsoleSpanExporter } = require('@opentelemetry/sdk-trace-base');
|
||||
const { Resource } = require('@opentelemetry/resources');
|
||||
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
|
||||
const { resourceFromAttributes } = require('@opentelemetry/resources');
|
||||
const { ATTR_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
|
||||
|
||||
// configure the SDK to export telemetry data to the console
|
||||
// enable all auto-instrumentations from the meta package
|
||||
const traceExporter = new ConsoleSpanExporter();
|
||||
const sdk = new opentelemetry.NodeSDK({
|
||||
resource: new Resource({
|
||||
[SemanticResourceAttributes.SERVICE_NAME]: 'my-service',
|
||||
resource: resourceFromAttributes({
|
||||
[ATTR_SERVICE_NAME]: 'my-service',
|
||||
}),
|
||||
traceExporter,
|
||||
instrumentations: [getNodeAutoInstrumentations()]
|
||||
|
@ -101,19 +104,19 @@ process.on('SIGTERM', () => {
|
|||
node -r ./tracing.js app.js
|
||||
```
|
||||
|
||||
The above example will emit auto-instrumented telemetry about your Node.js application to the console. For a more in-depth example, see the [Getting Started Guide](https://opentelemetry.io/docs/js/getting-started/). For more information about automatic instrumentation see [@opentelemetry/sdk-trace-node][otel-node], which provides auto-instrumentation for Node.js applications. If the automatic instrumentation does not suit your needs, or you would like to create manual traces, see [@opentelemetry/sdk-trace-base][otel-tracing]
|
||||
The above example will emit auto-instrumented telemetry about your Node.js application to the console. For a more in-depth example, see the [Getting Started Guide](https://opentelemetry.io/docs/languages/js/getting-started/). For more information about automatic instrumentation see [@opentelemetry/sdk-trace-node][otel-node], which provides auto-instrumentation for Node.js applications. If the automatic instrumentation does not suit your needs, or you would like to create manual traces, see [@opentelemetry/sdk-trace-base][otel-tracing]
|
||||
|
||||
## Library Author
|
||||
|
||||
If you are a library author looking to build OpenTelemetry into your library, please see [the documentation][docs]. As a library author, it is important that you only depend on properties and methods published on the public API. If you use any properties or methods from the SDK that are not officially a part of the public API, your library may break if an [Application Owner](#application-owner) uses a different SDK implementation.
|
||||
If you are a library author looking to build OpenTelemetry into your library, please see [the documentation][docs]. As a library author, it is important that you only depend on properties and methods published on the public API. If you use any properties or methods from the SDK that are not officially a part of the public API, your library may break if an application owner uses a different SDK implementation.
|
||||
|
||||
## Supported Runtimes
|
||||
|
||||
| Platform Version | Supported |
|
||||
|---------------------|-----------------------------------------------|
|
||||
| ------------------- | --------------------------------------------- |
|
||||
| Node.JS `v22` | :heavy_check_mark: |
|
||||
| Node.JS `v20` | :heavy_check_mark: |
|
||||
| Node.JS `v18` | :heavy_check_mark: |
|
||||
| Node.JS `v16` | :heavy_check_mark: |
|
||||
| Node.JS `v14` | :heavy_check_mark: |
|
||||
| Older Node Versions | See [Node Support](#node-support) |
|
||||
| Web Browsers | See [Browser Support](#browser-support) below |
|
||||
|
||||
|
@ -121,8 +124,6 @@ If you are a library author looking to build OpenTelemetry into your library, pl
|
|||
|
||||
Only Node.js Active or Maintenance LTS versions are supported.
|
||||
Previous versions of node *may* work, but they are not tested by OpenTelemetry and they are not guaranteed to work.
|
||||
Note that versions of Node.JS v8 prior to `v8.12.0` will NOT work, because OpenTelemetry Node depends on the
|
||||
`perf_hooks` module introduced in `v8.5.0` and `performance.timeOrigin` that is set correctly starting in `v8.12.0`.
|
||||
|
||||
### Browser Support
|
||||
|
||||
|
@ -130,8 +131,24 @@ Note that versions of Node.JS v8 prior to `v8.12.0` will NOT work, because OpenT
|
|||
> Client instrumentation for the browser is **experimental** and mostly **unspecified**. If you are interested in
|
||||
> helping out, get in touch with the [Client Instrumentation SIG][client-instrumentation-sig].
|
||||
|
||||
There is currently no list of officially supported browsers. OpenTelemetry is developed using standard web
|
||||
technologies and aims to work in currently supported versions of major browsers.
|
||||
Rather than define versions of specific browsers / runtimes, OpenTelemetry sets the minimum supported version based on the
|
||||
underlying language features used.
|
||||
|
||||
The current minumum language feature support is set as [ECMAScript 2022](https://262.ecma-international.org/13.0/) that are available
|
||||
in all modern browsers / runtimes.
|
||||
|
||||
This means that if you are targeting or your end-users are using a browser / runtime that does not support ES2022, you will need
|
||||
to transpile the code and provide any necessary polyfills for the missing features to ensure compatibility with your target
|
||||
environments. Any support issues that arise from using a browser or runtime that does not support ES2022 will be closed as "won't fix".
|
||||
|
||||
This minimum support level is subject to change as the project evolves and as the underlying language features evolve.
|
||||
|
||||
## TypeScript Support
|
||||
|
||||
OpenTelemetry JavaScript is built with TypeScript `v5.0.4`. If you have a TypeScript project (app, library, instrumentation, etc.)
|
||||
that depends on it, we recommend using same or higher version to compile the project.
|
||||
|
||||
OpenTelemetry JavaScript will follows DefinitelyType's [support policy for TypeScript](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window) which sets a support window of 2 years. Support for TypeScript versions older than 2 years will be dropped in minor releases of OpenTelemetry JavaScript.
|
||||
|
||||
## Package Version Compatibility
|
||||
|
||||
|
@ -141,19 +158,49 @@ There may also be API packages for experimental signals in the experimental dire
|
|||
All stable packages are released with the same version, and all experimental packages are released with the same version.
|
||||
The below table describes which versions of each set of packages are expected to work together.
|
||||
|
||||
| API | Stable Packages | Experimental Packages |
|
||||
| ----- | --------------- | --------------------- |
|
||||
| 1.3.x | 1.9.x | 0.35.x |
|
||||
| 1.3.x | 1.8.x | 0.34.x |
|
||||
| 1.2.x | 1.7.x | 0.33.x |
|
||||
| 1.2.x | 1.6.x | 0.32.x |
|
||||
| 1.1.x | 1.5.x | 0.31.x |
|
||||
| 1.1.x | 1.4.x | 0.30.x |
|
||||
| 1.1.x | 1.3.x | 0.29.x |
|
||||
| 1.1.x | 1.2.x | 0.29.x |
|
||||
| 1.1.x | 1.1.x | 0.28.x |
|
||||
| 1.0.x | 1.0.x | 0.27.x |
|
||||
| 1.0.x | 1.0.x | 0.26.x |
|
||||
| Stable Packages | Experimental Packages |
|
||||
|-----------------|-----------------------|
|
||||
| 2.0.x | 0.200.x |
|
||||
| 1.30.x | 0.57.x |
|
||||
| 1.29.x | 0.56.x |
|
||||
| 1.28.x | 0.55.x |
|
||||
| 1.27.x | 0.54.x |
|
||||
| 1.25.x | 0.52.x |
|
||||
|
||||
<details>
|
||||
<summary>Older version compatibility matrix</summary>
|
||||
|
||||
<table>
|
||||
<tr><th>Stable Packages</th> <th>Experimental Packages</th></tr>
|
||||
<tr><td>1.24.x</td> <td>0.51.x</td></tr>
|
||||
<tr><td>1.23.x</td> <td>0.50.x</td></tr>
|
||||
<tr><td>1.22.x</td> <td>0.49.x</td></tr>
|
||||
<tr><td>1.21.x</td> <td>0.48.x</td></tr>
|
||||
<tr><td>1.20.x</td> <td>0.47.x</td></tr>
|
||||
<tr><td>1.19.x</td> <td>0.46.x</td></tr>
|
||||
<tr><td>1.18.x</td> <td>0.45.x</td></tr>
|
||||
<tr><td>1.17.x</td> <td>0.43.x, 0.44.x</td></tr>
|
||||
<tr><td>1.16.x</td> <td>0.42.x</td></tr>
|
||||
<tr><td>1.15.x</td> <td>0.41.x</td></tr>
|
||||
<tr><td>1.14.x</td> <td>0.40.x</td></tr>
|
||||
<tr><td>1.13.x</td> <td>0.39.x</td></tr>
|
||||
<tr><td>1.12.x</td> <td>0.38.x</td></tr>
|
||||
<tr><td>1.11.x</td> <td>0.37.x</td></tr>
|
||||
<tr><td>1.10.x</td> <td>0.36.x</td></tr>
|
||||
<tr><td>1.9.x</td> <td>0.35.x</td></tr>
|
||||
<tr><td>1.8.x (this and later versions require API >=1.3.0 for metrics)</td><td>0.34.x</td></tr>
|
||||
<tr><td>1.7.x</td> <td>0.33.x</td></tr>
|
||||
<tr><td>1.6.x</td> <td>0.32.x</td></tr>
|
||||
<tr><td>1.5.x</td> <td>0.31.x</td></tr>
|
||||
<tr><td>1.4.x</td> <td>0.30.x</td></tr>
|
||||
<tr><td>1.3.x</td> <td>0.29.x</td></tr>
|
||||
<tr><td>1.2.x</td> <td>0.29.x</td></tr>
|
||||
<tr><td>1.1.x</td> <td>0.28.x</td></tr>
|
||||
<tr><td>1.0.x</td> <td>0.27.x</td></tr>
|
||||
<tr><td>1.0.x (this and later versions require API >=1.0.0 for traces)</td><td>0.26.x</td></tr>
|
||||
</table>
|
||||
|
||||
</details>
|
||||
|
||||
## Versioning
|
||||
|
||||
|
@ -178,51 +225,85 @@ instructions to build and make changes to this project, see the
|
|||
|
||||
We have a weekly SIG meeting! See the [community page](https://github.com/open-telemetry/community#javascript-sdk) for meeting details and notes.
|
||||
|
||||
### Community members
|
||||
### Maintainers
|
||||
|
||||
#### Maintainers ([@open-telemetry/js-maintainers](https://github.com/orgs/open-telemetry/teams/javascript-maintainers))
|
||||
|
||||
- [Amir Blum](https://github.com/blumamir), Keyval
|
||||
- [Chengzhong Wu](https://github.com/legendecas), Alibaba
|
||||
- [Amir Blum](https://github.com/blumamir), Odigos
|
||||
- [Chengzhong Wu](https://github.com/legendecas), Bloomberg
|
||||
- [Daniel Dyla](https://github.com/dyladan), Dynatrace
|
||||
- [Marc Pichler](https://github.com/pichlermarc), Dynatrace
|
||||
|
||||
*Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).*
|
||||
|
||||
#### Approvers ([@open-telemetry/js-approvers](https://github.com/orgs/open-telemetry/teams/javascript-approvers))
|
||||
|
||||
- [Gerhard Stöbich](https://github.com/Flarna), Dynatrace
|
||||
- [Haddas Bronfman](https://github.com/haddasbronfman), Cisco
|
||||
- [Hector Hernandez](https://github.com/hectorhdzg), Microsoft
|
||||
- [Jamie Danielson](https://github.com/JamieDanielson), Honeycomb
|
||||
- [Marc Pichler](https://github.com/pichlermarc), Dynatrace
|
||||
- [Trent Mick](https://github.com/trentm), Elastic
|
||||
|
||||
For more information about the maintainer role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer).
|
||||
|
||||
### Approvers
|
||||
|
||||
- [David Luna](https://github.com/david-luna), Elastic
|
||||
- [Hector Hernandez](https://github.com/hectorhdzg), Microsoft
|
||||
- [Martin Kuba](https://github.com/martinkuba), Lightstep
|
||||
- [Marylia Gutierrez](https://github.com/maryliag), Grafana Labs
|
||||
- [Matthew Wear](https://github.com/mwear), LightStep
|
||||
- [Naseem K. Ullah](https://github.com/naseemkullah), Transit
|
||||
- [Neville Wylie](https://github.com/MSNev), Microsoft
|
||||
- [Purvi Kanal](https://github.com/pkanal), Honeycomb
|
||||
- [Svetlana Brennan](https://github.com/svetlanabrennan), New Relic
|
||||
|
||||
*Find more about the approver role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver).*
|
||||
For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver).
|
||||
|
||||
#### Emeriti
|
||||
### Triagers
|
||||
|
||||
- [Bartlomiej Obecny](https://github.com/obecny), LightStep, Maintainer
|
||||
- [Daniel Khan](https://github.com/dkhan), Dynatrace, Maintainer
|
||||
- [Mayur Kale](https://github.com/mayurkale22), Google, Maintainer
|
||||
Members of this team have triager permissions for opentelemetry-js.git and opentelemetry-js-contrib.git.
|
||||
|
||||
- [Jackson Weber](https://github.com/JacksonWeber), Microsoft
|
||||
|
||||
For more information about the triager role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#triager).
|
||||
|
||||
### Contrib Triagers
|
||||
|
||||
Members of this team have triager permissions for opentelemetry-js-contrib.git.
|
||||
Typically, members of this are [component owners](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/.github/component_owners.yml) of one or more packages in the contrib repo.
|
||||
|
||||
- [Aaron Abbott](https://github.com/aabmass), Google
|
||||
- [Abhinav Mathur](https://github.com/abhee11), AppDynamics
|
||||
- [Bartlomiej Obecny](https://github.com/obecny)
|
||||
- [Daniel Li](https://github.com/d4nyll)
|
||||
- [Florencia Acosta](https://github.com/facostaembrace), Embrace
|
||||
- [Jackson Weber](https://github.com/JacksonWeber), Microsoft
|
||||
- [Jaryk](https://github.com/Ugzuzg), Volvo Cars
|
||||
- [Jonathan Lee](https://github.com/jj22ee)
|
||||
- [Jonathan Munz](https://github.com/jpmunz), Embrace
|
||||
- [kirrg001](https://github.com/kirrg001), Instana
|
||||
- [MartenH](https://github.com/mhennoch), Splunk
|
||||
- [Mike Goldsmith](https://github.com/MikeGoldsmith), Honeycomb
|
||||
- [Motti](https://github.com/mottibec)
|
||||
- [Punya Biswal](https://github.com/punya), Google
|
||||
- [Siim Kallas](https://github.com/seemk), Splunk
|
||||
- [t2t2](https://github.com/t2t2), Splunk
|
||||
- [Trivikram Kamat](https://github.com/trivikr), AWS
|
||||
|
||||
For more information about the triager role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#triager).
|
||||
|
||||
### Emeriti
|
||||
|
||||
- [Bartlomiej Obecny](https://github.com/obecny), Maintainer
|
||||
- [Brandon Gonzalez](https://github.com/bg451), Approver
|
||||
- [Daniel Khan](https://github.com/dkhan), Maintainer
|
||||
- [Gerhard Stöbich](https://github.com/Flarna), Approver
|
||||
- [Haddas Bronfman](https://github.com/haddasbronfman), Approver
|
||||
- [John Bley](https://github.com/johnbley), Approver
|
||||
- [Mark Wolff](https://github.com/markwolff), Approver
|
||||
- [Mayur Kale](https://github.com/mayurkale22), Maintainer
|
||||
- [Naseem K. Ullah](https://github.com/naseemkullah), Approver
|
||||
- [Olivier Albertini](https://github.com/OlivierAlbertini), Approver
|
||||
- [Rauno Viskus](https://github.com/rauno56), Maintainer
|
||||
- [Roch Devost](https://github.com/rochdev), Approver
|
||||
- [Valentin Marchaud](https://github.com/vmarchaud), Maintainer
|
||||
- [Brandon Gonzalez](https://github.com/bg451), LightStep, Approver
|
||||
- [Roch Devost](https://github.com/rochdev), DataDog, Approver
|
||||
- [John Bley](https://github.com/johnbley), Splunk, Approver
|
||||
- [Mark Wolff](https://github.com/markwolff), Microsoft, Approver
|
||||
- [Olivier Albertini](https://github.com/OlivierAlbertini), Ville de Montréal, Approver
|
||||
|
||||
*Find more about the emeritus role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#emeritus-maintainerapprovertriager).*
|
||||
For more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager).
|
||||
|
||||
#### Thanks to all the people who already contributed
|
||||
### Thanks to all of our contributors!
|
||||
|
||||
<a href="https://github.com/open-telemetry/opentelemetry-js/graphs/contributors">
|
||||
<img src="https://contributors-img.web.app/image?repo=open-telemetry/opentelemetry-js" />
|
||||
<img alt="Repo contributors" src="https://contrib.rocks/image?repo=open-telemetry/opentelemetry-js" />
|
||||
</a>
|
||||
|
||||
## Packages
|
||||
|
@ -285,266 +366,9 @@ These instrumentations are hosted at <https://github.com/open-telemetry/opentele
|
|||
| -------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
||||
| [@opentelemetry/shim-opentracing][otel-shim-opentracing] | OpenTracing shim allows existing OpenTracing instrumentation to report to OpenTelemetry |
|
||||
|
||||
## Upgrade guidelines
|
||||
|
||||
### 0.37.x to 0.38.0
|
||||
|
||||
- `@opentelemetry/sdk-node` `NodeSDKConfiguration.defaultAttributes` has been unused and was removed as the concept does not exist in OpenTelemetry anymore
|
||||
- Please use `NodeSDKConfiguration.resource` instead.
|
||||
|
||||
### 0.35.x to 0.36.0
|
||||
|
||||
- `@opentelemetry/sdk-node` changed `await start()` to now be synchronous
|
||||
- `@opentelemetry/sdk-node` changed `await detectResources()` to now be synchronous
|
||||
|
||||
### 0.28.x to 0.29.x
|
||||
|
||||
- `@opentelemetry/exporter-trace-otlp-http` is now exporting `scopeSpans` instead of `instrumentationLibrarySpans`
|
||||
- this exporter now requires collector version `0.48` and up.
|
||||
- `@opentelemetry/exporter-metrics-otlp-http` is now exporting `scopeMetrics` instead of `instrumentationLibraryMetrics`
|
||||
- this exporter now requires collector version `0.48` and up.
|
||||
|
||||
### 0.27.x to 0.28.x
|
||||
|
||||
- In `@opentelemetry/exporter-trace-otlp-http`, `OTLPExporterBase._isShutdown` is replaced with `_shutdownOnce`.
|
||||
|
||||
### 0.26.x to 0.27.x
|
||||
|
||||
Metric and trace exporters are split into separate packages:
|
||||
|
||||
- `@opentelemetry/exporter-otlp-http` => `@opentelemetry/exporter-trace-otlp-http` and `@opentelemetry/exporter-metrics-otlp-http`
|
||||
- `@opentelemetry/exporter-otlp-grpc` => `@opentelemetry/exporter-trace-otlp-grpc` and `@opentelemetry/exporter-metrics-otlp-grpc`
|
||||
- `@opentelemetry/exporter-otlp-proto` => `@opentelemetry/exporter-trace-otlp-proto` and `@opentelemetry/exporter-metrics-otlp-proto`
|
||||
|
||||
Metric types are renamed:
|
||||
|
||||
- `@openetelemetry/api-metrics`
|
||||
- `Meter`
|
||||
- `createValueRecorder` => `createHistogram`
|
||||
- `createValueObserver` => `createObservableGauge`
|
||||
- `createSumObserver` => `createObservableCounter`
|
||||
- `createUpDownSumObserver` => `createObservableUpDownCounter`
|
||||
- `ValueRecorder` => `Histogram`
|
||||
- `ValueObserver` => `ObservableGauge`
|
||||
- `SumObserver` => `ObservableCounter`
|
||||
- `UpDownSumObserver` => `ObservableUpDownCounter`
|
||||
- `ObserverResult` => `ObservableResult`
|
||||
- `Observation.observer` => `Observation.observable`
|
||||
- `@opentelemetry/sdk-metrics-base`
|
||||
- `MetricKind`
|
||||
- `VALUE_RECORDER` => `HISTOGRAM`
|
||||
- `SUM_OBSERVER` => `OBSERVABLE_COUNTER`
|
||||
- `UP_DOWN_SUM_OBSERVER` => `OBSERVABLE_UP_DOWN_COUNTER`
|
||||
- `VALUE_OBSERVER` => `OBSERVABLE_GAUGE`
|
||||
|
||||
### 0.25.x to 1.x.y
|
||||
|
||||
Collector exporter packages and types are renamed:
|
||||
|
||||
- `@opentelemetry/exporter-collector` => `@opentelemetry/exporter-otlp-http`
|
||||
- `CollectorExporterBase` => `OTLPExporterBase`
|
||||
- `CollectorTraceExporter` => `OTLPTraceExporter`
|
||||
- `CollectorMetricExporter` => `OTLPMetricExporter`
|
||||
- `CollectorExporterBrowserBase` => `OTLPExporterBrowserBase`
|
||||
- `CollectorExporterNodeBase` => `OTLPExporterNodeBase`
|
||||
- `CollectorExporterConfigBase` => `OTLPExporterConfigBase`
|
||||
- `CollectorExporterError` => `OTLPExporterError`
|
||||
- `COLLECTOR_SPAN_KIND_MAPPING` => `OTLP_SPAN_KIND_MAPPING`
|
||||
- `collectorTypes` => `otlpTypes`
|
||||
- `@opentelemetry/exporter-collector-grpc` => `@opentelemetry/exporter-otlp-grpc`
|
||||
- `CollectorTraceExporter` => `OTLPTraceExporter`
|
||||
- `CollectorMetricExporter` => `OTLPMetricExporter`
|
||||
- `CollectorExporterConfigNode` => `OTLPExporterConfigNode`
|
||||
- `@opentelemetry/exporter-collector-proto` => `@opentelemetry/exporter-otlp-proto`
|
||||
- `CollectorExporterNodeBase` => `OTLPExporterNodeBase`
|
||||
- `CollectorMetricExporter` => `OTLPMetricExporter`
|
||||
- `CollectorTraceExporter` => `OTLPTraceExporter`
|
||||
- W3C propagators in @opentelemetry/core were renamed
|
||||
- `HttpTraceContextPropagator` -> `W3CTraceContextPropagator`
|
||||
- `HttpBaggagePropagator` -> `W3CBaggagePropagator`
|
||||
|
||||
### 0.24.x to 0.25.x
|
||||
|
||||
- SDKs packages for trace and metrics has been renamed to have a consistent naming schema:
|
||||
- @opentelemetry/tracing -> @opentelemetry/sdk-trace-base
|
||||
- @opentelemetry/node -> @opentelemetry/sdk-trace-node
|
||||
- @opentelemetry/web -> @opentelemetry/sdk-trace-web
|
||||
- @opentelemetry/metrics -> @opentelemetry/sdk-metrics-base
|
||||
- @opentelemetry/node-sdk -> @opentelemetry/sdk-node
|
||||
|
||||
### 0.23.x to 0.24.x
|
||||
|
||||
- `ResourceAttributes` renamed to `SemanticResourceAttributes` in the `@opentelemetry/semantic-conventions` package
|
||||
|
||||
### 0.19.x to 0.20.0
|
||||
|
||||
- `HttpBaggage` renamed to `HttpBaggagePropagator`
|
||||
|
||||
- `HttpTraceContext` renamed to `HttpTraceContextPropagator`
|
||||
|
||||
- `JaegerHttpTracePropagator` renamed to `JaegerPropagator`
|
||||
|
||||
- `serviceName` configuration removed from Collector exporters. Use `service.name` Resource attribute instead.
|
||||
|
||||
- Prometheus exporter added suffix `_total` to counter metrics.
|
||||
|
||||
### 0.18.x to 0.19.0
|
||||
|
||||
- API is now a peer dependency. This means that users will need to include `@opentelemetry/api` as a dependency of their project in order to use the SDK. NPM version 7+ (Node 15+) should do this automatically.
|
||||
|
||||
- All plugins have been removed in favor of instrumentations.
|
||||
|
||||
- The `@opentelemetry/propagator-b3` package previously exported three propagators: `B3Propagator`,`B3SinglePropagator`, and `B3MultiPropagator`, but now only exports the `B3Propagator`. It extracts b3 context in single and multi-header encodings, and injects context using the single-header encoding by default, but can be configured to inject context using the multi-header endcoding during construction: `new B3Propagator({ injectEncoding: B3InjectEncoding.MULTI_HEADER })`. If you were previously using the `B3SinglePropagator` or `B3MultiPropagator` directly, you should update your code to use the `B3Propagator` with the appropriate configuration. See the [readme][otel-propagator-b3] for full details and usage.
|
||||
|
||||
- Sampling configuration via environment variable has changed. If you were using `OTEL_SAMPLING_PROBABILITY` then you should replace it with `OTEL_TRACES_SAMPLER=parentbased_traceidratio` and `OTEL_TRACES_SAMPLER_ARG=<number>` where `<number>` is a number in the [0..1] range, e.g. "0.25". Default is 1.0 if unset.
|
||||
|
||||
### 0.17.0 to 0.18.0
|
||||
|
||||
- `diag.setLogLevel` is removed and LogLevel can be set by an optional second parameter to `setLogger`
|
||||
|
||||
[PR-1975](https://github.com/open-telemetry/opentelemetry-js/pull/1975)
|
||||
|
||||
- Breaking change - The resulting resource MUST have all attributes that are on any of the two input resources. If a key exists on both the old and updating resource, the value of the updating resource MUST be picked - previously it was opposite.
|
||||
|
||||
### 0.16.0 to 0.17.0
|
||||
|
||||
[PR-1880](https://github.com/open-telemetry/opentelemetry-js/pull/1880) feat(diag-logger): introduce a new global level api.diag for internal diagnostic logging
|
||||
|
||||
[PR-1925](https://github.com/open-telemetry/opentelemetry-js/pull/1925) feat(diag-logger): part 2 - breaking changes - remove api.Logger, api.NoopLogger, core.LogLevel, core.ConsoleLogger
|
||||
|
||||
- These PR's remove the previous `Logger` and `LogLevel` implementations and change the way you should use the replacement `DiagLogger` and `DiagLogLevel`, below are simple examples of how to change your existing usages.
|
||||
|
||||
#### Setting the global diagnostic logger
|
||||
|
||||
The new global [`api.diag`](https://github.com/open-telemetry/opentelemetry-js/blob/main/api/src/api/diag.ts) provides the ability to set the global diagnostic logger `setLogger()` and logging level `setLogLevel()`, it is also a `DiagLogger` implementation and should be directly to log diagnostic messages.
|
||||
|
||||
All included logger references have been removed in preference to using the global `api.diag` directly, so you no longer need to pass around the logger instance via function parameters or included as part of the configuration for a component.
|
||||
|
||||
```javascript
|
||||
import { diag, DiagConsoleLogger, DiagLogLevel } from "@opentelemetry/api";
|
||||
// Setting the default Global logger to use the Console
|
||||
// And optionally change the logging level (Defaults to INFO)
|
||||
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.ERROR)
|
||||
```
|
||||
|
||||
#### Using the logger anywhere in the code
|
||||
|
||||
```typescript
|
||||
import { diag } from "@opentelemetry/api";
|
||||
|
||||
// Remove or make optional the parameter and don't use it.
|
||||
export function MyFunction() {
|
||||
diag.debug("...");
|
||||
diag.info("...");
|
||||
diag.warn("...");
|
||||
diag.error("...");
|
||||
diag.verbose("..");
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
#### Setting the logger back to a noop
|
||||
|
||||
```typescript
|
||||
import { diag } from "@opentelemetry/api";
|
||||
diag.setLogger();
|
||||
|
||||
```
|
||||
|
||||
[PR-1855](https://github.com/open-telemetry/opentelemetry-js/pull/1855) Use instrumentation loader to load plugins and instrumentations
|
||||
|
||||
- Providers do no load the plugins anymore. Also PluginLoader has been removed from providers, use `registerInstrumentations` instead
|
||||
|
||||
```javascript
|
||||
//Previously in node
|
||||
const provider = new NodeTracerProvider({
|
||||
plugins: {
|
||||
'@grpc/grpc-js': {
|
||||
enabled: true,
|
||||
path: '@opentelemetry/plugin-grpc-js',
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
// Now
|
||||
const provider = new NodeTracerProvider();
|
||||
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
|
||||
registerInstrumentations({
|
||||
instrumentations: [
|
||||
{
|
||||
plugins: {
|
||||
'@grpc/grpc-js': {
|
||||
enabled: true,
|
||||
path: '@opentelemetry/plugin-grpc-js',
|
||||
},
|
||||
}
|
||||
}
|
||||
],
|
||||
tracerProvider: provider,
|
||||
});
|
||||
|
||||
// or if you want to load only default instrumentations / plugins
|
||||
registerInstrumentations({
|
||||
tracerProvider: provider,
|
||||
});
|
||||
|
||||
//Previously in browser
|
||||
const provider = new WebTracerProvider({
|
||||
plugins: [
|
||||
new DocumentLoad()
|
||||
]
|
||||
});
|
||||
// Now
|
||||
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
|
||||
const provider = new WebTracerProvider();
|
||||
registerInstrumentations({
|
||||
instrumentations: [
|
||||
new DocumentLoad(),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
- `registerInstrumentations` supports loading old plugins and instrumentations together. It also supports setting tracer provider and meter provider on instrumentations
|
||||
|
||||
[PR-1874](https://github.com/open-telemetry/opentelemetry-js/pull/1874) More specific API type names
|
||||
|
||||
Some types exported from `"@opentelemetry/api"` have been changed to be more specific.
|
||||
|
||||
- `AttributeValue` renamed to `SpanAttributeValue`
|
||||
- `Attributes` renamed to `SpanAttributes`
|
||||
- `EntryTtl` renamed to `BaggageEntryTtl`
|
||||
- `EntryValue` renamed to `BaggageEntryValue`
|
||||
- `Status` renamed to `SpanStatus`
|
||||
- `StatusCode` renamed to `SpanStatusCode`
|
||||
|
||||
### 0.15.0 to 0.16.0
|
||||
|
||||
[PR-1863](https://github.com/open-telemetry/opentelemetry-js/pull/1863) removed public attributes `keepAlive` and `httpAgentOptions` from nodejs `CollectorTraceExporter` and `CollectorMetricExporter`
|
||||
|
||||
### 0.14.0 to 0.15.0
|
||||
|
||||
[PR-1764](https://github.com/open-telemetry/opentelemetry-js/pull/1764) removed some APIs from `Tracer`:
|
||||
|
||||
- `Tracer.getCurrentSpan()`: use `api.getSpan(api.context.active())`
|
||||
- `Tracer.withSpan(span)`: use `api.context.with(api.setSpan(api.context.active(), span))`
|
||||
- `Tracer.bind(target)`: use `api.context.bind(target)`
|
||||
|
||||
[PR-1797](https://github.com/open-telemetry/opentelemetry-js/pull/1797) chore!: split metrics into its own api package:
|
||||
|
||||
- Any references to `require("@opentelemetry/api").metrics` will need to be changed to `require("@opentelemetry/api-metrics").metrics`
|
||||
|
||||
[PR-1725](https://github.com/open-telemetry/opentelemetry-js/pull/1725) Use new gRPC default port
|
||||
|
||||
- The default port used by `@opentelemetry/exporter-collector-grpc` is changed from `55680` to `4317`
|
||||
|
||||
[PR-1749](https://github.com/open-telemetry/opentelemetry-js/pull/1749) chore: improve naming of span related context APIs
|
||||
|
||||
- Rename `[gs]etActiveSpan()` to `[gs]etSpan()`
|
||||
- Rename `setExtractedSpanContext()` to `setSpanContext()`
|
||||
- Rename `getParentSpanContext()` to `getSpanContext()`
|
||||
|
||||
## Useful links
|
||||
|
||||
- [Upgrade to SDK 2.x guide](./doc/upgrade-to-2.x.md)
|
||||
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
|
||||
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]
|
||||
|
||||
|
@ -576,6 +400,5 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
|
|||
[otel-web]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-web
|
||||
[otel-api]: https://github.com/open-telemetry/opentelemetry-js/tree/main/api
|
||||
[otel-core]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-core
|
||||
[otel-propagator-b3]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-propagator-b3
|
||||
|
||||
[spec-versioning]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md
|
||||
|
|
|
@ -1,9 +1,52 @@
|
|||
<!-- markdownlint-disable MD004 -->
|
||||
# CHANGELOG
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## Unreleased
|
||||
|
||||
### :boom: Breaking Change
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(api): improve isValidSpanId, isValidTraceId performance [#5714](https://github.com/open-telemetry/opentelemetry-js/pull/5714) @seemk
|
||||
* feat(diag): change types in `DiagComponentLogger` from `any` to `unknown`[#5478](https://github.com/open-telemetry/opentelemetry-js/pull/5478) @loganrosen
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
### :books: (Refine Doc)
|
||||
|
||||
### :house: (Internal)
|
||||
|
||||
* refactor(api): remove "export *" in favor of explicit named exports [#4880](https://github.com/open-telemetry/opentelemetry-js/pull/4880) @robbkidd
|
||||
* chore: enable tsconfig isolatedModules [#5697](https://github.com/open-telemetry/opentelemetry-js/pull/5697) @legendecas
|
||||
|
||||
## 1.9.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(metrics): added synchronous gauge [#4528](https://github.com/open-telemetry/opentelemetry-js/pull/4528) @clintonb
|
||||
* feat(api): allow adding span links after span creation [#4536](https://github.com/open-telemetry/opentelemetry-js/pull/4536) @seemk
|
||||
* This change is non-breaking for end-users, but breaking for Trace SDK implmentations in accordance with the [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/a03382ada8afa9415266a84dafac0510ec8c160f/specification/upgrading.md?plain=1#L97-L122) as new features need to be implemented.
|
||||
* feat: support node 22 [#4666](https://github.com/open-telemetry/opentelemetry-js/pull/4666) @dyladan
|
||||
|
||||
## 1.8.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(api): add SugaredTracer for functions not defined in the spec
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
||||
* fix(api): fix unreachable @opentelemetry/api/experimental entry [#4446](https://github.com/open-telemetry/opentelemetry-js/pull/4446) @legendecas
|
||||
|
||||
## 1.7.0
|
||||
|
||||
### :rocket: (Enhancement)
|
||||
|
||||
* feat(metrics): prototype experimental advice support [#3876](https://github.com/open-telemetry/opentelemetry-js/pull/3876) @legendecas
|
||||
* feat(api): publish api esnext target [#4231](https://github.com/open-telemetry/opentelemetry-js/pull/4231) @legendecas
|
||||
|
||||
## 1.6.0
|
||||
|
||||
### :bug: (Bug Fix)
|
||||
|
@ -66,13 +109,13 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
* export tracer options ([#154](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/154)) ([b125324](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/b125324438fb2f24eb80c7c6673afc8cfc99575e))
|
||||
|
||||
### [1.0.4](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.3...v1.0.4) (2021-12-18)
|
||||
## [1.0.4](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.3...v1.0.4) (2021-12-18)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* align globalThis fallbacks with otel-core ([#126](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/126)) ([3507de7](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/3507de7c3b95396696657c021953b0b24a63a029))
|
||||
|
||||
### [1.0.3](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.2...v1.0.3) (2021-08-30)
|
||||
## [1.0.3](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.2...v1.0.3) (2021-08-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ npm install @opentelemetry/api @opentelemetry/sdk-trace-base
|
|||
|
||||
### Trace Your Application
|
||||
|
||||
In order to get started with tracing, you will need to first register an SDK. The SDK you are using may provide a convenience method which calls the registration methods for you, but if you would like to call them directly they are documented here: [sdk registration methods][docs-sdk-registration].
|
||||
In order to get started with tracing, you will need to first register an SDK. The SDK you are using may provide a convenience method which calls the registration methods for you, but if you would like to call them directly they are documented here: [SDK registration methods][docs-sdk-registration].
|
||||
|
||||
Once you have registered an SDK, you can start and end spans. A simple example of basic SDK registration and tracing a simple operation is below. The example should export spans to the console once per second. For more information, see the [tracing documentation][docs-tracing].
|
||||
|
||||
|
@ -45,8 +45,9 @@ const { trace } = require("@opentelemetry/api");
|
|||
const { BasicTracerProvider, ConsoleSpanExporter, SimpleSpanProcessor } = require("@opentelemetry/sdk-trace-base");
|
||||
|
||||
// Create and register an SDK
|
||||
const provider = new BasicTracerProvider();
|
||||
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
|
||||
const provider = new BasicTracerProvider({
|
||||
spanProcessors: [new SimpleSpanProcessor(new ConsoleSpanExporter())]
|
||||
});
|
||||
trace.setGlobalTracerProvider(provider);
|
||||
|
||||
// Acquire a tracer from the global tracer provider which will be used to trace the application
|
||||
|
@ -112,6 +113,5 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
|
|||
|
||||
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
|
||||
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/api/LICENSE
|
||||
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
|
||||
[docs-tracing]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/tracing.md
|
||||
[docs-sdk-registration]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/sdk-registration.md
|
||||
|
|
|
@ -1,31 +1,40 @@
|
|||
{
|
||||
"name": "@opentelemetry/api",
|
||||
"version": "1.6.0",
|
||||
"version": "1.9.0",
|
||||
"description": "Public API for OpenTelemetry",
|
||||
"main": "build/src/index.js",
|
||||
"module": "build/esm/index.js",
|
||||
"esnext": "build/esnext/index.js",
|
||||
"types": "build/src/index.d.ts",
|
||||
"browser": {
|
||||
"./src/platform/index.ts": "./src/platform/browser/index.ts",
|
||||
"./build/esm/platform/index.js": "./build/esm/platform/browser/index.js",
|
||||
"./build/esnext/platform/index.js": "./build/esnext/platform/browser/index.js",
|
||||
"./build/src/platform/index.js": "./build/src/platform/browser/index.js"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"module": "./build/esm/index.js",
|
||||
"esnext": "./build/esnext/index.js",
|
||||
"types": "./build/src/index.d.ts",
|
||||
"default": "./build/src/index.js"
|
||||
},
|
||||
"./experimental": {
|
||||
"module": "./build/esm/experimental/index.js",
|
||||
"esnext": "./build/esnext/experimental/index.js",
|
||||
"types": "./build/src/experimental/index.d.ts",
|
||||
"default": "./build/src/experimental/index.js"
|
||||
}
|
||||
},
|
||||
"repository": "open-telemetry/opentelemetry-js",
|
||||
"scripts": {
|
||||
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
||||
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../",
|
||||
"codecov:webworker": "nyc report --reporter=json && codecov -f coverage/*.json -p ../",
|
||||
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../",
|
||||
"precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies",
|
||||
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
||||
"docs": "typedoc",
|
||||
"docs:deploy": "gh-pages --dist docs/out",
|
||||
"docs:test": "linkinator docs/out --silent && linkinator docs/*.md *.md --markdown --silent",
|
||||
"lint:fix": "eslint . --ext .ts --fix",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"test:browser": "karma start --single-run",
|
||||
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
|
||||
"test:eol": "ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
|
||||
"test": "nyc mocha 'test/**/*.test.ts'",
|
||||
"test:webworker": "karma start karma.worker.js --single-run",
|
||||
"cycle-check": "dpdm --exit-code circular:1 src/index.ts",
|
||||
"version": "node ../scripts/version-update.js",
|
||||
|
@ -51,6 +60,9 @@
|
|||
"build/esm/**/*.js",
|
||||
"build/esm/**/*.js.map",
|
||||
"build/esm/**/*.d.ts",
|
||||
"build/esnext/**/*.js",
|
||||
"build/esnext/**/*.js.map",
|
||||
"build/esnext/**/*.d.ts",
|
||||
"build/src/**/*.js",
|
||||
"build/src/**/*.js.map",
|
||||
"build/src/**/*.d.ts",
|
||||
|
@ -61,32 +73,30 @@
|
|||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "10.0.1",
|
||||
"@types/node": "18.6.5",
|
||||
"@types/sinon": "10.0.16",
|
||||
"@types/webpack": "4.41.33",
|
||||
"@types/mocha": "10.0.10",
|
||||
"@types/node": "^8.10.66",
|
||||
"@types/sinon": "17.0.4",
|
||||
"@types/webpack": "5.28.5",
|
||||
"@types/webpack-env": "1.16.3",
|
||||
"codecov": "3.8.3",
|
||||
"babel-plugin-istanbul": "7.0.0",
|
||||
"cross-var": "1.1.0",
|
||||
"dpdm": "3.13.1",
|
||||
"babel-plugin-istanbul": "6.1.1",
|
||||
"karma": "6.4.2",
|
||||
"karma": "6.4.4",
|
||||
"karma-chrome-launcher": "3.1.0",
|
||||
"karma-coverage": "2.2.1",
|
||||
"karma-mocha": "2.0.1",
|
||||
"karma-mocha-webworker": "1.3.0",
|
||||
"karma-spec-reporter": "0.0.36",
|
||||
"karma-webpack": "4.0.2",
|
||||
"lerna": "7.1.5",
|
||||
"karma-webpack": "5.0.1",
|
||||
"lerna": "6.6.2",
|
||||
"memfs": "3.5.3",
|
||||
"mocha": "10.2.0",
|
||||
"nyc": "15.1.0",
|
||||
"sinon": "15.1.2",
|
||||
"ts-loader": "8.4.0",
|
||||
"ts-mocha": "10.0.0",
|
||||
"typescript": "4.4.4",
|
||||
"unionfs": "4.5.1",
|
||||
"webpack": "4.46.0"
|
||||
"mocha": "11.1.0",
|
||||
"nyc": "17.1.0",
|
||||
"sinon": "18.0.1",
|
||||
"ts-loader": "9.5.2",
|
||||
"typescript": "5.0.4",
|
||||
"unionfs": "4.5.4",
|
||||
"webpack": "5.99.9"
|
||||
},
|
||||
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/api",
|
||||
"sideEffects": false
|
||||
|
|
|
@ -28,6 +28,8 @@ const NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
|||
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry Context API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class ContextAPI {
|
||||
private static _instance?: ContextAPI;
|
||||
|
|
|
@ -34,6 +34,8 @@ const API_NAME = 'diag';
|
|||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry internal
|
||||
* diagnostic API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class DiagAPI implements DiagLogger, DiagLoggerApi {
|
||||
private static _instance?: DiagAPI;
|
||||
|
|
|
@ -42,6 +42,8 @@ const NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
|
|||
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class PropagationAPI {
|
||||
private static _instance?: PropagationAPI;
|
||||
|
|
|
@ -40,6 +40,8 @@ const API_NAME = 'trace';
|
|||
|
||||
/**
|
||||
* Singleton object which represents the entry point to the OpenTelemetry Tracing API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class TraceAPI {
|
||||
private static _instance?: TraceAPI;
|
||||
|
|
|
@ -32,6 +32,9 @@ import { baggageEntryMetadataSymbol } from './internal/symbol';
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface BaggageEntry {
|
||||
/** `String` value of the `BaggageEntry`. */
|
||||
value: string;
|
||||
|
@ -45,6 +48,8 @@ export interface BaggageEntry {
|
|||
/**
|
||||
* Serializable Metadata defined by the W3C baggage specification.
|
||||
* It currently has no special meaning defined by the OpenTelemetry or W3C.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type BaggageEntryMetadata = { toString(): string } & {
|
||||
__TYPE__: typeof baggageEntryMetadataSymbol;
|
||||
|
@ -54,6 +59,8 @@ export type BaggageEntryMetadata = { toString(): string } & {
|
|||
* Baggage represents collection of key-value pairs with optional metadata.
|
||||
* Each key of Baggage is associated with exactly one value.
|
||||
* Baggage may be used to annotate and enrich telemetry data.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface Baggage {
|
||||
/**
|
||||
|
|
|
@ -37,6 +37,7 @@ export function createBaggage(
|
|||
*
|
||||
* @param str string metadata. Format is currently not defined by the spec and has no special meaning.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export function baggageEntryMetadataFromString(
|
||||
str: string
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
* Attributes is a map from string to attribute values.
|
||||
*
|
||||
* Note: only the own enumerable keys are counted as valid attribute keys.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface Attributes {
|
||||
[attributeKey: string]: AttributeValue | undefined;
|
||||
|
@ -27,6 +29,8 @@ export interface Attributes {
|
|||
* Attribute values may be any non-nullish primitive value except an object.
|
||||
*
|
||||
* null or undefined attribute values are invalid and will result in undefined behavior.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type AttributeValue =
|
||||
| string
|
||||
|
|
|
@ -39,6 +39,8 @@ interface ExceptionWithName {
|
|||
* Defines Exception.
|
||||
*
|
||||
* string or an object with one of (message or name or code) and optional stack
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type Exception =
|
||||
| ExceptionWithCode
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
* The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
|
||||
* HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
|
||||
* This is represented in HrTime format as [1609504210, 150000000].
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type HrTime = [number, number];
|
||||
|
||||
|
@ -31,5 +33,7 @@ export type HrTime = [number, number];
|
|||
* Defines TimeInput.
|
||||
*
|
||||
* hrtime, epoch milliseconds, performance.now() or Date
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type TimeInput = HrTime | number | Date;
|
||||
|
|
|
@ -17,5 +17,8 @@
|
|||
// Split module-level variable definition into separate files to allow
|
||||
// tree-shaking on each api instance.
|
||||
import { ContextAPI } from './api/context';
|
||||
/** Entrypoint for context API */
|
||||
/**
|
||||
* Entrypoint for context API
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const context = ContextAPI.getInstance();
|
||||
|
|
|
@ -16,7 +16,11 @@
|
|||
|
||||
import { Context } from './types';
|
||||
|
||||
/** Get a key to uniquely identify a context value */
|
||||
/**
|
||||
* Get a key to uniquely identify a context value
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export function createContextKey(description: string) {
|
||||
// The specification states that for the same input, multiple calls should
|
||||
// return different keys. Due to the nature of the JS dependency management
|
||||
|
@ -81,5 +85,9 @@ class BaseContext implements Context {
|
|||
public deleteValue!: (key: symbol) => Context;
|
||||
}
|
||||
|
||||
/** The root context is used as the default parent context when there is no active context */
|
||||
/**
|
||||
* The root context is used as the default parent context when there is no active context
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const ROOT_CONTEXT: Context = new BaseContext();
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface Context {
|
||||
/**
|
||||
* Get a value from the context.
|
||||
|
@ -40,6 +43,9 @@ export interface Context {
|
|||
deleteValue(key: symbol): Context;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface ContextManager {
|
||||
/**
|
||||
* Get the current active context
|
||||
|
|
|
@ -22,5 +22,7 @@ import { DiagAPI } from './api/diag';
|
|||
* Defines Diagnostic handler used for internal diagnostic logging operations.
|
||||
* The default provides a Noop DiagLogger implementation which may be changed via the
|
||||
* diag.setLogger(logger: DiagLogger) function.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const diag = DiagAPI.instance();
|
||||
|
|
|
@ -33,23 +33,23 @@ export class DiagComponentLogger implements DiagLogger {
|
|||
this._namespace = props.namespace || 'DiagComponentLogger';
|
||||
}
|
||||
|
||||
public debug(...args: any[]): void {
|
||||
public debug(...args: unknown[]): void {
|
||||
return logProxy('debug', this._namespace, args);
|
||||
}
|
||||
|
||||
public error(...args: any[]): void {
|
||||
public error(...args: unknown[]): void {
|
||||
return logProxy('error', this._namespace, args);
|
||||
}
|
||||
|
||||
public info(...args: any[]): void {
|
||||
public info(...args: unknown[]): void {
|
||||
return logProxy('info', this._namespace, args);
|
||||
}
|
||||
|
||||
public warn(...args: any[]): void {
|
||||
public warn(...args: unknown[]): void {
|
||||
return logProxy('warn', this._namespace, args);
|
||||
}
|
||||
|
||||
public verbose(...args: any[]): void {
|
||||
public verbose(...args: unknown[]): void {
|
||||
return logProxy('verbose', this._namespace, args);
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ export class DiagComponentLogger implements DiagLogger {
|
|||
function logProxy(
|
||||
funcName: keyof DiagLogger,
|
||||
namespace: string,
|
||||
args: any
|
||||
args: unknown[]
|
||||
): void {
|
||||
const logger = getGlobal('diag');
|
||||
// shortcut if logger not set
|
||||
|
|
|
@ -29,6 +29,8 @@ const consoleMap: { n: keyof DiagLogger; c: ConsoleMapKeys }[] = [
|
|||
* A simple Immutable Console based diagnostic logger which will output any messages to the Console.
|
||||
* If you want to limit the amount of logging to a specific level or lower use the
|
||||
* {@link createLogLevelDiagLogger}
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class DiagConsoleLogger implements DiagLogger {
|
||||
constructor() {
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type DiagLogFunction = (message: string, ...args: unknown[]) => void;
|
||||
|
||||
/**
|
||||
|
@ -23,6 +26,8 @@ export type DiagLogFunction = (message: string, ...args: unknown[]) => void;
|
|||
* - a No-Op {@link createNoopDiagLogger}
|
||||
* - a {@link DiagLogLevel} filtering wrapper {@link createLogLevelDiagLogger}
|
||||
* - a general Console {@link DiagConsoleLogger} version.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface DiagLogger {
|
||||
/** Log an error scenario that was not expected and caused the requested operation to fail. */
|
||||
|
@ -92,11 +97,16 @@ export enum DiagLogLevel {
|
|||
|
||||
/**
|
||||
* Defines options for ComponentLogger
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface ComponentLoggerOptions {
|
||||
namespace: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.4.1
|
||||
*/
|
||||
export interface DiagLoggerOptions {
|
||||
/**
|
||||
* The {@link DiagLogLevel} used to filter logs sent to the logger.
|
||||
|
|
|
@ -14,7 +14,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { OTLPProtoExporterNodeBase, send } from './node';
|
||||
export { OTLPProtoExporterBrowserBase } from './browser';
|
||||
export { ServiceClientType } from './types';
|
||||
export { ExportRequestType, getExportRequestProto } from './util';
|
||||
/**
|
||||
* Any exports here may change at any time and without warning
|
||||
* @module @opentelemetry/api/experimental
|
||||
*/
|
||||
|
||||
export { wrapTracer, SugaredTracer } from './trace/SugaredTracer';
|
||||
export type { SugaredSpanOptions } from './trace/SugaredOptions';
|
|
@ -14,20 +14,16 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Sampler, SamplingDecision, SamplingResult } from '@opentelemetry/api';
|
||||
import { Span, SpanOptions } from '../../';
|
||||
|
||||
/**
|
||||
* @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead.
|
||||
* Sampler that samples all traces.
|
||||
* Options needed for span creation
|
||||
*/
|
||||
export class AlwaysOnSampler implements Sampler {
|
||||
shouldSample(): SamplingResult {
|
||||
return {
|
||||
decision: SamplingDecision.RECORD_AND_SAMPLED,
|
||||
};
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
return 'AlwaysOnSampler';
|
||||
}
|
||||
export interface SugaredSpanOptions extends SpanOptions {
|
||||
/**
|
||||
* function to overwrite default exception behavior to record the exception. No exceptions should be thrown in the function.
|
||||
* @param e Error which triggered this exception
|
||||
* @param span current span from context
|
||||
*/
|
||||
onException?: (e: Error, span: Span) => void;
|
||||
}
|
|
@ -0,0 +1,215 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { SugaredSpanOptions } from './SugaredOptions';
|
||||
import { context, Context, Span, SpanStatusCode, Tracer } from '../../';
|
||||
|
||||
const defaultOnException = (e: Error, span: Span) => {
|
||||
span.recordException(e);
|
||||
span.setStatus({
|
||||
code: SpanStatusCode.ERROR,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* return a new SugaredTracer created from the supplied one
|
||||
* @param tracer
|
||||
*/
|
||||
export function wrapTracer(tracer: Tracer): SugaredTracer {
|
||||
return new SugaredTracer(tracer);
|
||||
}
|
||||
|
||||
export class SugaredTracer implements Tracer {
|
||||
private readonly _tracer: Tracer;
|
||||
|
||||
constructor(tracer: Tracer) {
|
||||
this._tracer = tracer;
|
||||
this.startSpan = tracer.startSpan.bind(this._tracer);
|
||||
this.startActiveSpan = tracer.startActiveSpan.bind(this._tracer);
|
||||
}
|
||||
|
||||
startActiveSpan: Tracer['startActiveSpan'];
|
||||
startSpan: Tracer['startSpan'];
|
||||
|
||||
/**
|
||||
* Starts a new {@link Span} and calls the given function passing it the
|
||||
* created span as first argument.
|
||||
* Additionally, the new span gets set in context and this context is activated
|
||||
* for the duration of the function call.
|
||||
* The span will be closed after the function has executed.
|
||||
* If an exception occurs, it is recorded, the status is set to ERROR and the exception is rethrown.
|
||||
*
|
||||
* @param name The name of the span
|
||||
* @param [options] SugaredSpanOptions used for span creation
|
||||
* @param [context] Context to use to extract parent
|
||||
* @param fn function called in the context of the span and receives the newly created span as an argument
|
||||
* @returns return value of fn
|
||||
* @example
|
||||
* const something = tracer.withActiveSpan('op', span => {
|
||||
* // do some work
|
||||
* });
|
||||
* @example
|
||||
* const something = await tracer.withActiveSpan('op', span => {
|
||||
* // do some async work
|
||||
* });
|
||||
*/
|
||||
withActiveSpan<F extends (span: Span) => ReturnType<F>>(
|
||||
name: string,
|
||||
fn: F
|
||||
): ReturnType<F>;
|
||||
withActiveSpan<F extends (span: Span) => ReturnType<F>>(
|
||||
name: string,
|
||||
options: SugaredSpanOptions,
|
||||
fn: F
|
||||
): ReturnType<F>;
|
||||
withActiveSpan<F extends (span: Span) => ReturnType<F>>(
|
||||
name: string,
|
||||
options: SugaredSpanOptions,
|
||||
context: Context,
|
||||
fn: F
|
||||
): ReturnType<F>;
|
||||
withActiveSpan<F extends (span: Span) => ReturnType<F>>(
|
||||
name: string,
|
||||
arg2: F | SugaredSpanOptions,
|
||||
arg3?: F | Context,
|
||||
arg4?: F
|
||||
): ReturnType<F> {
|
||||
const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);
|
||||
|
||||
return this._tracer.startActiveSpan(name, opts, ctx, (span: Span) =>
|
||||
handleFn(span, opts, fn)
|
||||
) as ReturnType<F>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a new {@link Span} and ends it after execution of fn without setting it on context.
|
||||
* The span will be closed after the function has executed.
|
||||
* If an exception occurs, it is recorded, the status is et to ERROR and rethrown.
|
||||
*
|
||||
* This method does NOT modify the current Context.
|
||||
*
|
||||
* @param name The name of the span
|
||||
* @param [options] SugaredSpanOptions used for span creation
|
||||
* @param [context] Context to use to extract parent
|
||||
* @param fn function called in the context of the span and receives the newly created span as an argument
|
||||
* @returns Span The newly created span
|
||||
* @example
|
||||
* const something = tracer.withSpan('op', span => {
|
||||
* // do some work
|
||||
* });
|
||||
* @example
|
||||
* const something = await tracer.withSpan('op', span => {
|
||||
* // do some async work
|
||||
* });
|
||||
*/
|
||||
withSpan<F extends (span: Span) => ReturnType<F>>(
|
||||
name: string,
|
||||
fn: F
|
||||
): ReturnType<F>;
|
||||
withSpan<F extends (span: Span) => ReturnType<F>>(
|
||||
name: string,
|
||||
options: SugaredSpanOptions,
|
||||
fn: F
|
||||
): ReturnType<F>;
|
||||
withSpan<F extends (span: Span) => ReturnType<F>>(
|
||||
name: string,
|
||||
options: SugaredSpanOptions,
|
||||
context: Context,
|
||||
fn: F
|
||||
): ReturnType<F>;
|
||||
withSpan<F extends (span: Span) => ReturnType<F>>(
|
||||
name: string,
|
||||
options: SugaredSpanOptions,
|
||||
context: Context,
|
||||
fn: F
|
||||
): ReturnType<F>;
|
||||
withSpan<F extends (span: Span) => ReturnType<F>>(
|
||||
name: string,
|
||||
arg2: SugaredSpanOptions | F,
|
||||
arg3?: Context | F,
|
||||
arg4?: F
|
||||
): ReturnType<F> {
|
||||
const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);
|
||||
|
||||
const span = this._tracer.startSpan(name, opts, ctx);
|
||||
return handleFn(span, opts, fn) as ReturnType<F>;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Massages parameters of withSpan and withActiveSpan to allow signature overwrites
|
||||
* @param arg
|
||||
* @param arg2
|
||||
* @param arg3
|
||||
*/
|
||||
function massageParams<F extends (span: Span) => ReturnType<F>>(
|
||||
arg: F | SugaredSpanOptions,
|
||||
arg2?: F | Context,
|
||||
arg3?: F
|
||||
) {
|
||||
let opts: SugaredSpanOptions | undefined;
|
||||
let ctx: Context | undefined;
|
||||
let fn: F;
|
||||
|
||||
if (!arg2 && !arg3) {
|
||||
fn = arg as F;
|
||||
} else if (!arg3) {
|
||||
opts = arg as SugaredSpanOptions;
|
||||
fn = arg2 as F;
|
||||
} else {
|
||||
opts = arg as SugaredSpanOptions;
|
||||
ctx = arg2 as Context;
|
||||
fn = arg3 as F;
|
||||
}
|
||||
opts = opts ?? {};
|
||||
ctx = ctx ?? context.active();
|
||||
|
||||
return { opts, ctx, fn };
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes fn, returns results and runs onException in the case of exception to allow overwriting of error handling
|
||||
* @param span
|
||||
* @param opts
|
||||
* @param fn
|
||||
*/
|
||||
function handleFn<F extends (span: Span) => ReturnType<F>>(
|
||||
span: Span,
|
||||
opts: SugaredSpanOptions,
|
||||
fn: F
|
||||
): ReturnType<F> {
|
||||
const onException = opts.onException ?? defaultOnException;
|
||||
const errorHandler = (e: Error) => {
|
||||
onException(e, span);
|
||||
span.end();
|
||||
throw e;
|
||||
};
|
||||
|
||||
try {
|
||||
const ret = fn(span) as Promise<ReturnType<F>>;
|
||||
// if fn is an async function, attach a recordException and spanEnd callback to the promise
|
||||
if (typeof ret?.then === 'function') {
|
||||
return ret.then(val => {
|
||||
span.end();
|
||||
return val;
|
||||
}, errorHandler) as ReturnType<F>;
|
||||
}
|
||||
span.end();
|
||||
return ret as ReturnType<F>;
|
||||
} catch (e) {
|
||||
// add throw to signal the compiler that this will throw in the inner scope
|
||||
throw errorHandler(e);
|
||||
}
|
||||
}
|
|
@ -14,23 +14,31 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { BaggageEntry, BaggageEntryMetadata, Baggage } from './baggage/types';
|
||||
/**
|
||||
* @module @opentelemetry/api
|
||||
*/
|
||||
|
||||
export type {
|
||||
BaggageEntry,
|
||||
BaggageEntryMetadata,
|
||||
Baggage,
|
||||
} from './baggage/types';
|
||||
export { baggageEntryMetadataFromString } from './baggage/utils';
|
||||
export { Exception } from './common/Exception';
|
||||
export { HrTime, TimeInput } from './common/Time';
|
||||
export { Attributes, AttributeValue } from './common/Attributes';
|
||||
export type { Exception } from './common/Exception';
|
||||
export type { HrTime, TimeInput } from './common/Time';
|
||||
export type { Attributes, AttributeValue } from './common/Attributes';
|
||||
|
||||
// Context APIs
|
||||
export { createContextKey, ROOT_CONTEXT } from './context/context';
|
||||
export { Context, ContextManager } from './context/types';
|
||||
export type { Context, ContextManager } from './context/types';
|
||||
export type { ContextAPI } from './api/context';
|
||||
|
||||
// Diag APIs
|
||||
export { DiagConsoleLogger } from './diag/consoleLogger';
|
||||
export {
|
||||
export { DiagLogLevel } from './diag/types';
|
||||
export type {
|
||||
DiagLogFunction,
|
||||
DiagLogger,
|
||||
DiagLogLevel,
|
||||
ComponentLoggerOptions,
|
||||
DiagLoggerOptions,
|
||||
} from './diag/types';
|
||||
|
@ -38,11 +46,12 @@ export type { DiagAPI } from './api/diag';
|
|||
|
||||
// Metrics APIs
|
||||
export { createNoopMeter } from './metrics/NoopMeter';
|
||||
export { MeterOptions, Meter } from './metrics/Meter';
|
||||
export { MeterProvider } from './metrics/MeterProvider';
|
||||
export {
|
||||
ValueType,
|
||||
export type { MeterOptions, Meter } from './metrics/Meter';
|
||||
export type { MeterProvider } from './metrics/MeterProvider';
|
||||
export { ValueType } from './metrics/Metric';
|
||||
export type {
|
||||
Counter,
|
||||
Gauge,
|
||||
Histogram,
|
||||
MetricOptions,
|
||||
Observable,
|
||||
|
@ -51,11 +60,12 @@ export {
|
|||
ObservableUpDownCounter,
|
||||
UpDownCounter,
|
||||
BatchObservableCallback,
|
||||
MetricAdvice,
|
||||
MetricAttributes,
|
||||
MetricAttributeValue,
|
||||
ObservableCallback,
|
||||
} from './metrics/Metric';
|
||||
export {
|
||||
export type {
|
||||
BatchObservableResult,
|
||||
ObservableResult,
|
||||
} from './metrics/ObservableResult';
|
||||
|
@ -63,32 +73,34 @@ export type { MetricsAPI } from './api/metrics';
|
|||
|
||||
// Propagation APIs
|
||||
export {
|
||||
defaultTextMapGetter,
|
||||
defaultTextMapSetter,
|
||||
} from './propagation/TextMapPropagator';
|
||||
export type {
|
||||
TextMapPropagator,
|
||||
TextMapSetter,
|
||||
TextMapGetter,
|
||||
defaultTextMapGetter,
|
||||
defaultTextMapSetter,
|
||||
} from './propagation/TextMapPropagator';
|
||||
export type { PropagationAPI } from './api/propagation';
|
||||
|
||||
// Trace APIs
|
||||
export { SpanAttributes, SpanAttributeValue } from './trace/attributes';
|
||||
export { Link } from './trace/link';
|
||||
export { ProxyTracer, TracerDelegator } from './trace/ProxyTracer';
|
||||
export type { SpanAttributes, SpanAttributeValue } from './trace/attributes';
|
||||
export type { Link } from './trace/link';
|
||||
export { ProxyTracer, type TracerDelegator } from './trace/ProxyTracer';
|
||||
export { ProxyTracerProvider } from './trace/ProxyTracerProvider';
|
||||
export { Sampler } from './trace/Sampler';
|
||||
export { SamplingDecision, SamplingResult } from './trace/SamplingResult';
|
||||
export { SpanContext } from './trace/span_context';
|
||||
export type { Sampler } from './trace/Sampler';
|
||||
export { SamplingDecision, type SamplingResult } from './trace/SamplingResult';
|
||||
export type { SpanContext } from './trace/span_context';
|
||||
export { SpanKind } from './trace/span_kind';
|
||||
export { Span } from './trace/span';
|
||||
export { SpanOptions } from './trace/SpanOptions';
|
||||
export { SpanStatus, SpanStatusCode } from './trace/status';
|
||||
export type { Span } from './trace/span';
|
||||
export type { SpanOptions } from './trace/SpanOptions';
|
||||
export { type SpanStatus, SpanStatusCode } from './trace/status';
|
||||
export { TraceFlags } from './trace/trace_flags';
|
||||
export { TraceState } from './trace/trace_state';
|
||||
export type { TraceState } from './trace/trace_state';
|
||||
export { createTraceState } from './trace/internal/utils';
|
||||
export { TracerProvider } from './trace/tracer_provider';
|
||||
export { Tracer } from './trace/tracer';
|
||||
export { TracerOptions } from './trace/tracer_options';
|
||||
export type { TracerProvider } from './trace/tracer_provider';
|
||||
export type { Tracer } from './trace/tracer';
|
||||
export type { TracerOptions } from './trace/tracer_options';
|
||||
export {
|
||||
isSpanContextValid,
|
||||
isValidTraceId,
|
||||
|
|
|
@ -17,5 +17,9 @@
|
|||
// Split module-level variable definition into separate files to allow
|
||||
// tree-shaking on each api instance.
|
||||
import { MetricsAPI } from './api/metrics';
|
||||
/** Entrypoint for metrics API */
|
||||
/**
|
||||
* Entrypoint for metrics API
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export const metrics = MetricsAPI.getInstance();
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
import {
|
||||
BatchObservableCallback,
|
||||
Counter,
|
||||
Gauge,
|
||||
Histogram,
|
||||
MetricAttributes,
|
||||
MetricOptions,
|
||||
|
@ -29,6 +30,8 @@ import {
|
|||
|
||||
/**
|
||||
* An interface describes additional metadata of a meter.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface MeterOptions {
|
||||
/**
|
||||
|
@ -43,8 +46,20 @@ export interface MeterOptions {
|
|||
* {@link Metric}s are used for recording pre-defined aggregation (`Counter`),
|
||||
* or raw values (`Histogram`) in which the aggregation and attributes
|
||||
* for the exported metric are deferred.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface Meter {
|
||||
/**
|
||||
* Creates and returns a new `Gauge`.
|
||||
* @param name the name of the metric.
|
||||
* @param [options] the metric options.
|
||||
*/
|
||||
createGauge<AttributesTypes extends MetricAttributes = MetricAttributes>(
|
||||
name: string,
|
||||
options?: MetricOptions
|
||||
): Gauge<AttributesTypes>;
|
||||
|
||||
/**
|
||||
* Creates and returns a new `Histogram`.
|
||||
* @param name the name of the metric.
|
||||
|
|
|
@ -18,6 +18,8 @@ import { Meter, MeterOptions } from './Meter';
|
|||
|
||||
/**
|
||||
* A registry for creating named {@link Meter}s.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface MeterProvider {
|
||||
/**
|
||||
|
|
|
@ -18,8 +18,24 @@ import { Attributes, AttributeValue } from '../common/Attributes';
|
|||
import { Context } from '../context/types';
|
||||
import { BatchObservableResult, ObservableResult } from './ObservableResult';
|
||||
|
||||
/**
|
||||
* Advisory options influencing aggregation configuration parameters.
|
||||
*
|
||||
* @since 1.7.0
|
||||
* @experimental
|
||||
*/
|
||||
export interface MetricAdvice {
|
||||
/**
|
||||
* Hint the explicit bucket boundaries for SDK if the metric is been
|
||||
* aggregated with a HistogramAggregator.
|
||||
*/
|
||||
explicitBucketBoundaries?: number[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Options needed for metric creation
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface MetricOptions {
|
||||
/**
|
||||
|
@ -39,9 +55,20 @@ export interface MetricOptions {
|
|||
* @default {@link ValueType.DOUBLE}
|
||||
*/
|
||||
valueType?: ValueType;
|
||||
|
||||
/**
|
||||
* The advice influencing aggregation configuration parameters.
|
||||
* @experimental
|
||||
* @since 1.7.0
|
||||
*/
|
||||
advice?: MetricAdvice;
|
||||
}
|
||||
|
||||
/** The Type of value. It describes how the data is reported. */
|
||||
/**
|
||||
* The Type of value. It describes how the data is reported.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export enum ValueType {
|
||||
INT,
|
||||
DOUBLE,
|
||||
|
@ -61,6 +88,8 @@ export enum ValueType {
|
|||
* <li> count the number of checkpoints run. </li>
|
||||
* <li> count the number of 5xx errors. </li>
|
||||
* <ol>
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface Counter<
|
||||
AttributesTypes extends MetricAttributes = MetricAttributes,
|
||||
|
@ -71,6 +100,9 @@ export interface Counter<
|
|||
add(value: number, attributes?: AttributesTypes, context?: Context): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface UpDownCounter<
|
||||
AttributesTypes extends MetricAttributes = MetricAttributes,
|
||||
> {
|
||||
|
@ -80,6 +112,21 @@ export interface UpDownCounter<
|
|||
add(value: number, attributes?: AttributesTypes, context?: Context): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.9.0
|
||||
*/
|
||||
export interface Gauge<
|
||||
AttributesTypes extends MetricAttributes = MetricAttributes,
|
||||
> {
|
||||
/**
|
||||
* Records a measurement.
|
||||
*/
|
||||
record(value: number, attributes?: AttributesTypes, context?: Context): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface Histogram<
|
||||
AttributesTypes extends MetricAttributes = MetricAttributes,
|
||||
> {
|
||||
|
@ -91,16 +138,20 @@ export interface Histogram<
|
|||
|
||||
/**
|
||||
* @deprecated please use {@link Attributes}
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type MetricAttributes = Attributes;
|
||||
|
||||
/**
|
||||
* @deprecated please use {@link AttributeValue}
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type MetricAttributeValue = AttributeValue;
|
||||
|
||||
/**
|
||||
* The observable callback for Observable instruments.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type ObservableCallback<
|
||||
AttributesTypes extends MetricAttributes = MetricAttributes,
|
||||
|
@ -110,6 +161,8 @@ export type ObservableCallback<
|
|||
|
||||
/**
|
||||
* The observable callback for a batch of Observable instruments.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type BatchObservableCallback<
|
||||
AttributesTypes extends MetricAttributes = MetricAttributes,
|
||||
|
@ -117,6 +170,9 @@ export type BatchObservableCallback<
|
|||
observableResult: BatchObservableResult<AttributesTypes>
|
||||
) => void | Promise<void>;
|
||||
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface Observable<
|
||||
AttributesTypes extends MetricAttributes = MetricAttributes,
|
||||
> {
|
||||
|
@ -133,12 +189,21 @@ export interface Observable<
|
|||
removeCallback(callback: ObservableCallback<AttributesTypes>): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type ObservableCounter<
|
||||
AttributesTypes extends MetricAttributes = MetricAttributes,
|
||||
> = Observable<AttributesTypes>;
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type ObservableUpDownCounter<
|
||||
AttributesTypes extends MetricAttributes = MetricAttributes,
|
||||
> = Observable<AttributesTypes>;
|
||||
/**
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export type ObservableGauge<
|
||||
AttributesTypes extends MetricAttributes = MetricAttributes,
|
||||
> = Observable<AttributesTypes>;
|
||||
|
|
|
@ -18,15 +18,16 @@ import { Meter } from './Meter';
|
|||
import {
|
||||
BatchObservableCallback,
|
||||
Counter,
|
||||
Gauge,
|
||||
Histogram,
|
||||
MetricAttributes,
|
||||
MetricOptions,
|
||||
Observable,
|
||||
ObservableCallback,
|
||||
ObservableCounter,
|
||||
ObservableGauge,
|
||||
ObservableUpDownCounter,
|
||||
UpDownCounter,
|
||||
MetricAttributes,
|
||||
Observable,
|
||||
} from './Metric';
|
||||
|
||||
/**
|
||||
|
@ -36,6 +37,13 @@ import {
|
|||
export class NoopMeter implements Meter {
|
||||
constructor() {}
|
||||
|
||||
/**
|
||||
* @see {@link Meter.createGauge}
|
||||
*/
|
||||
createGauge(_name: string, _options?: MetricOptions): Gauge {
|
||||
return NOOP_GAUGE_METRIC;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link Meter.createHistogram}
|
||||
*/
|
||||
|
@ -114,6 +122,10 @@ export class NoopUpDownCounterMetric
|
|||
add(_value: number, _attributes: MetricAttributes): void {}
|
||||
}
|
||||
|
||||
export class NoopGaugeMetric extends NoopMetric implements Gauge {
|
||||
record(_value: number, _attributes: MetricAttributes): void {}
|
||||
}
|
||||
|
||||
export class NoopHistogramMetric extends NoopMetric implements Histogram {
|
||||
record(_value: number, _attributes: MetricAttributes): void {}
|
||||
}
|
||||
|
@ -140,6 +152,7 @@ export const NOOP_METER = new NoopMeter();
|
|||
|
||||
// Synchronous instruments
|
||||
export const NOOP_COUNTER_METRIC = new NoopCounterMetric();
|
||||
export const NOOP_GAUGE_METRIC = new NoopGaugeMetric();
|
||||
export const NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();
|
||||
export const NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();
|
||||
|
||||
|
@ -151,6 +164,8 @@ export const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC =
|
|||
|
||||
/**
|
||||
* Create a no-op Meter
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export function createNoopMeter(): Meter {
|
||||
return NOOP_METER;
|
||||
|
|
|
@ -18,6 +18,8 @@ import { MetricAttributes, Observable } from './Metric';
|
|||
|
||||
/**
|
||||
* Interface that is being used in callback function for Observable Metric.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface ObservableResult<
|
||||
AttributesTypes extends MetricAttributes = MetricAttributes,
|
||||
|
|
|
@ -30,9 +30,9 @@ export const _globalThis: typeof globalThis =
|
|||
typeof globalThis === 'object'
|
||||
? globalThis
|
||||
: typeof self === 'object'
|
||||
? self
|
||||
: typeof window === 'object'
|
||||
? window
|
||||
: typeof global === 'object'
|
||||
? global
|
||||
: ({} as typeof globalThis);
|
||||
? self
|
||||
: typeof window === 'object'
|
||||
? window
|
||||
: typeof global === 'object'
|
||||
? (global as unknown as typeof globalThis)
|
||||
: ({} as typeof globalThis);
|
||||
|
|
|
@ -14,4 +14,4 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './globalThis';
|
||||
export { _globalThis } from './globalThis';
|
||||
|
|
|
@ -14,4 +14,4 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './node';
|
||||
export { _globalThis } from './node';
|
||||
|
|
|
@ -14,4 +14,4 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './globalThis';
|
||||
export { _globalThis } from './globalThis';
|
||||
|
|
|
@ -17,5 +17,9 @@
|
|||
// Split module-level variable definition into separate files to allow
|
||||
// tree-shaking on each api instance.
|
||||
import { PropagationAPI } from './api/propagation';
|
||||
/** Entrypoint for propagation API */
|
||||
/**
|
||||
* Entrypoint for propagation API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const propagation = PropagationAPI.getInstance();
|
||||
|
|
|
@ -26,7 +26,10 @@ import { Context } from '../context/types';
|
|||
* (extractor) side is usually an object such as http headers. Propagation is
|
||||
* usually implemented via library-specific request interceptors, where the
|
||||
* client-side injects values and the server-side extracts them.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export interface TextMapPropagator<Carrier = any> {
|
||||
/**
|
||||
* Injects values from a given `Context` into a carrier.
|
||||
|
@ -73,8 +76,11 @@ export interface TextMapPropagator<Carrier = any> {
|
|||
|
||||
/**
|
||||
* A setter is specified by the caller to define a specific method
|
||||
* to set key/value pairs on the carrier within a propagator.
|
||||
* to set key/value pairs on the carrier within a propagator
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export interface TextMapSetter<Carrier = any> {
|
||||
/**
|
||||
* Callback used to set a key/value pair on an object.
|
||||
|
@ -92,7 +98,10 @@ export interface TextMapSetter<Carrier = any> {
|
|||
/**
|
||||
* A getter is specified by the caller to define a specific method
|
||||
* to get the value of a key from a carrier.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export interface TextMapGetter<Carrier = any> {
|
||||
/**
|
||||
* Get a list of all keys available on the carrier.
|
||||
|
@ -110,6 +119,9 @@ export interface TextMapGetter<Carrier = any> {
|
|||
get(carrier: Carrier, key: string): undefined | string | string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const defaultTextMapGetter: TextMapGetter = {
|
||||
get(carrier, key) {
|
||||
if (carrier == null) {
|
||||
|
@ -126,6 +138,9 @@ export const defaultTextMapGetter: TextMapGetter = {
|
|||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const defaultTextMapSetter: TextMapSetter = {
|
||||
set(carrier, key, value) {
|
||||
if (carrier == null) {
|
||||
|
|
|
@ -17,5 +17,10 @@
|
|||
// Split module-level variable definition into separate files to allow
|
||||
// tree-shaking on each api instance.
|
||||
import { TraceAPI } from './api/trace';
|
||||
/** Entrypoint for trace API */
|
||||
|
||||
/**
|
||||
* Entrypoint for trace API
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const trace = TraceAPI.getInstance();
|
||||
|
|
|
@ -21,6 +21,7 @@ import { INVALID_SPAN_CONTEXT } from './invalid-span-constants';
|
|||
import { Span } from './span';
|
||||
import { SpanContext } from './span_context';
|
||||
import { SpanStatus } from './status';
|
||||
import { Link } from './link';
|
||||
|
||||
/**
|
||||
* The NonRecordingSpan is the default {@link Span} that is used when no Span
|
||||
|
@ -52,6 +53,14 @@ export class NonRecordingSpan implements Span {
|
|||
return this;
|
||||
}
|
||||
|
||||
addLink(_link: Link): this {
|
||||
return this;
|
||||
}
|
||||
|
||||
addLinks(_links: Link[]): this {
|
||||
return this;
|
||||
}
|
||||
|
||||
// By default does nothing
|
||||
setStatus(_status: SpanStatus): this {
|
||||
return this;
|
||||
|
|
|
@ -99,11 +99,15 @@ export class NoopTracer implements Tracer {
|
|||
}
|
||||
}
|
||||
|
||||
function isSpanContext(spanContext: any): spanContext is SpanContext {
|
||||
function isSpanContext(spanContext: unknown): spanContext is SpanContext {
|
||||
return (
|
||||
spanContext !== null &&
|
||||
typeof spanContext === 'object' &&
|
||||
'spanId' in spanContext &&
|
||||
typeof spanContext['spanId'] === 'string' &&
|
||||
'traceId' in spanContext &&
|
||||
typeof spanContext['traceId'] === 'string' &&
|
||||
'traceFlags' in spanContext &&
|
||||
typeof spanContext['traceFlags'] === 'number'
|
||||
);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@ const NOOP_TRACER = new NoopTracer();
|
|||
|
||||
/**
|
||||
* Proxy tracer provided by the proxy tracer provider
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class ProxyTracer implements Tracer {
|
||||
// When a real implementation is provided, this will be it
|
||||
|
@ -75,6 +77,9 @@ export class ProxyTracer implements Tracer {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.0.3
|
||||
*/
|
||||
export interface TracerDelegator {
|
||||
getDelegateTracer(
|
||||
name: string,
|
||||
|
|
|
@ -29,6 +29,8 @@ const NOOP_TRACER_PROVIDER = new NoopTracerProvider();
|
|||
* When a delegate is set, traces are provided from the delegate.
|
||||
* When a delegate is set after tracers have already been provided,
|
||||
* all tracers already provided will use the provided delegate implementation.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export class ProxyTracerProvider implements TracerProvider {
|
||||
private _delegate?: TracerProvider;
|
||||
|
|
|
@ -25,6 +25,8 @@ import { SpanKind } from './span_kind';
|
|||
* This interface represent a sampler. Sampling is a mechanism to control the
|
||||
* noise and overhead introduced by OpenTelemetry by reducing the number of
|
||||
* samples of traces collected and sent to the backend.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface Sampler {
|
||||
/**
|
||||
|
|
|
@ -21,6 +21,8 @@ import { TraceState } from './trace_state';
|
|||
* @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.
|
||||
* A sampling decision that determines how a {@link Span} will be recorded
|
||||
* and collected.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export enum SamplingDecision {
|
||||
/**
|
||||
|
@ -44,6 +46,8 @@ export enum SamplingDecision {
|
|||
* @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.
|
||||
* A sampling result contains a decision for a {@link Span} and additional
|
||||
* attributes the sampler would like to added to the Span.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface SamplingResult {
|
||||
/**
|
||||
|
|
|
@ -21,6 +21,8 @@ import { SpanKind } from './span_kind';
|
|||
|
||||
/**
|
||||
* Options needed for span creation
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface SpanOptions {
|
||||
/**
|
||||
|
|
|
@ -18,10 +18,12 @@ import { Attributes, AttributeValue } from '../common/Attributes';
|
|||
|
||||
/**
|
||||
* @deprecated please use {@link Attributes}
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type SpanAttributes = Attributes;
|
||||
|
||||
/**
|
||||
* @deprecated please use {@link AttributeValue}
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export type SpanAttributeValue = AttributeValue;
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
import { TraceState } from '../trace_state';
|
||||
import { TraceStateImpl } from './tracestate-impl';
|
||||
|
||||
/**
|
||||
* @since 1.1.0
|
||||
*/
|
||||
export function createTraceState(rawTraceState?: string): TraceState {
|
||||
return new TraceStateImpl(rawTraceState);
|
||||
}
|
||||
|
|
|
@ -17,8 +17,19 @@
|
|||
import { SpanContext } from './span_context';
|
||||
import { TraceFlags } from './trace_flags';
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const INVALID_SPANID = '0000000000000000';
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const INVALID_TRACEID = '00000000000000000000000000000000';
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const INVALID_SPAN_CONTEXT: SpanContext = {
|
||||
traceId: INVALID_TRACEID,
|
||||
spanId: INVALID_SPANID,
|
||||
|
|
|
@ -31,6 +31,8 @@ import { SpanContext } from './span_context';
|
|||
* However, it is desirable to associate incoming SpanContext to new trace
|
||||
* initiated on service provider side so two traces (from Client and from
|
||||
* Service Provider) can be correlated.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface Link {
|
||||
/** The {@link SpanContext} of a linked span. */
|
||||
|
|
|
@ -19,6 +19,7 @@ import { TimeInput } from '../common/Time';
|
|||
import { SpanAttributes, SpanAttributeValue } from './attributes';
|
||||
import { SpanContext } from './span_context';
|
||||
import { SpanStatus } from './status';
|
||||
import { Link } from './link';
|
||||
|
||||
/**
|
||||
* An interface that represents a span. A span represents a single operation
|
||||
|
@ -28,6 +29,8 @@ import { SpanStatus } from './status';
|
|||
* may have children.
|
||||
*
|
||||
* Spans are created by the {@link Tracer.startSpan} method.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface Span {
|
||||
/**
|
||||
|
@ -76,6 +79,26 @@ export interface Span {
|
|||
startTime?: TimeInput
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Adds a single link to the span.
|
||||
*
|
||||
* Links added after the creation will not affect the sampling decision.
|
||||
* It is preferred span links be added at span creation.
|
||||
*
|
||||
* @param link the link to add.
|
||||
*/
|
||||
addLink(link: Link): this;
|
||||
|
||||
/**
|
||||
* Adds multiple links to the span.
|
||||
*
|
||||
* Links added after the creation will not affect the sampling decision.
|
||||
* It is preferred span links be added at span creation.
|
||||
*
|
||||
* @param links the links to add.
|
||||
*/
|
||||
addLinks(links: Link[]): this;
|
||||
|
||||
/**
|
||||
* Sets a status to the span. If used, this will override the default Span
|
||||
* status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value
|
||||
|
|
|
@ -19,6 +19,8 @@ import { TraceState } from './trace_state';
|
|||
/**
|
||||
* A SpanContext represents the portion of a {@link Span} which must be
|
||||
* serialized and propagated along side of a {@link Baggage}.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface SpanContext {
|
||||
/**
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export enum SpanKind {
|
||||
/** Default value. Indicates that the span is used internally. */
|
||||
INTERNAL = 0,
|
||||
|
|
|
@ -18,20 +18,50 @@ import { NonRecordingSpan } from './NonRecordingSpan';
|
|||
import { Span } from './span';
|
||||
import { SpanContext } from './span_context';
|
||||
|
||||
const VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
|
||||
const VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
|
||||
// Valid characters (0-9, a-f, A-F) are marked as 1.
|
||||
const isHex = new Uint8Array([
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
|
||||
]);
|
||||
|
||||
export function isValidTraceId(traceId: string): boolean {
|
||||
return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
|
||||
function isValidHex(id: string, length: number): boolean {
|
||||
// As of 1.9.0 the id was allowed to be a non-string value,
|
||||
// even though it was not possible in the types.
|
||||
if (typeof id !== 'string' || id.length !== length) return false;
|
||||
|
||||
let r = 0;
|
||||
for (let i = 0; i < id.length; i += 4) {
|
||||
r +=
|
||||
(isHex[id.charCodeAt(i)] | 0) +
|
||||
(isHex[id.charCodeAt(i + 1)] | 0) +
|
||||
(isHex[id.charCodeAt(i + 2)] | 0) +
|
||||
(isHex[id.charCodeAt(i + 3)] | 0);
|
||||
}
|
||||
|
||||
return r === length;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export function isValidTraceId(traceId: string): boolean {
|
||||
return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export function isValidSpanId(spanId: string): boolean {
|
||||
return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
|
||||
return isValidHex(spanId, 16) && spanId !== INVALID_SPANID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this {@link SpanContext} is valid.
|
||||
* @return true if this {@link SpanContext} is valid.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export function isSpanContextValid(spanContext: SpanContext): boolean {
|
||||
return (
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface SpanStatus {
|
||||
/** The status code of this message. */
|
||||
code: SpanStatusCode;
|
||||
|
@ -22,6 +26,8 @@ export interface SpanStatus {
|
|||
|
||||
/**
|
||||
* An enumeration of status codes.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export enum SpanStatusCode {
|
||||
/**
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export enum TraceFlags {
|
||||
/** Represents no flag set. */
|
||||
NONE = 0x0,
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface TraceState {
|
||||
/**
|
||||
* Create a new TraceState which inherits from this TraceState and has the
|
||||
|
|
|
@ -20,6 +20,8 @@ import { SpanOptions } from './SpanOptions';
|
|||
|
||||
/**
|
||||
* Tracer provides an interface for creating {@link Span}s.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface Tracer {
|
||||
/**
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
/**
|
||||
* An interface describes additional metadata of a tracer.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
export interface TracerOptions {
|
||||
/**
|
||||
|
|
|
@ -19,6 +19,8 @@ import { TracerOptions } from './tracer_options';
|
|||
|
||||
/**
|
||||
* A registry for creating named {@link Tracer}s.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export interface TracerProvider {
|
||||
/**
|
||||
|
|
|
@ -48,14 +48,14 @@ const diagLoggerFunctions = [
|
|||
'error',
|
||||
] as const;
|
||||
|
||||
describe('API', () => {
|
||||
it('should expose a tracer provider via getTracerProvider', () => {
|
||||
describe('API', function () {
|
||||
it('should expose a tracer provider via getTracerProvider', function () {
|
||||
const tracer = api.trace.getTracerProvider();
|
||||
assert.ok(tracer);
|
||||
assert.strictEqual(typeof tracer, 'object');
|
||||
});
|
||||
|
||||
it('getActiveSpan should get the current span', () => {
|
||||
it('getActiveSpan should get the current span', function () {
|
||||
const span = new NonRecordingSpan();
|
||||
const ctx = trace.setSpan(ROOT_CONTEXT, span);
|
||||
context.setGlobalContextManager({
|
||||
|
@ -69,8 +69,8 @@ describe('API', () => {
|
|||
context.disable();
|
||||
});
|
||||
|
||||
describe('Context', () => {
|
||||
it('with should forward this, arguments and return value', () => {
|
||||
describe('Context', function () {
|
||||
it('with should forward this, arguments and return value', function () {
|
||||
function fnWithThis(this: string, a: string, b: number): string {
|
||||
assert.strictEqual(this, 'that');
|
||||
assert.strictEqual(arguments.length, 2);
|
||||
|
@ -89,7 +89,7 @@ describe('API', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('GlobalTracerProvider', () => {
|
||||
describe('GlobalTracerProvider', function () {
|
||||
const spanContext = {
|
||||
traceId: 'd4cda95b652f4a1592b449d5929fda1b',
|
||||
spanId: '6e0c63257de34c92',
|
||||
|
@ -103,14 +103,14 @@ describe('API', () => {
|
|||
propagation.disable();
|
||||
});
|
||||
|
||||
it('should use the global tracer provider', () => {
|
||||
it('should use the global tracer provider', function () {
|
||||
api.trace.setGlobalTracerProvider(new TestTracerProvider());
|
||||
const tracer = api.trace.getTracerProvider().getTracer('name');
|
||||
const span = tracer.startSpan('test');
|
||||
assert.deepStrictEqual(span, dummySpan);
|
||||
});
|
||||
|
||||
it('should set delegate only on success', () => {
|
||||
it('should set delegate only on success', function () {
|
||||
assert.strictEqual(
|
||||
api.trace.setGlobalTracerProvider(new TestTracerProvider()),
|
||||
true
|
||||
|
@ -134,7 +134,7 @@ describe('API', () => {
|
|||
}
|
||||
}
|
||||
|
||||
describe('should use the global propagation', () => {
|
||||
describe('should use the global propagation', function () {
|
||||
const testKey = Symbol('kTestKey');
|
||||
|
||||
interface Carrier {
|
||||
|
@ -169,7 +169,7 @@ describe('API', () => {
|
|||
}
|
||||
}
|
||||
|
||||
it('inject', () => {
|
||||
it('inject', function () {
|
||||
api.propagation.setGlobalPropagator(new TestTextMapPropagation());
|
||||
|
||||
const context = ROOT_CONTEXT.setValue(testKey, 15);
|
||||
|
@ -186,7 +186,7 @@ describe('API', () => {
|
|||
assert.strictEqual(carrier.setter, setter);
|
||||
});
|
||||
|
||||
it('extract', () => {
|
||||
it('extract', function () {
|
||||
api.propagation.setGlobalPropagator(new TestTextMapPropagation());
|
||||
|
||||
const carrier: Carrier = {};
|
||||
|
@ -209,7 +209,7 @@ describe('API', () => {
|
|||
assert.strictEqual(data.getter, getter);
|
||||
});
|
||||
|
||||
it('fields', () => {
|
||||
it('fields', function () {
|
||||
api.propagation.setGlobalPropagator(new TestTextMapPropagation());
|
||||
|
||||
const fields = api.propagation.fields();
|
||||
|
@ -218,15 +218,15 @@ describe('API', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('Global diag', () => {
|
||||
it('initialization', () => {
|
||||
describe('Global diag', function () {
|
||||
it('initialization', function () {
|
||||
const inst = DiagAPI.instance();
|
||||
|
||||
assert.deepStrictEqual(diag, inst);
|
||||
});
|
||||
|
||||
diagLoggerFunctions.forEach(fName => {
|
||||
it(`no argument logger ${fName} message doesn't throw`, () => {
|
||||
it(`no argument logger ${fName} message doesn't throw`, function () {
|
||||
//@ts-expect-error an undefined logger is not allowed
|
||||
diag.setLogger();
|
||||
assert.doesNotThrow(() => {
|
||||
|
@ -234,21 +234,21 @@ describe('API', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it(`null logger ${fName} message doesn't throw`, () => {
|
||||
it(`null logger ${fName} message doesn't throw`, function () {
|
||||
diag.setLogger(null as any);
|
||||
assert.doesNotThrow(() => {
|
||||
diag[fName](`${fName} message`);
|
||||
});
|
||||
});
|
||||
|
||||
it(`undefined logger ${fName} message doesn't throw`, () => {
|
||||
it(`undefined logger ${fName} message doesn't throw`, function () {
|
||||
diag.setLogger(undefined as any);
|
||||
assert.doesNotThrow(() => {
|
||||
diag[fName](`${fName} message`);
|
||||
});
|
||||
});
|
||||
|
||||
it(`empty logger ${fName} message doesn't throw`, () => {
|
||||
it(`empty logger ${fName} message doesn't throw`, function () {
|
||||
diag.setLogger({} as any);
|
||||
assert.doesNotThrow(() => {
|
||||
diag[fName](`${fName} message`);
|
||||
|
@ -257,21 +257,21 @@ describe('API', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('Global metrics', () => {
|
||||
it('should expose a meter provider via getMeterProvider', () => {
|
||||
describe('Global metrics', function () {
|
||||
it('should expose a meter provider via getMeterProvider', function () {
|
||||
const meter = metrics.getMeterProvider();
|
||||
assert.ok(meter);
|
||||
assert.strictEqual(typeof meter, 'object');
|
||||
});
|
||||
|
||||
describe('GlobalMeterProvider', () => {
|
||||
describe('GlobalMeterProvider', function () {
|
||||
const dummyMeter = new NoopMeter();
|
||||
|
||||
beforeEach(() => {
|
||||
metrics.disable();
|
||||
});
|
||||
|
||||
it('should use the global meter provider', () => {
|
||||
it('should use the global meter provider', function () {
|
||||
metrics.setGlobalMeterProvider(new TestMeterProvider());
|
||||
const meter = metrics.getMeterProvider().getMeter('name');
|
||||
assert.deepStrictEqual(meter, dummyMeter);
|
||||
|
|
|
@ -22,15 +22,15 @@ import {
|
|||
baggageEntryMetadataFromString,
|
||||
} from '../../../src';
|
||||
|
||||
describe('Baggage', () => {
|
||||
describe('create', () => {
|
||||
it('should create an empty bag', () => {
|
||||
describe('Baggage', function () {
|
||||
describe('create', function () {
|
||||
it('should create an empty bag', function () {
|
||||
const bag = propagation.createBaggage();
|
||||
|
||||
assert.deepStrictEqual(bag.getAllEntries(), []);
|
||||
});
|
||||
|
||||
it('should create a bag with entries', () => {
|
||||
it('should create a bag with entries', function () {
|
||||
const meta = baggageEntryMetadataFromString('opaque string');
|
||||
const bag = propagation.createBaggage({
|
||||
key1: { value: 'value1' },
|
||||
|
@ -44,22 +44,24 @@ describe('Baggage', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('get', () => {
|
||||
it('should not allow modification of returned entries', () => {
|
||||
describe('get', function () {
|
||||
it('should not allow modification of returned entries', function () {
|
||||
const bag = propagation
|
||||
.createBaggage()
|
||||
.setEntry('key', { value: 'value' });
|
||||
|
||||
const entry = bag.getEntry('key');
|
||||
assert.ok(entry);
|
||||
entry.value = 'mutated';
|
||||
if (entry) {
|
||||
entry.value = 'mutated';
|
||||
}
|
||||
|
||||
assert.strictEqual(bag.getEntry('key')?.value, 'value');
|
||||
});
|
||||
});
|
||||
|
||||
describe('set', () => {
|
||||
it('should create a new bag when an entry is added', () => {
|
||||
describe('set', function () {
|
||||
it('should create a new bag when an entry is added', function () {
|
||||
const bag = propagation.createBaggage();
|
||||
|
||||
const bag2 = bag.setEntry('key', { value: 'value' });
|
||||
|
@ -72,8 +74,8 @@ describe('Baggage', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('remove', () => {
|
||||
it('should create a new bag when an entry is removed', () => {
|
||||
describe('remove', function () {
|
||||
it('should create a new bag when an entry is removed', function () {
|
||||
const bag = propagation.createBaggage({
|
||||
key: { value: 'value' },
|
||||
});
|
||||
|
@ -87,7 +89,7 @@ describe('Baggage', () => {
|
|||
assert.deepStrictEqual(bag2.getAllEntries(), []);
|
||||
});
|
||||
|
||||
it('should create an empty bag multiple keys are removed', () => {
|
||||
it('should create an empty bag multiple keys are removed', function () {
|
||||
const bag = propagation.createBaggage({
|
||||
key: { value: 'value' },
|
||||
key1: { value: 'value1' },
|
||||
|
@ -107,7 +109,7 @@ describe('Baggage', () => {
|
|||
]);
|
||||
});
|
||||
|
||||
it('should create an empty bag when it cleared', () => {
|
||||
it('should create an empty bag when it cleared', function () {
|
||||
const bag = propagation.createBaggage({
|
||||
key: { value: 'value' },
|
||||
key1: { value: 'value1' },
|
||||
|
@ -124,8 +126,8 @@ describe('Baggage', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('context', () => {
|
||||
it('should set and get a baggage from a context', () => {
|
||||
describe('context', function () {
|
||||
it('should set and get a baggage from a context', function () {
|
||||
const bag = propagation.createBaggage();
|
||||
|
||||
const ctx = propagation.setBaggage(ROOT_CONTEXT, bag);
|
||||
|
@ -133,7 +135,7 @@ describe('Baggage', () => {
|
|||
assert.strictEqual(bag, propagation.getBaggage(ctx));
|
||||
});
|
||||
|
||||
it('should get the current baggage', () => {
|
||||
it('should get the current baggage', function () {
|
||||
const entries = {
|
||||
banana: { value: 'boats' },
|
||||
};
|
||||
|
@ -151,21 +153,21 @@ describe('Baggage', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('metadata', () => {
|
||||
it('should create an opaque object which returns the string unchanged', () => {
|
||||
describe('metadata', function () {
|
||||
it('should create an opaque object which returns the string unchanged', function () {
|
||||
const meta = baggageEntryMetadataFromString('this is a string');
|
||||
|
||||
assert.strictEqual(meta.toString(), 'this is a string');
|
||||
});
|
||||
|
||||
it('should return an empty string if input is invalid', () => {
|
||||
it('should return an empty string if input is invalid', function () {
|
||||
//@ts-expect-error only accepts string values
|
||||
const meta = baggageEntryMetadataFromString(1);
|
||||
|
||||
assert.strictEqual(meta.toString(), '');
|
||||
});
|
||||
|
||||
it('should retain metadata', () => {
|
||||
it('should retain metadata', function () {
|
||||
const bag = propagation.createBaggage({
|
||||
key: {
|
||||
value: 'value',
|
||||
|
|
|
@ -18,14 +18,14 @@ import * as assert from 'assert';
|
|||
import { createContextKey, ROOT_CONTEXT } from '../../../src/context/context';
|
||||
import { NoopContextManager } from '../../../src/context/NoopContextManager';
|
||||
|
||||
describe('NoopContextManager', () => {
|
||||
describe('NoopContextManager', function () {
|
||||
let contextManager: NoopContextManager;
|
||||
|
||||
describe('.enable()', () => {
|
||||
it('should work', () => {
|
||||
describe('.enable()', function () {
|
||||
it('should work', function () {
|
||||
assert.doesNotThrow(() => {
|
||||
contextManager = new NoopContextManager();
|
||||
assert(
|
||||
assert.ok(
|
||||
contextManager.enable() === contextManager,
|
||||
'should return this'
|
||||
);
|
||||
|
@ -33,10 +33,10 @@ describe('NoopContextManager', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('.disable()', () => {
|
||||
it('should work', () => {
|
||||
describe('.disable()', function () {
|
||||
it('should work', function () {
|
||||
assert.doesNotThrow(() => {
|
||||
assert(
|
||||
assert.ok(
|
||||
contextManager.disable() === contextManager,
|
||||
'should return this'
|
||||
);
|
||||
|
@ -45,7 +45,7 @@ describe('NoopContextManager', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('.with()', () => {
|
||||
describe('.with()', function () {
|
||||
it('should run the callback (ROOT_CONTEXT as target)', done => {
|
||||
contextManager.with(ROOT_CONTEXT, done);
|
||||
});
|
||||
|
@ -53,7 +53,7 @@ describe('NoopContextManager', () => {
|
|||
it('should run the callback (object as target)', done => {
|
||||
const key = createContextKey('test key 1');
|
||||
const test = ROOT_CONTEXT.setValue(key, 1);
|
||||
contextManager.with(test, () => {
|
||||
contextManager.with(test, function () {
|
||||
assert.strictEqual(
|
||||
contextManager.active(),
|
||||
ROOT_CONTEXT,
|
||||
|
@ -65,13 +65,13 @@ describe('NoopContextManager', () => {
|
|||
|
||||
it('should run the callback (when disabled)', done => {
|
||||
contextManager.disable();
|
||||
contextManager.with(ROOT_CONTEXT, () => {
|
||||
contextManager.with(ROOT_CONTEXT, function () {
|
||||
contextManager.enable();
|
||||
return done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should forward this, arguments and return value', () => {
|
||||
it('should forward this, arguments and return value', function () {
|
||||
function fnWithThis(this: string, a: string, b: number): string {
|
||||
assert.strictEqual(this, 'that');
|
||||
assert.strictEqual(arguments.length, 2);
|
||||
|
@ -96,8 +96,8 @@ describe('NoopContextManager', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('.active()', () => {
|
||||
it('should always return ROOT_CONTEXT (when enabled)', () => {
|
||||
describe('.active()', function () {
|
||||
it('should always return ROOT_CONTEXT (when enabled)', function () {
|
||||
assert.strictEqual(
|
||||
contextManager.active(),
|
||||
ROOT_CONTEXT,
|
||||
|
@ -105,7 +105,7 @@ describe('NoopContextManager', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('should always return ROOT_CONTEXT (when disabled)', () => {
|
||||
it('should always return ROOT_CONTEXT (when disabled)', function () {
|
||||
contextManager.disable();
|
||||
assert.strictEqual(
|
||||
contextManager.active(),
|
||||
|
@ -116,8 +116,8 @@ describe('NoopContextManager', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('.bind()', () => {
|
||||
it('should return the same target (when enabled)', () => {
|
||||
describe('.bind()', function () {
|
||||
it('should return the same target (when enabled)', function () {
|
||||
const test = { a: 1 };
|
||||
assert.deepStrictEqual(
|
||||
contextManager.bind(contextManager.active(), test),
|
||||
|
@ -125,7 +125,7 @@ describe('NoopContextManager', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('should return the same target (when disabled)', () => {
|
||||
it('should return the same target (when disabled)', function () {
|
||||
contextManager.disable();
|
||||
const test = { a: 1 };
|
||||
assert.deepStrictEqual(
|
||||
|
|
|
@ -28,7 +28,7 @@ class SpyLogger implements DiagLogger {
|
|||
|
||||
const loggerFunctions = ['verbose', 'debug', 'info', 'warn', 'error'];
|
||||
|
||||
describe('ComponentLogger', () => {
|
||||
describe('ComponentLogger', function () {
|
||||
let logger: DiagLogger;
|
||||
|
||||
const sandbox = sinon.createSandbox();
|
||||
|
@ -47,7 +47,7 @@ describe('ComponentLogger', () => {
|
|||
|
||||
loggerFunctions.forEach(name => {
|
||||
const fName = name as keyof SpyLogger;
|
||||
it(`should call global logger function "${name}" with namespace as first param`, () => {
|
||||
it(`should call global logger function "${name}" with namespace as first param`, function () {
|
||||
const componentLogger = diag.createComponentLogger({ namespace: 'foo' });
|
||||
componentLogger[fName]('test');
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ const expectedConsoleMap: { [n: string]: keyof Console } = {
|
|||
verbose: 'trace',
|
||||
};
|
||||
|
||||
describe('DiagConsoleLogger', () => {
|
||||
describe('DiagConsoleLogger', function () {
|
||||
const origConsole = console;
|
||||
const orig: any = {};
|
||||
const calledArgs: any = {};
|
||||
|
@ -92,9 +92,9 @@ describe('DiagConsoleLogger', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('constructor', () => {
|
||||
describe('constructor', function () {
|
||||
diagLoggerFunctions.forEach(fName => {
|
||||
it(`console logger should provide ${fName} function`, () => {
|
||||
it(`console logger should provide ${fName} function`, function () {
|
||||
const consoleLogger: any = new DiagConsoleLogger();
|
||||
consoleLogger[fName](`${fName} called %s`, 'param1');
|
||||
assert.ok(
|
||||
|
@ -103,7 +103,7 @@ describe('DiagConsoleLogger', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it(`should log ${expectedConsoleMap[fName]} message with ${fName} call only`, () => {
|
||||
it(`should log ${expectedConsoleMap[fName]} message with ${fName} call only`, function () {
|
||||
const consoleLogger: any = new DiagConsoleLogger();
|
||||
consoleLogger[fName](`${fName} called %s`, 'param1');
|
||||
|
||||
|
@ -126,7 +126,7 @@ describe('DiagConsoleLogger', () => {
|
|||
});
|
||||
|
||||
consoleFuncs.forEach(cName => {
|
||||
it(`should log ${fName} message even when console doesn't support ${cName} call before construction`, () => {
|
||||
it(`should log ${fName} message even when console doesn't support ${cName} call before construction`, function () {
|
||||
// @ts-expect-error removing a console property is not allowed by types
|
||||
console[cName] = undefined;
|
||||
const consoleLogger: any = new DiagConsoleLogger();
|
||||
|
@ -141,7 +141,7 @@ describe('DiagConsoleLogger', () => {
|
|||
}
|
||||
});
|
||||
|
||||
it(`should log ${fName} message even when console doesn't support ${cName} call after construction`, () => {
|
||||
it(`should log ${fName} message even when console doesn't support ${cName} call after construction`, function () {
|
||||
const consoleLogger: any = new DiagConsoleLogger();
|
||||
// @ts-expect-error removing a console property is not allowed by types
|
||||
console[cName] = undefined;
|
||||
|
@ -161,7 +161,7 @@ describe('DiagConsoleLogger', () => {
|
|||
if (canMockConsole) {
|
||||
diagLoggerFunctions.forEach(fName => {
|
||||
const cName = expectedConsoleMap[fName];
|
||||
it(`should not throw even when console is not supported for ${fName} call`, () => {
|
||||
it(`should not throw even when console is not supported for ${fName} call`, function () {
|
||||
// eslint-disable-next-line no-global-assign
|
||||
(console as any) = undefined;
|
||||
const consoleLogger: any = new DiagConsoleLogger();
|
||||
|
@ -170,7 +170,7 @@ describe('DiagConsoleLogger', () => {
|
|||
assert.deepStrictEqual(calledArgs.log, null);
|
||||
});
|
||||
|
||||
it(`should not throw even when console is disabled after construction for ${fName} call`, () => {
|
||||
it(`should not throw even when console is disabled after construction for ${fName} call`, function () {
|
||||
const consoleLogger: any = new DiagConsoleLogger();
|
||||
// eslint-disable-next-line no-global-assign
|
||||
(console as any) = undefined;
|
||||
|
@ -179,7 +179,7 @@ describe('DiagConsoleLogger', () => {
|
|||
assert.deepStrictEqual(calledArgs.log, null);
|
||||
});
|
||||
|
||||
it(`should not throw even when console is invalid after construction for ${fName} call`, () => {
|
||||
it(`should not throw even when console is invalid after construction for ${fName} call`, function () {
|
||||
const invalidConsole = {
|
||||
debug: 1,
|
||||
warn: 2,
|
||||
|
@ -197,7 +197,7 @@ describe('DiagConsoleLogger', () => {
|
|||
assert.deepStrictEqual(calledArgs.log, null);
|
||||
});
|
||||
|
||||
it(`should not throw even when console is invalid before construction for ${fName} call`, () => {
|
||||
it(`should not throw even when console is invalid before construction for ${fName} call`, function () {
|
||||
const invalidConsole = {
|
||||
debug: 1,
|
||||
warn: 2,
|
||||
|
|
|
@ -31,7 +31,7 @@ export const diagLoggerFunctions = [
|
|||
'error',
|
||||
] as const;
|
||||
|
||||
describe('LogLevelFilter DiagLogger', () => {
|
||||
describe('LogLevelFilter DiagLogger', function () {
|
||||
const calledArgs: any = {
|
||||
error: null,
|
||||
warn: null,
|
||||
|
@ -77,7 +77,7 @@ describe('LogLevelFilter DiagLogger', () => {
|
|||
|
||||
const levelMap: Array<{
|
||||
message: string;
|
||||
level: DiagLogLevel;
|
||||
level: number;
|
||||
ignoreFuncs: Array<keyof DiagLogger>;
|
||||
}> = [
|
||||
{ message: 'ALL', level: DiagLogLevel.ALL, ignoreFuncs: [] },
|
||||
|
@ -117,10 +117,10 @@ describe('LogLevelFilter DiagLogger', () => {
|
|||
];
|
||||
|
||||
levelMap.forEach(map => {
|
||||
describe(`with ${map.message} log level`, () => {
|
||||
describe(`with ${map.message} log level`, function () {
|
||||
diagLoggerFunctions.forEach(fName => {
|
||||
describe(`calling ${fName} message`, () => {
|
||||
it('should log', () => {
|
||||
describe(`calling ${fName} message`, function () {
|
||||
it('should log', function () {
|
||||
const testLogger = createLogLevelDiagLogger(map.level, dummyLogger);
|
||||
testLogger[fName](`${fName} called %s`, 'param1');
|
||||
diagLoggerFunctions.forEach(lName => {
|
||||
|
@ -135,7 +135,7 @@ describe('LogLevelFilter DiagLogger', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should be noop for null with explicit noop Logger log', () => {
|
||||
it('should be noop for null with explicit noop Logger log', function () {
|
||||
const testLogger = createLogLevelDiagLogger(
|
||||
map.level,
|
||||
createNoopDiagLogger()
|
||||
|
@ -146,7 +146,7 @@ describe('LogLevelFilter DiagLogger', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should be noop and not throw for null and no default Logger log', () => {
|
||||
it('should be noop and not throw for null and no default Logger log', function () {
|
||||
// @ts-expect-error null logger is not allowed
|
||||
const testLogger = createLogLevelDiagLogger(map.level, null);
|
||||
testLogger[fName](`${fName} called %s`, 'param1');
|
||||
|
@ -155,7 +155,7 @@ describe('LogLevelFilter DiagLogger', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should be noop and not throw for undefined and no default Logger log', () => {
|
||||
it('should be noop and not throw for undefined and no default Logger log', function () {
|
||||
// @ts-expect-error undefined logger is not allowed
|
||||
const testLogger = createLogLevelDiagLogger(map.level, undefined);
|
||||
testLogger[fName](`${fName} called %s`, 'param1');
|
||||
|
@ -165,8 +165,8 @@ describe('LogLevelFilter DiagLogger', () => {
|
|||
});
|
||||
|
||||
levelMap.forEach(masterLevelMap => {
|
||||
describe(`when diag logger is set to ${masterLevelMap.message}`, () => {
|
||||
it('diag.setLogger level is ignored when using a specific logger', () => {
|
||||
describe(`when diag logger is set to ${masterLevelMap.message}`, function () {
|
||||
it('diag.setLogger level is ignored when using a specific logger', function () {
|
||||
diag.setLogger(dummyLogger, masterLevelMap.level);
|
||||
|
||||
const testLogger = createLogLevelDiagLogger(
|
||||
|
@ -192,7 +192,7 @@ describe('LogLevelFilter DiagLogger', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('diag.setLogger level and logger should log', () => {
|
||||
it('diag.setLogger level and logger should log', function () {
|
||||
diag.setLogger(dummyLogger, map.level);
|
||||
restoreCallHistory();
|
||||
diag[fName](`${fName} called %s`, 'param1');
|
||||
|
@ -208,7 +208,7 @@ describe('LogLevelFilter DiagLogger', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should not throw with an invalid DiagLogger', () => {
|
||||
it('should not throw with an invalid DiagLogger', function () {
|
||||
const invalidLogger = {
|
||||
debug: 1,
|
||||
warn: 2,
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import sinon = require('sinon');
|
||||
import * as sinon from 'sinon';
|
||||
import { diag, DiagLogLevel } from '../../../src';
|
||||
import { createNoopDiagLogger } from '../../../src/diag/internal/noopLogger';
|
||||
import { DiagLogger } from '../../../src/diag/types';
|
||||
|
@ -27,7 +27,7 @@ export const diagLoggerFunctions = [
|
|||
'warn',
|
||||
'error',
|
||||
] as const;
|
||||
describe('DiagLogger functions', () => {
|
||||
describe('DiagLogger functions', function () {
|
||||
const calledArgs: any = {
|
||||
error: null,
|
||||
warn: null,
|
||||
|
@ -59,9 +59,9 @@ describe('DiagLogger functions', () => {
|
|||
diag.disable();
|
||||
});
|
||||
|
||||
describe('constructor', () => {
|
||||
describe('constructor', function () {
|
||||
diagLoggerFunctions.forEach(fName => {
|
||||
it(`should log with ${fName} message`, () => {
|
||||
it(`should log with ${fName} message`, function () {
|
||||
const testLogger = dummyLogger;
|
||||
testLogger[fName](`${fName} called %s`, 'param1');
|
||||
diagLoggerFunctions.forEach(lName => {
|
||||
|
@ -76,7 +76,7 @@ describe('DiagLogger functions', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it(`diag should log with ${fName} message`, () => {
|
||||
it(`diag should log with ${fName} message`, function () {
|
||||
diag.setLogger(dummyLogger, DiagLogLevel.ALL);
|
||||
restoreCallHistory();
|
||||
diag[fName](`${fName} called %s`, 'param1');
|
||||
|
@ -92,7 +92,7 @@ describe('DiagLogger functions', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it(`NoopLogger should implement all functions and not throw when ${fName} called`, () => {
|
||||
it(`NoopLogger should implement all functions and not throw when ${fName} called`, function () {
|
||||
const testLogger = createNoopDiagLogger();
|
||||
|
||||
assert.ok(typeof testLogger[fName], 'function');
|
||||
|
@ -101,12 +101,12 @@ describe('DiagLogger functions', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('diag is used as the diag logger in setLogger', () => {
|
||||
it('should not throw', () => {
|
||||
describe('diag is used as the diag logger in setLogger', function () {
|
||||
it('should not throw', function () {
|
||||
diag.setLogger(diag);
|
||||
});
|
||||
|
||||
it('should use the previously registered logger to log the error', () => {
|
||||
it('should use the previously registered logger to log the error', function () {
|
||||
const error = sinon.stub();
|
||||
diag.setLogger({
|
||||
verbose: () => {},
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { wrapTracer } from '../../../../src/experimental';
|
||||
import * as assert from 'assert';
|
||||
import { NoopTracerProvider } from '../../../../src/trace/NoopTracerProvider';
|
||||
import { NoopTracer } from '../../../../src/trace/NoopTracer';
|
||||
import { Span } from '../../../../src';
|
||||
import { Context, context, SpanOptions } from '../../../../src';
|
||||
|
||||
describe('SugaredTracer', function () {
|
||||
class TestTracer extends NoopTracer {
|
||||
public calls: IArguments[] = [];
|
||||
|
||||
override startActiveSpan<F extends (span: Span) => ReturnType<F>>(
|
||||
name: string,
|
||||
arg2?: SpanOptions,
|
||||
arg3?: Context,
|
||||
arg4?: F
|
||||
): ReturnType<F> | undefined {
|
||||
this.calls.push(arguments);
|
||||
return super.startActiveSpan(name, arg2, arg3, arg4 as F);
|
||||
}
|
||||
|
||||
override startSpan(
|
||||
name: string,
|
||||
options?: SpanOptions,
|
||||
_context: Context = context.active()
|
||||
): Span {
|
||||
this.calls.push(arguments);
|
||||
return super.startSpan(name, options, _context);
|
||||
}
|
||||
}
|
||||
|
||||
class TestTracerProvider extends NoopTracerProvider {
|
||||
override getTracer() {
|
||||
return new TestTracer();
|
||||
}
|
||||
}
|
||||
|
||||
const tracer = new TestTracerProvider().getTracer();
|
||||
const sugaredTracer = wrapTracer(tracer);
|
||||
|
||||
afterEach(() => {
|
||||
tracer.calls = [];
|
||||
});
|
||||
|
||||
describe('wrapTracer()', function () {
|
||||
it('still provides standard tracer functions', function () {
|
||||
assert.ok(
|
||||
typeof sugaredTracer.startSpan === 'function',
|
||||
'startSpan is missing'
|
||||
);
|
||||
assert.ok(
|
||||
typeof sugaredTracer.startActiveSpan === 'function',
|
||||
'startActiveSpan is missing'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('withActiveSpan()', function () {
|
||||
it('proxies value with minimal args', function () {
|
||||
const result = sugaredTracer.withActiveSpan('test', span => {
|
||||
return 'result';
|
||||
});
|
||||
|
||||
assert.strictEqual(result, 'result', 'Unexpected result');
|
||||
|
||||
assert.strictEqual(tracer.calls.length, 2); // ensure that startActiveSpan and startSpan is called
|
||||
});
|
||||
|
||||
it('proxies value with context', function () {
|
||||
const result = sugaredTracer.withActiveSpan(
|
||||
'test',
|
||||
{ onException: e => e },
|
||||
span => {
|
||||
return 'result';
|
||||
}
|
||||
);
|
||||
|
||||
assert.strictEqual(result, 'result', 'Unexpected result');
|
||||
|
||||
assert.strictEqual(tracer.calls.length, 2); // ensure that startActiveSpan and startSpan is called
|
||||
});
|
||||
|
||||
it('proxies value with context', function () {
|
||||
const result = sugaredTracer.withActiveSpan(
|
||||
'test',
|
||||
{ onException: e => e },
|
||||
context.active(),
|
||||
span => {
|
||||
return 'result';
|
||||
}
|
||||
);
|
||||
|
||||
assert.strictEqual(result, 'result', 'Unexpected result');
|
||||
|
||||
assert.strictEqual(tracer.calls.length, 2); // ensure that startActiveSpan and startSpan is called
|
||||
});
|
||||
|
||||
it('returns promise if wrapped function returns promise', async function () {
|
||||
const result = sugaredTracer.withActiveSpan('test', span => {
|
||||
return Promise.resolve('result');
|
||||
});
|
||||
|
||||
assert.ok(typeof result.then == 'function');
|
||||
assert.strictEqual(await result, 'result', 'Unexpected result');
|
||||
});
|
||||
|
||||
it('returns void', function () {
|
||||
const result = sugaredTracer.withActiveSpan('test', (span: Span) => {
|
||||
return;
|
||||
});
|
||||
|
||||
assert.strictEqual(result, undefined);
|
||||
});
|
||||
});
|
||||
|
||||
describe('withSpan()', function () {
|
||||
it('proxies value', function () {
|
||||
const result = sugaredTracer.withSpan('test', span => {
|
||||
return 'result';
|
||||
});
|
||||
|
||||
assert.strictEqual(result, 'result', 'Unexpected result');
|
||||
});
|
||||
|
||||
it('returns promise if wrapped function returns promise', async function () {
|
||||
const result = sugaredTracer.withSpan('test', span => {
|
||||
return Promise.resolve('result');
|
||||
});
|
||||
|
||||
assert.ok(typeof result.then == 'function');
|
||||
assert.strictEqual(await result, 'result', 'Unexpected result');
|
||||
});
|
||||
|
||||
it('returns void', function () {
|
||||
const result = sugaredTracer.withSpan('test', (span: Span) => {
|
||||
return;
|
||||
});
|
||||
|
||||
assert.strictEqual(result, undefined);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -15,11 +15,11 @@
|
|||
*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as sinon from 'sinon';
|
||||
import { getGlobal } from '../../../src/internal/global-utils';
|
||||
import { _globalThis } from '../../../src/platform';
|
||||
import { NoopContextManager } from '../../../src/context/NoopContextManager';
|
||||
import { DiagLogLevel } from '../../../src/diag/types';
|
||||
import sinon = require('sinon');
|
||||
|
||||
const api1 = require('../../../src') as typeof import('../../../src');
|
||||
|
||||
|
@ -41,7 +41,7 @@ const getMockLogger = () => ({
|
|||
error: sinon.spy(),
|
||||
});
|
||||
|
||||
describe('Global Utils', () => {
|
||||
describe('Global Utils', function () {
|
||||
// prove they are separate instances
|
||||
assert.notEqual(api1, api2);
|
||||
// that return separate noop instances to start
|
||||
|
@ -59,7 +59,7 @@ describe('Global Utils', () => {
|
|||
delete _globalThis[Symbol.for(GLOBAL_API_SYMBOL_KEY)];
|
||||
});
|
||||
|
||||
it('should change the global context manager', () => {
|
||||
it('should change the global context manager', function () {
|
||||
const original = api1.context['_getContextManager']();
|
||||
const newContextManager = new NoopContextManager();
|
||||
api1.context.setGlobalContextManager(newContextManager);
|
||||
|
@ -67,7 +67,7 @@ describe('Global Utils', () => {
|
|||
assert.strictEqual(api1.context['_getContextManager'](), newContextManager);
|
||||
});
|
||||
|
||||
it('should load an instance from one which was set in the other', () => {
|
||||
it('should load an instance from one which was set in the other', function () {
|
||||
api1.context.setGlobalContextManager(new NoopContextManager());
|
||||
assert.strictEqual(
|
||||
api1.context['_getContextManager'](),
|
||||
|
@ -75,7 +75,7 @@ describe('Global Utils', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('should disable both if one is disabled', () => {
|
||||
it('should disable both if one is disabled', function () {
|
||||
const manager = new NoopContextManager();
|
||||
api1.context.setGlobalContextManager(manager);
|
||||
|
||||
|
@ -84,7 +84,7 @@ describe('Global Utils', () => {
|
|||
assert.notStrictEqual(manager, api1.context['_getContextManager']());
|
||||
});
|
||||
|
||||
it('should not register if the version is a mismatch', () => {
|
||||
it('should not register if the version is a mismatch', function () {
|
||||
const logger1 = getMockLogger();
|
||||
const logger2 = getMockLogger();
|
||||
|
||||
|
@ -102,7 +102,7 @@ describe('Global Utils', () => {
|
|||
sinon.assert.notCalled(logger2.warn);
|
||||
});
|
||||
|
||||
it('should debug log registrations', () => {
|
||||
it('should debug log registrations', function () {
|
||||
const logger = getMockLogger();
|
||||
api1.diag.setLogger(logger, DiagLogLevel.DEBUG);
|
||||
|
||||
|
@ -114,7 +114,7 @@ describe('Global Utils', () => {
|
|||
sinon.assert.calledTwice(logger.debug);
|
||||
});
|
||||
|
||||
it('should log an error if there is a duplicate registration', () => {
|
||||
it('should log an error if there is a duplicate registration', function () {
|
||||
const logger = getMockLogger();
|
||||
api1.diag.setLogger(logger);
|
||||
|
||||
|
@ -130,7 +130,7 @@ describe('Global Utils', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('should allow duplicate registration of the diag logger', () => {
|
||||
it('should allow duplicate registration of the diag logger', function () {
|
||||
const logger1 = getMockLogger();
|
||||
const logger2 = getMockLogger();
|
||||
|
||||
|
|
|
@ -21,22 +21,22 @@ import {
|
|||
} from '../../../src/internal/semver';
|
||||
import { VERSION } from '../../../src/version';
|
||||
|
||||
describe('semver', () => {
|
||||
it('should be compatible if versions are equal', () => {
|
||||
describe('semver', function () {
|
||||
it('should be compatible if versions are equal', function () {
|
||||
assert.ok(isCompatible(VERSION));
|
||||
});
|
||||
|
||||
it('returns false if own version cannot be parsed', () => {
|
||||
it('returns false if own version cannot be parsed', function () {
|
||||
const check = _makeCompatibilityCheck('this is not semver');
|
||||
assert.ok(!check('1.0.0'));
|
||||
});
|
||||
|
||||
it('incompatible if other version cannot be parsed', () => {
|
||||
it('incompatible if other version cannot be parsed', function () {
|
||||
const check = _makeCompatibilityCheck('0.1.2');
|
||||
assert.ok(!check('this is not semver'));
|
||||
});
|
||||
|
||||
describe('>= 1.0.0', () => {
|
||||
describe('>= 1.0.0', function () {
|
||||
const globalVersion = '5.5.5';
|
||||
const vers: [string, boolean][] = [
|
||||
// same major/minor run should be compatible
|
||||
|
@ -81,7 +81,7 @@ describe('semver', () => {
|
|||
test(globalVersion, vers);
|
||||
});
|
||||
|
||||
describe('< 1.0.0', () => {
|
||||
describe('< 1.0.0', function () {
|
||||
const globalVersion = '0.5.5';
|
||||
const vers: [string, boolean][] = [
|
||||
// same minor/patch should be compatible
|
||||
|
@ -119,7 +119,7 @@ describe('semver', () => {
|
|||
test(globalVersion, vers);
|
||||
});
|
||||
|
||||
describe('global version is prerelease', () => {
|
||||
describe('global version is prerelease', function () {
|
||||
const globalVersion = '1.0.0-rc.3';
|
||||
const vers: [string, boolean][] = [
|
||||
// must match exactly
|
||||
|
@ -135,11 +135,11 @@ describe('semver', () => {
|
|||
});
|
||||
|
||||
function test(globalVersion: string, vers: [string, boolean][]) {
|
||||
describe(`global version is ${globalVersion}`, () => {
|
||||
describe(`global version is ${globalVersion}`, function () {
|
||||
for (const [version, compatible] of vers) {
|
||||
it(`API version ${version} ${
|
||||
compatible ? 'should' : 'should not'
|
||||
} be able to access global`, () => {
|
||||
} be able to access global`, function () {
|
||||
const check = _makeCompatibilityCheck(version);
|
||||
assert.strictEqual(check(globalVersion), compatible);
|
||||
});
|
||||
|
|
|
@ -17,13 +17,18 @@
|
|||
import * as assert from 'assert';
|
||||
import { VERSION } from '../../../src/version';
|
||||
|
||||
describe('version', () => {
|
||||
it('should have generated VERSION.ts', () => {
|
||||
describe('version', function () {
|
||||
it('should have generated VERSION.ts', function () {
|
||||
// Skip in case we're not running in Node.js
|
||||
if (global.process?.versions?.node === undefined) {
|
||||
this.skip();
|
||||
}
|
||||
|
||||
const pjson = require('../../../package.json');
|
||||
assert.strictEqual(pjson.version, VERSION);
|
||||
});
|
||||
|
||||
it('prerelease tag versions are banned', () => {
|
||||
it('prerelease tag versions are banned', function () {
|
||||
// see https://github.com/open-telemetry/opentelemetry-js-api/issues/74
|
||||
assert.ok(VERSION.match(/^\d+\.\d+\.\d+$/));
|
||||
});
|
||||
|
|
|
@ -16,16 +16,16 @@
|
|||
|
||||
import { Counter, UpDownCounter, Histogram } from '../../../src';
|
||||
|
||||
describe('Metric', () => {
|
||||
describe('Counter', () => {
|
||||
it('enable not to define any type', () => {
|
||||
describe('Metric', function () {
|
||||
describe('Counter', function () {
|
||||
it('enable not to define any type', function () {
|
||||
const counter: Counter = {
|
||||
add(_value: number, _attribute: unknown) {},
|
||||
};
|
||||
counter.add(1, { 'some-attribute': 'value' });
|
||||
});
|
||||
|
||||
it('enable to use with type', () => {
|
||||
it('enable to use with type', function () {
|
||||
type Attributes = {
|
||||
'some-attribute': string;
|
||||
};
|
||||
|
@ -35,27 +35,27 @@ describe('Metric', () => {
|
|||
counter.add(1, { 'some-attribute': 'value' });
|
||||
});
|
||||
|
||||
it('disable wrong attributes by typing', () => {
|
||||
it('disable wrong attributes by typing', function () {
|
||||
type Attributes = {
|
||||
'some-attribute': string;
|
||||
};
|
||||
const counter: Counter<Attributes> = {
|
||||
add(_value: number, _attribute: Attributes) {},
|
||||
};
|
||||
// @ts-expect-error Expacting the type of Attributes
|
||||
// @ts-expect-error Expecting the type of Attributes
|
||||
counter.add(1, { 'another-attribute': 'value' });
|
||||
});
|
||||
});
|
||||
|
||||
describe('UpDownCounter', () => {
|
||||
it('enable not to define any type', () => {
|
||||
describe('UpDownCounter', function () {
|
||||
it('enable not to define any type', function () {
|
||||
const counter: UpDownCounter = {
|
||||
add(_value: number, _attribute: unknown) {},
|
||||
};
|
||||
counter.add(1, { 'some-attribute': 'value' });
|
||||
});
|
||||
|
||||
it('enable to use with type', () => {
|
||||
it('enable to use with type', function () {
|
||||
type Attributes = {
|
||||
'some-attribute': string;
|
||||
};
|
||||
|
@ -65,27 +65,27 @@ describe('Metric', () => {
|
|||
counter.add(1, { 'some-attribute': 'value' });
|
||||
});
|
||||
|
||||
it('disable wrong attributes by typing', () => {
|
||||
it('disable wrong attributes by typing', function () {
|
||||
type Attributes = {
|
||||
'some-attribute': string;
|
||||
};
|
||||
const counter: UpDownCounter<Attributes> = {
|
||||
add(_value: number, _attribute: Attributes) {},
|
||||
};
|
||||
// @ts-expect-error Expacting the type of Attributes
|
||||
// @ts-expect-error Expecting the type of Attributes
|
||||
counter.add(1, { 'another-attribute': 'value' });
|
||||
});
|
||||
});
|
||||
|
||||
describe('Histogram', () => {
|
||||
it('enable not to define any type', () => {
|
||||
describe('Histogram', function () {
|
||||
it('enable not to define any type', function () {
|
||||
const counter: Histogram = {
|
||||
record(_value: number, _attribute: unknown) {},
|
||||
};
|
||||
counter.record(1, { 'some-attribute': 'value' });
|
||||
});
|
||||
|
||||
it('enable to use with type', () => {
|
||||
it('enable to use with type', function () {
|
||||
type Attributes = {
|
||||
'some-attribute': string;
|
||||
};
|
||||
|
@ -95,14 +95,14 @@ describe('Metric', () => {
|
|||
counter.record(1, { 'some-attribute': 'value' });
|
||||
});
|
||||
|
||||
it('disable wrong attributes by typing', () => {
|
||||
it('disable wrong attributes by typing', function () {
|
||||
type Attributes = {
|
||||
'some-attribute': string;
|
||||
};
|
||||
const counter: Histogram<Attributes> = {
|
||||
record(_value: number, _attribute: Attributes) {},
|
||||
};
|
||||
// @ts-expect-error Expacting the type of Attributes
|
||||
// @ts-expect-error Expecting the type of Attributes
|
||||
counter.record(1, { 'another-attribute': 'value' });
|
||||
});
|
||||
});
|
||||
|
|
|
@ -24,6 +24,7 @@ import {
|
|||
NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC,
|
||||
NOOP_UP_DOWN_COUNTER_METRIC,
|
||||
createNoopMeter,
|
||||
NOOP_GAUGE_METRIC,
|
||||
} from '../../../src/metrics/NoopMeter';
|
||||
import { NoopMeterProvider } from '../../../src/metrics/NoopMeterProvider';
|
||||
|
||||
|
@ -33,13 +34,13 @@ const options = {
|
|||
description: 'the testing package',
|
||||
};
|
||||
|
||||
describe('NoopMeter', () => {
|
||||
it('constructor should not crash', () => {
|
||||
describe('NoopMeter', function () {
|
||||
it('constructor should not crash', function () {
|
||||
const meter = new NoopMeterProvider().getMeter('test-noop');
|
||||
assert(meter instanceof NoopMeter);
|
||||
assert.ok(meter instanceof NoopMeter);
|
||||
});
|
||||
|
||||
it('counter should not crash', () => {
|
||||
it('counter should not crash', function () {
|
||||
const meter = new NoopMeterProvider().getMeter('test-noop');
|
||||
const counter = meter.createCounter('some-name');
|
||||
|
||||
|
@ -53,7 +54,7 @@ describe('NoopMeter', () => {
|
|||
assert.strictEqual(counterWithOptions, NOOP_COUNTER_METRIC);
|
||||
});
|
||||
|
||||
it('histogram should not crash', () => {
|
||||
it('histogram should not crash', function () {
|
||||
const meter = new NoopMeterProvider().getMeter('test-noop');
|
||||
const histogram = meter.createHistogram('some-name');
|
||||
histogram.record(1, attributes);
|
||||
|
@ -65,7 +66,7 @@ describe('NoopMeter', () => {
|
|||
assert.strictEqual(histogramWithOptions, NOOP_HISTOGRAM_METRIC);
|
||||
});
|
||||
|
||||
it('up down counter should not crash', () => {
|
||||
it('up down counter should not crash', function () {
|
||||
const meter = new NoopMeterProvider().getMeter('test-noop');
|
||||
const upDownCounter = meter.createUpDownCounter('some-name');
|
||||
upDownCounter.add(1, attributes);
|
||||
|
@ -80,7 +81,7 @@ describe('NoopMeter', () => {
|
|||
assert.strictEqual(upDownCounterWithOptions, NOOP_UP_DOWN_COUNTER_METRIC);
|
||||
});
|
||||
|
||||
it('observable counter should not crash', () => {
|
||||
it('observable counter should not crash', function () {
|
||||
const meter = new NoopMeterProvider().getMeter('test-noop');
|
||||
const observableCounter = meter.createObservableCounter('some-name');
|
||||
observableCounter.addCallback(() => {});
|
||||
|
@ -98,7 +99,7 @@ describe('NoopMeter', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('observable gauge should not crash', () => {
|
||||
it('observable gauge should not crash', function () {
|
||||
const meter = new NoopMeterProvider().getMeter('test-noop');
|
||||
const observableGauge = meter.createObservableGauge('some-name');
|
||||
observableGauge.addCallback(() => {});
|
||||
|
@ -116,7 +117,18 @@ describe('NoopMeter', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('observable up down counter should not crash', () => {
|
||||
it('gauge should not crash', function () {
|
||||
const meter = new NoopMeterProvider().getMeter('test-noop');
|
||||
const observableGauge = meter.createGauge('some-name');
|
||||
|
||||
// ensure the correct noop const is returned
|
||||
assert.strictEqual(observableGauge, NOOP_GAUGE_METRIC);
|
||||
|
||||
const gaugeWithOptions = meter.createGauge('some-name', options);
|
||||
assert.strictEqual(gaugeWithOptions, NOOP_GAUGE_METRIC);
|
||||
});
|
||||
|
||||
it('observable up down counter should not crash', function () {
|
||||
const meter = new NoopMeterProvider().getMeter('test-noop');
|
||||
const observableUpDownCounter =
|
||||
meter.createObservableUpDownCounter('some-name');
|
||||
|
@ -136,15 +148,15 @@ describe('NoopMeter', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('batch callback should not crash', () => {
|
||||
it('batch callback should not crash', function () {
|
||||
const meter = new NoopMeterProvider().getMeter('test-noop');
|
||||
meter.addBatchObservableCallback(() => {}, []);
|
||||
meter.removeBatchObservableCallback(() => {}, []);
|
||||
});
|
||||
});
|
||||
|
||||
describe('createNoopMeter', () => {
|
||||
it('should return NoopMeter', () => {
|
||||
describe('createNoopMeter', function () {
|
||||
it('should return NoopMeter', function () {
|
||||
assert.ok(createNoopMeter() instanceof NoopMeter);
|
||||
});
|
||||
});
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue