{"_id":"@fwl/tracing","_rev":"83-512212453879c3c374a2f7786e2e6dd1","name":"@fwl/tracing","dist-tags":{"latest":"0.10.9","experimental":"0.0.0-experimental-4c289e8"},"versions":{"0.1.0":{"author":{"name":"Fewlines"},"description":"Traacing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/core":"^0.5.2","@opentelemetry/exporter-zipkin":"^0.5.2","@opentelemetry/node":"^0.5.2","@opentelemetry/plugin-dns":"^0.5.2","@opentelemetry/plugin-express":"^0.5.2","@opentelemetry/plugin-http":"^0.5.2","@opentelemetry/plugin-https":"^0.5.2","@opentelemetry/plugin-pg":"^0.6.0","@opentelemetry/plugin-pg-pool":"^0.6.0","@opentelemetry/tracing":"^0.5.2"},"devDependencies":{"@fewlines/eslint-config":"^1.1.0","@types/jest":"^25.1.4","@types/node":"^13.9.5","@typescript-eslint/eslint-plugin":"^2.25.0","@typescript-eslint/parser":"^2.25.0","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-plugin-prettier":"^3.1.2","jest":"^25.2.4","prettier":"^2.0.2","ts-jest":"^25.3.0","ts-node":"^8.8.1","typescript":"^3.8.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.1.0","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.1.0","dist":{"shasum":"eaa48f670e0b04508ae3d7763d9a6ed4e640bef1","integrity":"sha512-1B3rYNlOO3p/N1gc+uqLUtgMUAUvpON9D8mvqcZaP+z2UPaT/e7qD6w2BPOwRQeBPI/DDh0K0sSrLPKeJsZ+Lg==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.1.0.tgz","fileCount":10,"unpackedSize":262876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7LzRCRA9TVsSAnZWagAAr38P/0T7XmkHvw9HkhB7gqlT\nNWdvYRNkp7SsrMTU38ZH1owU5eQw2yOXspVB0TPbmm5PAhWOMQKMdkjgkf4N\neU4HuqIVDqxzPDx4YYcYOTaQRclob6h8eRBGMRHET2mTa8L3Nlfz33EHjvy2\nYJ6/XgVMCbhSCWfRzGGIp087KtKd6V9Lde2e1zhw5+tmlkA7WggatZM2RjDu\niVlQ5YqfyE6YV3itvE6vgyxRjv11uRwyorvlWfZ9sJiCCAvULNYeRLgr1KhS\noY0+lJkDSsLlyswS+6iTMZzdRSrHzU7x0BK2wjujxjqY08jQRYgXgujaN+Vt\nW89rxu+Y2M/9H+by9DRaNezxM8wQ08SEkmw4QtP1snk2qtzNjhSFwpKrn8sR\n2X+vzFUvRljHOcrhL6zLLWTiwXt9rBNwGiCFOPbYkvgOVZnCI1sOkU3kc8b5\n/3qFyVobW3qmW+SJdH9GGv7e+nzM7lygDH64RFj5+NqBiIGIsC6L/K/bDTrW\nXgj5y/XCI871vg0ZOE5W94EBNLkuj9ptf5uZhTs5/HLz7C9SDJXDhDiSyvpW\n0ab7eWygF+zgt1Dh/DhifB1qjmvd/zk1zvkHoWRy3taEqH38l/yYzU2ZO80E\nknv3lDuanVtKSSCu25DTcoGgSHIAZluOZMelWdndHDkwXBXrxBcNnGd+cfKi\nzRS8\r\n=2Shg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFTAbYaWldCQxdflCmksjD+yc9LkjEmRAmQg8NzfbSe/AiEAkV69L57Cjnr2/12tyfMn8C4GkLKshVpvjhGGZjgyzcM="}]},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.1.0_1592573137288_0.718659452625299"},"_hasShrinkwrap":false},"0.2.0":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/core":"^0.5.2","@opentelemetry/exporter-zipkin":"^0.5.2","@opentelemetry/node":"^0.5.2","@opentelemetry/plugin-dns":"^0.5.2","@opentelemetry/plugin-express":"^0.5.2","@opentelemetry/plugin-http":"^0.5.2","@opentelemetry/plugin-https":"^0.5.2","@opentelemetry/plugin-pg":"^0.6.0","@opentelemetry/plugin-pg-pool":"^0.6.0","@opentelemetry/tracing":"^0.5.2"},"devDependencies":{"@fewlines/eslint-config":"^1.1.0","@types/jest":"^26.0.3","@types/node":"^13.9.5","@typescript-eslint/eslint-plugin":"^2.25.0","@typescript-eslint/parser":"^2.25.0","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-plugin-prettier":"^3.1.2","jest":"^26.1.0","prettier":"^2.0.2","ts-jest":"^26.1.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.2.0","_id":"@fwl/tracing@0.2.0","_nodeVersion":"13.8.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-D4D0C4+s1WXGqL3TE3lyGThnhJ3vY21EydpPiKSMUfyoBf9FpFq8VR7xZjSOS9hFS0MtbctiVWoN/LJRWTZzYg==","shasum":"db445bfae302ab7803713da20f3681a1bc89dc1c","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.2.0.tgz","fileCount":17,"unpackedSize":313323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBCvCCRA9TVsSAnZWagAA2YYP/jPwKH+1HrhuqrQh5VD4\nLB5OCh7GBG/Hm28QiqfOsqmGBfz9nDonOJKerISZEoCIVt5wjNzVdK9kcNkP\nRZDfJiFfps3R9lJBhzrczPJC3QF2l0RhHxX7Ace0Z1nEiz6Rnb/XF3Am/ZBn\nZwI9R6e47ZGElyQ85bcwfVnDTV3ZKMIy/+m+bzfHp61DPXrT33Yuy+62eMOv\nJjEtvvEEjMJSM73pGXnPlr2ht7fVBX9C6WZY4LahG9jWUq8sJSWcSxzd8tzu\nie3tkNmh23XJcx961s0cdJwE82D2W1b+NFa60I0ZawRJ0J1o5qWIJlD5ie0A\nHDsrBI+I6R/xpPYVWxoKlfppOj1yHaDTGt0Db2Oxr8N1zvPUdI/0v2jWT14f\nBdjYncceF0zi3AyiL83KV0pVoEE53zbfqpL/C/cHfVwgZwVy+ZaMLHyW8xR9\nRVp6nlHyU3fdy9Z3UZtmrOX5hIAPONojd1xiNYTpgScjoyK3Bdj1cxjH2Kx4\nOYJnzfJWJCVb6fDDrLRXn4HWh7Fgo1LctPsKBRMW1AoO1GsiUafv3lAMRofG\n1WNSC+qHzBqSsVD4ugQq1TMhhN0FbGUnsnUXWwjOcrTpc3QuisWjC5kw0kFz\n6FU0idjlKRrUG0eo6Eoc5/7onpXihUS5ZMjXv4VYQQeXTcKCzimkToLI6KMz\nx+QV\r\n=3HCQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeP6bQRU7L4I51cy/QaiZHt/39DWhN6KuNk0AiiQGHIQIhAMTEikJs/1nmCqgXw7Evhxo67Wu6BZDKliHQ07C1H9FL"}]},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.2.0_1594108866414_0.257577542223969"},"_hasShrinkwrap":false},"0.2.1":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/core":"^0.9.0","@opentelemetry/exporter-zipkin":"^0.9.0","@opentelemetry/node":"^0.9.0","@opentelemetry/plugin-dns":"^0.8.0","@opentelemetry/plugin-express":"^0.8.0","@opentelemetry/plugin-http":"^0.9.0","@opentelemetry/plugin-https":"^0.9.0","@opentelemetry/plugin-pg":"^0.8.0","@opentelemetry/plugin-pg-pool":"^0.8.0","@opentelemetry/tracing":"^0.9.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"^26.0.7","@types/node":"^14.0.26","@typescript-eslint/eslint-plugin":"^3.7.0","@typescript-eslint/parser":"^3.7.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","jest":"^26.1.0","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.2.1","_id":"@fwl/tracing@0.2.1","_nodeVersion":"13.8.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-EbNybhO9nJ2FXnATQFzIHdcgWYEKvAQU4CRugz+k2IJ6sccfTrzISBlm62R4NWHpQoCwu0rYZbG8JPqqVsQmfg==","shasum":"23d135d7cb1394807c40fcff1355045c63723198","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.2.1.tgz","fileCount":17,"unpackedSize":416027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfITzBCRA9TVsSAnZWagAARXIP/A01isdfLF1m66ezvB5k\n70DUoq7brvJPaJbxNba90kf1FqfseOJ6lJqaBSFMhzDf1djMnzq+0C7c999D\nUpzTsALvmzOtrPtcfltpCIiXN60d52LURPP3wzKYfUhRHM1JfcxPCkKVJQn9\n+CfRwnxTy12usMOBcJgGJn7cBEnsK1nBRq85FTaquUkLEdABTom2FwUMG/GW\nBDFkv5tmRkMLWonPRinXbPXkUSCW1McNDgrkat8c2pl4eowcIONhJ63Vwnqf\no+2IV1Pj8XCH2gAkNn3nI5N+YQzCWsCr7k+i2EBFc2vJuu6QoJCCuyfDfYt4\n/+3Cwy4LYL8Q/xX0qXZ4x75Apk1gNWgJR24fohGKTQa7eK2yBruhbnCVpaUh\nZwxTvpt4uZVVqYTXH9iq4F3XkIfBQVFGc6SW/CDRp9th6D/Lmco+P+V/H7SO\noKc9snAr212fvs7CrUallMdrxvRoDArBIYkYOD4nA89x3+qOeAQWyM6kRe8Z\no3XEZtafX89++W/TynllOG0GFqaYwhK74QZpiEYopOjKhuoErkKdaB3GkypO\ntyBsguzKfSRg6VNVSxC7wHFe/tr3PXKapzNz38TwwK/K+G+Hnl+LpbclVFD1\ndGJRSbkwL0+M7eNFUK2LLIk040PmvPcxaW4TXqrL3UlEAUYdPad6HZVlnQQT\n+ctN\r\n=fqEx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBH6NtIZxUJ868IpxMs/mZ2AiVHXb6DdUO+UB/mqZjHXAiAApgdKjZaboan2EOlSSZmC3plij3Am/iql4yNt7gT8vA=="}]},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.2.1_1596013760877_0.6010236589171019"},"_hasShrinkwrap":false},"0.3.0":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/core":"^0.9.0","@opentelemetry/exporter-zipkin":"^0.9.0","@opentelemetry/node":"^0.9.0","@opentelemetry/plugin-dns":"^0.8.0","@opentelemetry/plugin-express":"^0.8.0","@opentelemetry/plugin-http":"^0.9.0","@opentelemetry/plugin-https":"^0.9.0","@opentelemetry/tracing":"^0.9.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"^26.0.7","@types/node":"^14.0.26","@typescript-eslint/eslint-plugin":"^3.7.0","@typescript-eslint/parser":"^3.7.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","jest":"^26.1.0","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.3.0","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.3.0","dist":{"shasum":"285804bfa25bbdcb8069f7f6c00e33f598ed6334","integrity":"sha512-UP1SNp7FGMQUWOygEh20GXipMPEn2eu78v0QRmYJt+LOkR62AE5Q9HsCfEpugemLKi8mienIsPxUMkry/Ui3NA==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.3.0.tgz","fileCount":20,"unpackedSize":380172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM7B0CRA9TVsSAnZWagAAXBMP/2WNjlSMHO+mCGorB3I3\nHo/SAn5QZxyM5rpIdnh+JgTuiq/XLSc5Ti+ChsLfns+L3oHVWHJHjciqDTOC\n4fTuuMNtDM/IZxWD3xhPxzSXEymEr4wMfNvHmSAUdrl1Sfd8fgZ/7xOyhkZm\nRscNmp1Fs9kOJN3Vn1iKiIwSMnkWA3OhoSsymkmL6RBvdvwVkuoL//iVgHOR\na2AmSIAPMayz6nVVqcZI76hJX+N7qVuzLDG6ckjPbIkPDmWPjfeIG67+jiIL\nv5GaeoATv9G2qVsilLUv1YFBJMHN5EkfV46SjsKdzF5oq+jOpoDhjUlUP5og\nRawbCmlcpmtN1Ga2+clvU6vNN/8CMV6Cx+/lYBmiWhk4p1kgNwNX7Q2KC6+d\nGDVHpon0rwwJAY+ZnvM58MjG+n+bCpLqeuekoNK9I29WcD4QiMMO+XK/ax/2\ntNZyIMxNvLHFJYa9r2S+S49TzHMel01RaDZ94oN038vMeavrDNu5qTvIzLN0\ng6uM/isZVaQNY5y6Sko0hn3ZuBweXZr89sE6XJHAx29AA6qWgRwYwR/DBrzr\nhPOl4Gm897F8IPaDjqREWos+/qPNNAfhL9qRIbTybXL+7/DzTVvx1PUbXjup\n3cy6nxKils5tAU2ueiXnVi6hTPDmoJ6AvZDg3kW3Tj3czmY6C/46t4XjP/Ne\nVfRB\r\n=YfjM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCE/Fm9pCNVeU+DYUcO7lqd+Gxy6nqCmzQt2OaywaWbzwIgGQLyBx/8djLchvQJu5BHPGBMZpKc1OWdn3R6eNsrBis="}]},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.3.0_1597223027907_0.46953813363400854"},"_hasShrinkwrap":false},"0.3.1":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/core":"^0.9.0","@opentelemetry/exporter-zipkin":"^0.9.0","@opentelemetry/node":"^0.9.0","@opentelemetry/plugin-dns":"^0.8.0","@opentelemetry/plugin-express":"^0.8.0","@opentelemetry/plugin-http":"^0.9.0","@opentelemetry/plugin-https":"^0.9.0","@opentelemetry/tracing":"^0.9.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"^26.0.7","@types/node":"^14.0.26","@typescript-eslint/eslint-plugin":"^3.7.0","@typescript-eslint/parser":"^3.7.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","jest":"^26.1.0","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.3.1","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.3.1","dist":{"shasum":"3784c4931dd2b700c2bde6988a8c1ef56dd91b1e","integrity":"sha512-PJLSZLse4Fv1aj8zxmHHQFc1CLikQJNYa327IhA4FjHSozdbzYNmgSTEZTYUvMTbHkksBXDfCJE4Wyf104QYPg==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.3.1.tgz","fileCount":24,"unpackedSize":510871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfO9PpCRA9TVsSAnZWagAA+80P/0THGAudC5cr0RQosQZ3\nG/I53pZeHew022oCJh7HMgTDLHDT8+GiF/k9XqOMyEX1Y3PgNqI43+8Z6ydq\nBRKvto4k1z77j2VEAY9WAt+O++eZQAtPxoxEdxZSb0PAOdIMQImIU7Ox9gB5\n6c4UDqrBpBckg6qYWuanBJBdN5W9O/agzmDfgJRJkjvEAjjSBb2UFOHG4ib7\nYKore9nyOw0N6wt2WaverKCKiQyg5FSrfeoiXRr8QNG3OIb0KuweY5hbmdSx\nYqPKu18LqVNOKm2tuDXirAYZ87tBiBoX4+hZkPa7hyoXFWQJ6llUd7n8iQR1\n5Tzqjy9nMVNGXlcpxZDWsn3cjsHQ5G4VNP3zRAPMXg7SvgjVCZZAOmjxg3/O\n1Uwg2n2aYLfozIWMHnt8r7404XRyy6WpFmZ7Ek6xbiwCuioMV6gfONvj0xB5\nn368htRIzEynd4OVa+xbzAzp+p+oUIjjsWk4s6ngms1dfm3hzL8kfANiFqq3\nqX6Xsi+gQ2P/0Fbm4tAOVNEjvS80u1wZuWxIsFKWlSZrwqp6tb68AB30m+k2\nEx7DE5mNcKnBVtRBQl2PIuLX5re5Caf5Er6aCNaG8MY57Qmr0HzOeIDMtOiv\n4m6MQyWlgOwrWheQpimS123C1NJL9zgj+SN0EVujvXlsXNVsNbfGlugh7po3\nKM/Y\r\n=WhhS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAI4XhaK3qnHqzy06zMmMRrBJiiKPQ+tihPLlcpaxzgsAiEA89Ci5Sx+PtSv8xLUAyhzFuORXVYTI/bbdSM/wyFoQag="}]},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.3.1_1597756392656_0.2286194697180406"},"_hasShrinkwrap":false,"deprecated":"Broken, use 0.3.2 instead"},"0.3.2":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/core":"^0.9.0","@opentelemetry/exporter-zipkin":"^0.9.0","@opentelemetry/node":"^0.9.0","@opentelemetry/plugin-dns":"^0.8.0","@opentelemetry/plugin-express":"^0.8.0","@opentelemetry/plugin-http":"^0.9.0","@opentelemetry/plugin-https":"^0.9.0","@opentelemetry/tracing":"^0.9.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"^26.0.7","@types/node":"^14.0.26","@typescript-eslint/eslint-plugin":"^3.7.0","@typescript-eslint/parser":"^3.7.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","jest":"^26.1.0","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.3.2","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.3.2","dist":{"shasum":"d7372be7b91148db73aabb480c9a9eba71992195","integrity":"sha512-vmZOI6GfZrXfqYr1BT2bDKcY1zf3GtXB2OkrnQq6ppjbnKJlDtHRP6vPpqCdoNiY/cDvWrwSZ3PVR6jrGgYnCQ==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.3.2.tgz","fileCount":24,"unpackedSize":510931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfO+7ICRA9TVsSAnZWagAAnRwP/3RMsxDxH/wfmy1xxWUI\nXLOhUTH8dam+z9Dj3niqBUj7L37YknIwhfIwdKC7c3NlFdsYwiUwuDamv9Mk\nS9/YIc+uUzLasa0wSmjuEybGze6UsRhKLYNBosL3XknxN35CvvaN16IbhhHf\nCXT4legyYMY4iZ+FIQup1ZfzljLQoB54kGvjrQKhSE16i4SkP8282oqD4bOh\n3ciYyoNtkYnPuYsa/F44pGLJFmQk4rpdBbsAOvfcE3d9padiC3zVUANGiRDm\n9GqqyGg69lN1o7nejeRnH/jAFSriwrwKp8a5GZNxmxIXPONeuGtOFQ+GHg02\nNIg5XewFsWVurMY2a0nJpvo1hiWkDFBNKV5iHjbaVTXyJKnsr/AjWI1glWaE\nl7D4eery2buWDdNyATz3WhhiWaZRlpwPOr0lFeoJjhUdWz1OtlorCSRcTAhu\nJbPHHFWE3SV0GV+LDoDyWDlvHogPvADqZeviviI06auNLae/F6eMxgFPCUwc\nCOrnLilWT4nrtbz7PLc07SyZtlv0//uQ0rMRIU8xVMbIUlYjrIDN7t+AIKRd\naA9WP4mxnEczwaGvVBWSUz5/45E+BMaP9dq40cpp9Yj3emBGeVXtPpUVL599\nJOebCz1gv9Cta+7Jebrz6GhCfpnhNkGpsQqKnbJ+IjqT1qW6feYZgsaSFQfo\n4UJg\r\n=37xe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDFpmlx/fyhj4WeWAiC8XzI9qoVGyzJeoHOU6reFvAqsAiA1dEHIzRDzEshCZwppc4YgGMQ7J4mC8QCjyynrgPOYHw=="}]},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.3.2_1597763271699_0.35275423363802205"},"_hasShrinkwrap":false,"deprecated":"export issue, use 0.3.3 instead"},"0.3.3":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/core":"^0.9.0","@opentelemetry/exporter-zipkin":"^0.9.0","@opentelemetry/node":"^0.9.0","@opentelemetry/plugin-dns":"^0.8.0","@opentelemetry/plugin-express":"^0.8.0","@opentelemetry/plugin-http":"^0.9.0","@opentelemetry/plugin-https":"^0.9.0","@opentelemetry/tracing":"^0.9.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"^26.0.7","@types/node":"^14.0.26","@typescript-eslint/eslint-plugin":"^3.7.0","@typescript-eslint/parser":"^3.7.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","jest":"^26.1.0","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.3.3","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.3.3","dist":{"shasum":"7343cf6943575f6efc2eff74e674de43a33a1244","integrity":"sha512-Ww2XR91o3zqeckZF12QtqegnKRrm1hRxFAOmwL9Xrj4Yd+/7W3bmMLlA8bTO0Yc16s0X4uIG5JhacIKmiSHSWQ==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.3.3.tgz","fileCount":24,"unpackedSize":511134,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPRRtCRA9TVsSAnZWagAAAewP/jPGcPlqD+a/xG/lYdbi\n2Z0ugW9W3TXJgKje/EMRZdTCuxGhUJxeOkvNEpRRUXVfdw7/jEZ+dB623EN1\nfZIn8xrtp2aY/TGgfBN6iXPKgIEBG8QKZl39enQmCtFLJOmcKTQl72tbQZEN\nKNCo2IVWYC2ULYNh3BDVEsnwVRK1IDa90FRjThWVikq8oN37Ber7FjVJ1wjj\nA/4DxVH0Cs4utQzJ5shkuLNwi4iNNLgzMjmfSw+LfMXRlesbwR8E2hWYh4TE\ndPu4QJ8Vyzi2JR9s+6SYoZaXjaXEZyxYC771q5t9a8kTYL6ffLDYRtaUXllG\nC74Ad9Hnkr0cbDDlWIaosg9zrpecb9S2PqypNwNBEAXdjitjFGmwcqCwKwUM\nhpSyOo+Jf+klvrY/IrQVcD2DfqkgAbcLvAv30HU9sYeMt2iGYHPM7l0zDDK+\nT6Mr1XW/yXZ1JIPpKk8T5JhvfcVq0xWpIb2kOLxiyFDuGdT0nq11e939xaE+\n0SDs3SQQCVk92eLxJUs4aJQzWbxq2BLPdFK8wGmIzPuLKlki9Xxf2DJvWsBL\n3cKenBQcK6srlM4ECF5uN6MH2YYLWx7JuoDOIOUQ1+QLCfE0YYoUfp8g8QzT\n96fagw4oCrU8PsdZlJJKl4KMb95MqxxhL0vdEf8LUE4abHpNcARt9xLxqVw8\nmVV/\r\n=+Rcv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFig9myxWabMDD7NSH5qgCZWxFqjbNVTW+e392HtsauBAiEA6b1BuuV1zvT+xpITH/tHUb3sv5HMSJO49HHNvaAsYa0="}]},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.3.3_1597838445315_0.7592766481258988"},"_hasShrinkwrap":false},"0.4.0":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/core":"^0.9.0","@opentelemetry/exporter-zipkin":"^0.9.0","@opentelemetry/node":"^0.9.0","@opentelemetry/plugin-dns":"^0.8.0","@opentelemetry/plugin-express":"^0.8.0","@opentelemetry/plugin-http":"^0.9.0","@opentelemetry/plugin-https":"^0.9.0","@opentelemetry/tracing":"^0.9.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"^26.0.7","@types/node":"^14.0.26","@typescript-eslint/eslint-plugin":"^3.7.0","@typescript-eslint/parser":"^3.7.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","jest":"^26.1.0","prettier":"^2.0.5","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.4.0","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.4.0","dist":{"shasum":"1d453d7ed7f705519f0b807ae2a4ab68ca0421eb","integrity":"sha512-6phwGNIVIw6XxQom/vtBO836tw55KqTRahvLTFxN1tp17USpmbBe5j7m/i3rEc6IVuKBYfky7TmFDhom5f5Gig==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.4.0.tgz","fileCount":24,"unpackedSize":514000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPnivCRA9TVsSAnZWagAAQ3MP/iujIr0U4r3ZIKufKm/W\naZtxSPfswiLQwOg0nqB1ZGBEzLm8jQSNRxtRDjwEKofiuRLGAVRPBV+9xBnu\nES8hOLPFvgG+grZyW88y4kCaMXO6vdA4sbrl/O8pYVXah2tEz/skv7Us8a80\n5DK3cXaUzRLag+9AXJHV/eTCIyhr77aXEeWtIbo70kNBlWS7U3thRDz82DK+\npuyELwH2t/S7zm/wMsgc4jlopL8g0WNK8uvsKf1gAZ00PGlOzOEZYxT4RW8u\nrixQJXrj6aE7hSY89/x2JlTaMVqoab6jhpNMKv89wxfEJPeNj4YYfKLJvbLu\n5e4pAM3jKzTEAwmFOaVWDGduGbcNPLYGee3Y7XTAMfWYxwdz52a6//o49II1\nKo1FHSvIVGIOmXHKmnpDyDMRaZrGxs1ymKcxLTmLQoumjkrZYYkKMh4X1ij7\nF19Bg79pDVtHPKvZaTt2Qp1i6nNvJ2Qf8HA+LJk2D8P+zOv9Rwv8KqLDC/hJ\nlw/TCWNfupAicMYk8wLK6oZ3YmCqBSKG2Y7NYtwIN43LAayWUHhgzFgMhzPR\nigclBhFFzdl+5HD2iTDs71IXFibH2Zpa7VHjWVBqhwrs8jAT0VVLyln3CGKl\nZ3dyRUfnsBo4lMD40VKNkRqef3VWm/riBMKofxISikRiB8yTuraxQVuwbcVW\nDIpv\r\n=LfvY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDk41RLeCjldJU04cq4Sur1p5IyLt4JTlSL6nQ8ZhKYuwIgbcDjgbJLmszWlh5PfFk8DBADjFfLPEBw8F44MVHvjBI="}]},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.4.0_1597929647212_0.3965768159269094"},"_hasShrinkwrap":false},"0.5.0":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/api":"0.14.0","@opentelemetry/context-async-hooks":"0.14.0","@opentelemetry/core":"0.14.0","@opentelemetry/exporter-collector":"0.14.0","@opentelemetry/exporter-zipkin":"0.14.0","@opentelemetry/node":"0.14.0","@opentelemetry/tracing":"0.14.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"26.0.19","@types/node":"14.14.14","@typescript-eslint/eslint-plugin":"4.11.0","@typescript-eslint/parser":"4.11.0","eslint":"7.16.0","eslint-config-prettier":"7.1.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.0","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.4.4","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.5.0","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.5.0","dist":{"shasum":"2420114f13b5f451aeaf568644dc71bfb1ce518c","integrity":"sha512-kZLASTAbB/GTM3gRVSbSe/11MIbatU3F4+SOwM3Dnv37yaogEz6mSLEnDj1vlfe1m4XbqBBl/LewiATvxOFjOw==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.5.0.tgz","fileCount":24,"unpackedSize":228276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5MVICRA9TVsSAnZWagAAMKYP/3vRgN2rkCJHLWzhIppL\nOsxqHjrqulcbFO5+v6FnY7f8ExDUqm31me20rtYvRqxkb6mCYoCUy41iezEr\ngULfjbKN5f9YD8+BfpyUjYR1sdry6V+fFKmf8hU4hP+PZ0u4uGieQKPbRTCM\nXuiRSsx2x0l+DtZTUSX64EM+GDTy65c79dgTZOVhaDMRZRpDlUJmwFgkAAA8\nH8C9+4k1N3WTYYrm+G5mLxCiXQRCc4ibXCl1x9P+AxN+2xu+yj39ozxEZEtH\n9ED6ihTnbfKXkJmt2s3G2XFjYqL2S3Wa516xGkYkw3+41KVHCwAqK8+AxI6W\nZOCEmHszCcn9h16goBlVS8WKZRuODSB9g08oJf8V+Ibr2+pM8H19telFjK21\nZAnv4FXFqLrepWZQ+XqibIWlqM1VsT/ClDY7VGJVw27VZqXdaJcocRz9nqJP\nsWQejYxYRGBr8ykKvGD1ULY9Bv8jNjzg0rYv+CBHG7F5klR4e66igUUN2zrf\nLhwi3AgbLQWnJAJgoSdYSx9YzPqpat9K0jaaS59dwJX88Ih7d9StwK0TsVQo\nRPXeAFq1US5eGfl6p6iYELXiqp6xL9j8CTOcun5qk7EzzbKx55SUYJbxaGMi\n3snC21C+DKIOCxiC+9bKz4GxDqgrGqHH9IhXeotb2FQPfRjNPUGkz2U+jnTK\nzADY\r\n=n4dZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC64kOAbeh4yA3tNEHz9AXNzlzyfaseD4Z1YbsfyfsoLwIhANeS/E0ksLIHMrIJRacPRusFVi3feaqirubvOwcNn1S6"}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.5.0_1608828232184_0.8491868935707705"},"_hasShrinkwrap":false},"0.5.1":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/api":"0.14.0","@opentelemetry/context-async-hooks":"0.14.0","@opentelemetry/core":"0.14.0","@opentelemetry/exporter-collector":"0.14.0","@opentelemetry/exporter-zipkin":"0.14.0","@opentelemetry/node":"0.14.0","@opentelemetry/tracing":"0.14.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"26.0.19","@types/node":"14.14.14","@typescript-eslint/eslint-plugin":"4.11.0","@typescript-eslint/parser":"4.11.0","eslint":"7.16.0","eslint-config-prettier":"7.1.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.0","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.4.4","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.5.1","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.5.1","dist":{"shasum":"72f92a7809791dceb238237aa3a36882284f4279","integrity":"sha512-mOSurcnmcRG7SgA/m273Ft6LV5SMgsMY1qI94LHvTUN7JNesstOzjH/7pbBvm5S2eR3VuyavcQNDbQzyOVaazg==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.5.1.tgz","fileCount":24,"unpackedSize":230681,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7NpGCRA9TVsSAnZWagAAHI8P/0DVzLyPAec6z600xqA1\nHzKlFAfptlph2m0oiRBYcQDDyRU39VWkXKsn+Z2tl6zL13d5ZNvHv7ND/zRp\n79MaLoSjhUadReZx+IWC8X032aI0B7xcxSGuUEKzSkxBwcZ2M8/f18Cp/Ewz\nldCverDH7hl2xIkHSyJ3+7VHxHK66oLNlU6SAB56PyRjhhUj7wlVBvp0exoy\nKvn16m+hJ8JxJc15+WbHiwQkHAni20o4CAlo8eFyS1jbdyA6wwMx/upGLjIX\no1eJVZ5QrBGtEsEWoSBL47MckTpjBMsWV2YkMSJAKedBOI+RNK/486vq8FAu\nCwkmbe+z2Ghaz6/LDQB+HRdc44JqHadHHtGCa97itHhybGN31sNRFR9yMk8E\nbMscAO5lNlRLUlZZryy5qecmjRT9aj/xjJXIvDT22I8nDPMmXMuLNqZkSMCW\n0ziaH0R+QSHYK43weA2n0/pwpfVa75JCX5R/tw/A579FUUEWe1TXJChtjVnX\n/31Fy6Z8hx6GlHJvMXNEVWue6giil85GOIO8WYdlivS8UMlatnW318SCzH+M\nbBxG+EM6hShR9yRclsl859API5mE4es/AIMaPGAWATpd5StxKQYWeL1JyxL5\nulm0kDCujImM2Bm5zbaFOev0OH6sW+49Xzm/udftg5Ugo5TIiF4tdgBMHa6o\n34Ha\r\n=t5L7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBuFbGP99vEbZfXojzKWJjnWBfF8kqwnBA+BGKnkxqO8AiEAt4WzsEy5tssXLzNC8FiB1lulkoqKIwen9Wo+AVl/GGI="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.5.1_1609357893981_0.9379138597666572"},"_hasShrinkwrap":false},"0.6.0":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/api":"0.14.0","@opentelemetry/context-async-hooks":"0.14.0","@opentelemetry/core":"0.14.0","@opentelemetry/exporter-collector":"0.14.0","@opentelemetry/exporter-zipkin":"0.14.0","@opentelemetry/node":"0.14.0","@opentelemetry/tracing":"0.14.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"26.0.19","@types/node":"14.14.14","@typescript-eslint/eslint-plugin":"4.11.0","@typescript-eslint/parser":"4.11.0","eslint":"7.16.0","eslint-config-prettier":"7.1.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.0","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.4.4","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.6.0","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.6.0","dist":{"shasum":"d22dff1dd2df730b77eac421cdf1f36432e5d6dd","integrity":"sha512-5uXvee/hE88u9hzJP5bLEy1K8ysmOBd74DvZNZJ51ry/GVZvZ2FtNlrKazFzAnB1p62paVzIFiHJa2/LVhd0pg==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.6.0.tgz","fileCount":24,"unpackedSize":228370,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7anyCRA9TVsSAnZWagAAUegP/RPsZSj83786GCKDJ8q5\n+bryDNd1a67qYLXtIlHQfrYcSbI56YRkZVybnUb8PG252Wle/mro9w+oeIo7\nhU0hiH/KHdyB5g9yR6YF+u4IRX9uvuviHC+UkO0oB/cfIaZxSqdbVb4mi2vo\n2fpJGNSR+RMJtaWvOHMl4cahIXnSgjlLogFnymIO6SUrBXu1NaW8uuskRr0k\n7kNYBNWyI3X4pO660acek3LdMB+SAYhcFAwmVuDT+sgLa3erw6roTSqZhphh\nTGQF7H9S2YzZeZXMCw4d+qs+bki/UtIDrhgM0chKoeI/MzgPI+URYrNnAsXp\nzKELQtwN/ZhJIC+KRe4iCv1JrdTeRlAvjUFyYu8i7vrhvzY8qumFvGCwIksO\n7BxvxfeNGWCJpMki3kWuKdPTkvHIWjZnPk4E/je58NIRTRwR9OFt3aSIwuMS\nwxy2VDvWd4XMKMtF+wp5ACA8lwT8LGMBJ74Pk7j2qVbeoa2oavsZhRfXSbTB\nLmEBzl3o4XqXj9aYDolq5QGoucrCniY4LPH6ujDPICwFrTq4lAluxN/CtDt5\nCQRL6bAfsNVh1/WY/LIv3ev3yPVtRbkVpimXtBQ+WyrxOlJTA7DRWL4/NEXU\n4+N1Gaps1njVOn202OUB/UMmhfNwevqbxvh8UqOoEeJfHcC4j2UCFCHQNKe6\nbpWk\r\n=Z+sx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB4dyZf25AC3+c6w8HkksTYEFaRteOwGRPdQWtCiEQpiAiBXzJBJL/WKz50kqVFw+kZxXNBcuAeZqtlYoTjRoaFLHg=="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.6.0_1609411057761_0.7034265254148715"},"_hasShrinkwrap":false},"0.6.1":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/api":"0.14.0","@opentelemetry/context-async-hooks":"0.14.0","@opentelemetry/core":"0.14.0","@opentelemetry/exporter-collector":"0.14.0","@opentelemetry/exporter-zipkin":"0.14.0","@opentelemetry/node":"0.14.0","@opentelemetry/tracing":"0.14.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"26.0.19","@types/node":"14.14.14","@typescript-eslint/eslint-plugin":"4.11.0","@typescript-eslint/parser":"4.11.0","eslint":"7.16.0","eslint-config-prettier":"7.1.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.0","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.4.4","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.6.1","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.6.1","dist":{"shasum":"6e2b07ee0d8d2d179e83c3ee96f15f1fbd520fd7","integrity":"sha512-yWuIAQ00JxzdoM6i7nv9Mt3nOCSvoLo0dvT5zPiyoZW9BfejC9fUp0oZ1xtwl+m3o8tOjSVvjqwnmRwPH7+yZQ==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.6.1.tgz","fileCount":24,"unpackedSize":389542,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf80z/CRA9TVsSAnZWagAAEZQP/j3+yOgpQxyVTWHpt3dT\ncI37JBhlSFeP4WaHWt7xU981MFQhwNql4WRP+3nirrQNMJP82fFU2YPAecPK\n2M3vIriLmOkp8dXqUZePxh9XIHPNThmGTwtsN8TuqPXGlkDcu36IqwcC6hzg\nMy79L/veeDx3+SFT0CaLe8dONPdOkKm+cPCtawuxU2mBw/tQGQw5RWYUw24u\nG5DeIIWGWa/fyfitWEEISAX0vgZ3BFwYOosQyk+DqYLqaA71/xzPDncNsrhi\nhcIh4TAdEJ+CbdYoxU6aqCNhdWCvl03Qr/p2VooAkNobRQK6eFEsWEkvHjPX\n9T0WhC8n5CsMmFkDqMR5pYvPnGdqrkT5xOstlLZ8Gtkq4IeO/61WOYJakckO\nLQ9mM62PCq3ceHZYcu7cKT4I/OU79OWki13oae3klT5jRNkE/xxvngJKEyUC\nArDdkxDQGvuE3GmJAW36UpDt49ZlFjUeDsN6sJbMV+dJHKf1EnMOtb7lZ2ML\n6t6ChIuiq3TbmDmzngOfqIrfTaKuMJQcAG9Q7O4x4WaqZ+gNztfDlyC6/g5t\n4gTj9Lhpnb+ZHyWdxfvpprt9abH4Pqt81iSFdUZLsl1w+6TY23ItbEzcn00J\nTV9pgnzY1lZ7qr2/IowdQVCriCLXaZYL6wI5bWoaWp801sxnmnz5ml6DAEMd\nttJF\r\n=cOWv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHeMzAOq8Cg5d8MZUnjdBjeB2U7Fh6Niwjl8uEGZINMjAiBVC6XGyxDfwDC/WqGrOop73BLEytSv0H8nxi0ZOQiSZw=="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.6.1_1609780479049_0.2479829916059939"},"_hasShrinkwrap":false},"0.6.2":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/api":"0.14.0","@opentelemetry/context-async-hooks":"0.14.0","@opentelemetry/core":"0.14.0","@opentelemetry/exporter-collector":"0.14.0","@opentelemetry/exporter-zipkin":"0.14.0","@opentelemetry/node":"0.14.0","@opentelemetry/plugin-http":"0.14.0","@opentelemetry/plugin-https":"0.14.0","@opentelemetry/tracing":"0.14.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"26.0.19","@types/node":"14.14.14","@typescript-eslint/eslint-plugin":"4.11.0","@typescript-eslint/parser":"4.11.0","eslint":"7.16.0","eslint-config-prettier":"7.1.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.0","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.4.4","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.6.2","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.6.2","dist":{"shasum":"8437a7e458298c9438b7d8ab579e0f74123ae122","integrity":"sha512-c6Kl85yL9F7/DP9wzI7Unenx1e3Y/cQOKROC1Pc71F7YLi1MVAlAKAJbcumCicSff/qkQ0LqnuDNLllciEKKhA==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.6.2.tgz","fileCount":24,"unpackedSize":225697,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9yL1CRA9TVsSAnZWagAAxcEP/22fMc7Y9ZlJRn7C+leT\nUTeCU+zzlQDLXJtW3ge7HIMLvfWge6JFX/A+fzf/fTY34xmcpu1sMwGD+5Wl\nTf9eAWgH93qahI/7n4mKjhsuMBFeVRcjTpB+ET8d7cabPDj3MbvBQaVpeXuP\n5NoY2rnBCwaTYs5fCxVZGnG2m7LEc2Fq0flzYK+1Chir2eSEJMs8jp9gWacn\nLdqhg5ARL8TFJOfA5u4z01SKh/rgNBhOl18pxZZj97BDgcjujZxwu8hJS5Xw\nqt3ABhWK3gnMTR/crZIuHx1cC6efWRAJ5lozeN29D8jJVt5Kwy++7H3kxRoy\neXDNfOIBhMYawIPncMXVaCyvBjxW+aiX5OXY9Pntr7SmW40gINTr7PyfR6kF\nAXvIKK0VIm9i+XMkfnVYy9XDmmFt4uF/ZjKXpuxUT1zkPgcAlcFdPBPPWd8S\nxBl2BtDsUvZW0/mbT5l6D3a0ggmOHEM73SJMxSHv3NCxfoGANxNho+MKyN/a\nVTxkz5nhOzus//vEjMRUZA4W007D0k+viwxB3Jf52RlnuTsOzy2WGSYnWfhX\nz75yqmrlWxfRMVdhXwTmTLWhzzrnsinFRBI3urxjmqEiVuHt3RjX9Y+ngtYE\nbSXH4E9nASmC8N1kGg0A4Q0Qnk1ZBbPo8kZUBPzzaNDs7cP93DDeEWWBgUgU\nlJcT\r\n=mPKu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZfQbEzBi585zk9gMdanwd3DPk0n4mLG5+Hbu8LshmaAiEAr8uwgkktO81W8IsyxOM+nWz0v97Nbd+tN52G4TbvX2I="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.6.2_1610031860827_0.5429309788180932"},"_hasShrinkwrap":false},"0.0.0-experimental-64b4cf2":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/api":"0.14.0","@opentelemetry/context-async-hooks":"0.14.0","@opentelemetry/core":"0.14.0","@opentelemetry/exporter-collector":"0.14.0","@opentelemetry/exporter-zipkin":"0.14.0","@opentelemetry/node":"0.14.0","@opentelemetry/plugin-http":"0.14.0","@opentelemetry/plugin-https":"0.14.0","@opentelemetry/tracing":"0.14.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"26.0.19","@types/node":"14.14.14","@typescript-eslint/eslint-plugin":"4.11.0","@typescript-eslint/parser":"4.11.0","eslint":"7.16.0","eslint-config-prettier":"7.1.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.0","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.4.4","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-64b4cf2","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, the easiest way is to initialize tracing in a separate file that is required using node’s (or ts-node's) -r option before application code runs.\n\nSo for instance, have a `tracing.ts` file with that content:\n\n```typescript\n// src/tracing.ts\nimport { startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  serviceName: \"serviceName\",\n  url: \"http://localhost:9411/api/v2/spans\",\n});\n```\n\nAnd start your server with `ts-node -r src/tracing.ts src/index.ts`.\n\nOnce you're done, your `index.ts` could get the Tracer with:\n\n```typescript\nimport { getTracer } from \"@fwl/tracing\";\n\nconst tracer = getTracer();\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-64b4cf2","dist":{"shasum":"dad912c503111634c80b6ad1bd4bba175794e9e4","integrity":"sha512-OvqM2YQqYD0mVvw5ump+cZgWWuDbWsltJH6v+cTiXS5/rCMtIecmnhB8ceTBF8eA0ozR3fe89mWrTG5os1x83g==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-64b4cf2.tgz","fileCount":24,"unpackedSize":268818,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/ua2CRA9TVsSAnZWagAAbVUP/1Im/Wfv1DD+Dqg2CxKE\n5PnNi/FgQu5iFoQ6T3f5ZXm4d96lt8/xBmtKk4D5Wd1aS4El0kOiA/ylHxZd\nM9zDaob/tIlx+8kndYQjeBHnmLuv9XJ3ZnItIE6fwcaAuA2Mgu9/srm6WLI1\nxdyc4u7Z7PuKQKU7wtWD4fTRAsJTmdPzFP/4TRlUOw/u6Ktx4g2+SpNEpXOh\nUhMQLo8gWqPlR9kYeggiMlJ0XrZs1eheI92wwNdpXJ7o/u6h3u18XMcWAb71\nDOW+DubH5d+YIez7YozpIyUbdARvF59t2naNiqLtMVFejpZ+vgYxDcfiXX7A\nf1EEfOG0HBeMfOz660mHzPc4xmBBVMGmtZoM6wDEyZVBnc8hlwjFgZ7nnvUP\nKrqo5FMHb8uLuUsu+cIJj1vZonH1bP5jCJE1lGU0n+yI26VU7fNPjghsebBL\nkFb51j5xISeCnGUZMop61pADeF0uTej2+BLhpV/20bk1whA2L0aNNfQC0CwQ\nJjhbJ+LppR/6uhM/t64DVqxJWTCG+GxIhyxSiffGtiwvPoDqtnooKuXpXCHr\nSoiQ+pwozvq7GAEfh0vT00GzJYwE70IEIo+hDDZ59B8YXGrWBYUj8u5Odyv7\nB8P1mHu3AYlPhUh2Y9fkoHNQ6J/D6Al7Dj5pvG5ZY8OpXEbbzH4HFwGBRfvZ\n9pP9\r\n=g7z+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIARhptW4/myB993vdvZ06ItXJI12Bn/LDqxHt5dlxLV0AiEA+wyN7ZV0JuigKflh4CcgSeCeIDcams1IWN9WqDCRXhs="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-64b4cf2_1610540725744_0.14015740998560666"},"_hasShrinkwrap":false,"deprecated":"this version has been deprecated"},"0.7.0":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/api":"0.14.0","@opentelemetry/context-async-hooks":"0.14.0","@opentelemetry/core":"0.14.0","@opentelemetry/exporter-collector":"0.14.0","@opentelemetry/exporter-zipkin":"0.14.0","@opentelemetry/node":"0.14.0","@opentelemetry/plugin-http":"0.14.0","@opentelemetry/plugin-https":"0.14.0","@opentelemetry/tracing":"0.14.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"26.0.19","@types/node":"14.14.14","@typescript-eslint/eslint-plugin":"4.11.0","@typescript-eslint/parser":"4.11.0","eslint":"7.16.0","eslint-config-prettier":"7.1.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.0","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.4.4","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.7.0","_id":"@fwl/tracing@0.7.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-cJU4zigJMvBU6g7fEdXA1CQZXwSscXvlpQG7f9fX91queo0rfmwzG/XSRPD6u3Y/+n9JJwpoo0YCAl69PSs3fQ==","shasum":"eb3896cafad163a125eadd44d01c0f4e82035b08","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.7.0.tgz","fileCount":20,"unpackedSize":269583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAFd8CRA9TVsSAnZWagAAv8IP/jfi/5ehLIA79yq8XlRc\nx9YylNF1jq0g55wsTNS0PYyhiuk2tutEbs0hDL0AkHlkQLFffacw5ugsvAd5\ngQRLizJSrZ6AZKXi5qLbiDigih5e3/kGc30xqkfAKEFYm8Ok6/AjwOmKP3AK\nwY4cpsyyE/NM3/9a7KTT1TypGELwSf8tqSUlrLK9OrksPw3bO+7tOGABUWT8\n//DaLYHmOzXYWA4RO9E1THwb4sFyIeXvmAkbCGa7jki0Kl/2xwK/QUYqnsSR\n5tmDR53VRoTbP4fpl3XSLAjh6DrAK4Ipo97xR5I6Ul3YZJwll8ASCMGwaHXy\ncRuWwShhdANf02kJC4jryjCWAaTVL6ZJq+0s1F4m8g1pQSWP/ddNASviZK9r\nTzE8x92kJx1cJ2pWstTXEIg1XUFM5K495xkk7oDsNTBEuQ8kefnrTDk/SmE5\nJvr2XCk+16UvtW8USR+k/xofToZ3aSJKr/C1NcSit2WhLNi1XHnlefiWmbBg\nd+dUf9euR8j3qSRac0Vs9A7UG/0lgBZxEzot8Q/sbWxLld9JijOgSVsvUn7k\nYNEuIAkBoWeERlou0y+O8iNA19YSlp/eLEMCWsDxJHRsS6Wz/iy3TKV68NKU\nyalb9RPQlPobGM7mPSv7e5lx1eJbJssaddAE/56PqWbRgV85KU1lYqv1iGly\n6gFR\r\n=fegk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICyDoGQzcAbr6wLZ2T4/LK+s+jivrFO7w5muXE83er2eAiA0frowCioh3nnKYR4MDP3+BoDOVxUBq2gbNQkQpbdyFA=="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.7.0_1610635132498_0.42104276497661064"},"_hasShrinkwrap":false},"0.0.0-experimental-6d4cdda":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/api":"0.14.0","@opentelemetry/context-async-hooks":"0.14.0","@opentelemetry/core":"0.14.0","@opentelemetry/exporter-collector":"0.14.0","@opentelemetry/exporter-zipkin":"0.14.0","@opentelemetry/node":"0.14.0","@opentelemetry/plugin-http":"0.14.0","@opentelemetry/plugin-https":"0.14.0","@opentelemetry/tracing":"0.14.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"26.0.19","@types/node":"14.14.14","@typescript-eslint/eslint-plugin":"4.11.0","@typescript-eslint/parser":"4.11.0","eslint":"7.16.0","eslint-config-prettier":"7.1.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.0","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.4.4","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-6d4cdda","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-6d4cdda","dist":{"shasum":"cef746690452ce5b8c03bfc8b1479ded6da2f6b9","integrity":"sha512-I70LYtk7/mt6bTkXUMDwWzcDgj+Xlj08Fa1hw3IOG1MpIlBH8DuiVmkVh8YyK+s9RH6P1rfNefR3dSEsgzKMwA==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-6d4cdda.tgz","fileCount":24,"unpackedSize":262779,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgF/XiCRA9TVsSAnZWagAAoAIP+gJcr6WKHefbp0ofSJp1\nzLMIHVS35xWbNnbOV9QdhW4UTSCYvZgRol2cknxXJB9exHUhG7Cjoi2OzfFv\nGWxhk1XCGT0CTAms4QR0lsgoQAz6Uq3UYJ9zyuC/45bPSsx8u/xhyBI+voG4\nJ9a53xBYsgcIMo1I40a/Gsm8a0/gnTpSYDai/IsWgb05JZqhP6ftfGLdNc92\nfmU25Mko5HBqGddzHgmnCB59bAsqUKfhoySZA+FxJzyZ2srNku1n4Uot4Z1f\nAYUujSs7Y31A9LNY685wMMiDEiciVY/vfZ9Es9O75liCaC+AtCgM1QiV9yJn\nU6tk74FQC0CwAb2kDfnqAFIvskk6gMptmBDUiIkk5wFOTjOox9VMPYwvU23K\njFNkJ9EeaAmelP00yG5p7mlYDdATTDd1LsyHSXv8TEUvf/YeSaRXF42pn8Fy\neqSYFznFNOfIQobxJNNkqozlCJi3XRJwLZWMWJT+IjzEiB2q05wJUqXKNACa\ne6/URUmoJd0VbVfzpWo+7fT1gkSgeOjgf3CIjvdSLK9bBXsgZSFpgrWyGVSd\nZ01++lVyxoOBbdUSicWrdIgMCCTUphxLUtnrzXC36Epuy11IwSSp2ZDUorUG\nZr4Ky7JYY2NlPmGGomQccdRjlzlYSwP+PsTjT/cC9/fVOxYnx0ecZFzXK6Zv\nrtKX\r\n=lbwA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaPywKUapOQyQXVn0XfLELxvK2cIfxwDxEIUitVTWGhAIhANx7cunqr+KsD8WViHop1BXsu4oM0+pTSMAbPebOp13K"}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-6d4cdda_1612183010175_0.27008577129720135"},"_hasShrinkwrap":false,"deprecated":"this version has been deprecated"},"0.0.0-experimental-9a2e321":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/api":"0.14.0","@opentelemetry/context-async-hooks":"0.14.0","@opentelemetry/core":"0.14.0","@opentelemetry/exporter-collector":"0.14.0","@opentelemetry/exporter-zipkin":"0.14.0","@opentelemetry/node":"0.14.0","@opentelemetry/plugin-http":"0.14.0","@opentelemetry/plugin-https":"0.14.0","@opentelemetry/tracing":"0.14.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"26.0.19","@types/node":"14.14.14","@typescript-eslint/eslint-plugin":"4.11.0","@typescript-eslint/parser":"4.11.0","eslint":"7.16.0","eslint-config-prettier":"7.1.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.0","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.4.4","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-9a2e321","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-9a2e321","dist":{"shasum":"922d7daafa9318f7dbc03a8567c009f953c1d4b0","integrity":"sha512-NZLWBvypMVDAFGu9l4FnHca3SdzuVWSmNZuKbFChxKi1vITMUusb77FKF394Hl11D6Utigs5SyrdBphKN4DjDA==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-9a2e321.tgz","fileCount":24,"unpackedSize":262850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgF/fgCRA9TVsSAnZWagAAs+4QAIrkPmrTyiqghw7fcXj3\n46pahpviAXWVBUDWSR9lpdQvWZsFP9SpS2r/1JFX2h2GjojftBQBVmZnSls4\nxQX567Q5Ky0lI6w+fJTe6lXDyZ0sLuX6RKLYJxm7/XVryqMlvKzNH/eHz+2M\nlus/SAqHSsAYd3IO2gwBZ//0pmO+460WIKoPBnzNV3q2SJu0rPhIyz1o5Gy4\nJ2adQb8/JwHLngSgVYpkRzd+1clyDzZif07+Zyq7IzYPACrpEGzlP4MtfBJ7\nKIC3vNz7suVD7nnrJnwnQZwP6FnAfS8iLL0hkbyzqA/E0b6M5e7b1zIyGOqP\nj7Lecdd/oKLzNAq+FTX/8NM/b2PltPyttuvjJaQn153dUy5VzSNlCGyRpxOL\nyL0WnqDrojWzmx+Xz1q87tqz4tvg4Ijpab0iXv3YoKb7vqNGxUhb44+/L00A\nFzopqmMlbpeZNtxyPR7C0+S+VG6iAOus2eBEysFOhuqie4eWN1Gm3eIA9apj\nbnkHDIp49YcArv+L1hDDT6u9KSShhK8ZenGOJi4/BxIdIuSbwRSol331lmn2\npb310zfbxJ5j1b4jwkHI9LuFFhKG4+/y3fxvcHgupmw6jFGjY8R0zxi3VOhj\n2YfKQYPeV+xUWjmC5KAgk3ujh/jlCk87L5978LbYtJ6F6To+ZyqTjdFyUvVt\nb+Mn\r\n=EB7s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfB1V1OHearnjcc+0TmrhXiNb6usuhGG1y6XGWoeNRuQIgG6gzhYWz2HmftDwBhnWsip28+F6GJs/yyoTr93iwyDU="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-9a2e321_1612183520369_0.22891243589308408"},"_hasShrinkwrap":false,"deprecated":"this version has been deprecated"},"0.8.0":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@opentelemetry/api":"0.14.0","@opentelemetry/context-async-hooks":"0.14.0","@opentelemetry/core":"0.14.0","@opentelemetry/exporter-collector":"0.14.0","@opentelemetry/exporter-zipkin":"0.14.0","@opentelemetry/node":"0.14.0","@opentelemetry/plugin-http":"0.14.0","@opentelemetry/plugin-https":"0.14.0","@opentelemetry/tracing":"0.14.0"},"devDependencies":{"@fewlines/eslint-config":"^3.0.0","@types/jest":"26.0.19","@types/node":"14.14.14","@typescript-eslint/eslint-plugin":"4.11.0","@typescript-eslint/parser":"4.11.0","eslint":"7.16.0","eslint-config-prettier":"7.1.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.0","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.4.4","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.8.0","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.8.0","dist":{"shasum":"6e92a65440afb5fd9969f3f15af85b3a4e40d102","integrity":"sha512-L6lShvl7NyZ3RVZeZeM2H/FjfpJQ06MbbOLLO3jAJoRgwIpKqAqGNXRiTVFduK8V3ck/hkKGJWaPPYimqlsSkw==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.8.0.tgz","fileCount":24,"unpackedSize":265913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHCheCRA9TVsSAnZWagAA1WgP/00T7rhnP57YECr+EB89\nlS7Dkw3UaixTXE16nT7GJKStTOJapu1lxkuirxivuJd5sJhH4KkWTAWcEWbA\njlckOGoL4+DFjj55h1q/Ea6ZAm/OaCy2rq/wk5INdApi0p7na7sEEvE/1Yeg\nNED5LTyHVRxa1IpQElF2ZofcHLnv8ynRCKBHIOJvdxJUISRLkzRZCW8jLqRN\nJ9u1oG9BHN5o8tWZwuM6mzd2w9Ir0RoVFsPEUQzJ82a+MYq44jbOe8AYCyjV\nlvVkY6XDgmqhX5SCP79TDVv9Tu+F2CD7c5DWJWZrYHlJuvyv97t/st7/FTKS\nca8YZN6irtjLlgT2gtzPVgbJOEDrBUjWQdoQCwX7bjyn627EAEC2d7BOXqPU\ngzbZgUSfXudZBAJJsy8qsJYTAJx3DEOfBVSJOA6DfrEhtjBn5nNZbPuW2gcX\nR8CvTwO8iFAce0NQltaYE7P0QYwY5Ag11yA4mCM8OR3iHuPvCwsnYOVTDPNG\nk0YTML19GmSj/Ri0zu89I6yVb41lwpaN8679HnQXAJkThaBjCyKMDzu+9v3m\n2lPAeDno71IyVm67iDvko83EGgRM1YYA2AGqNDvjiOSF7TXXhnFkCmT9CHPE\naidsbVR95ouQyNF4mJ0Zl5roPKa6R8NKyB/lEL7doNq5nnRiQTV7ftCOGfUn\ndZUX\r\n=rytB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDbFcsa2pjQBe4ZEw+h6natrEJo7Nr/nn+2FEWulqk4BAiEAnQ8zzIFBVnCXwB6zU2fbjRPTYJv9lO/Y85niW7NriwA="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.8.0_1612458078238_0.34898158473059815"},"_hasShrinkwrap":false},"0.8.1":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.1","@opentelemetry/api":"0.14.0","@opentelemetry/context-async-hooks":"0.14.0","@opentelemetry/core":"0.14.0","@opentelemetry/exporter-collector":"0.14.0","@opentelemetry/exporter-zipkin":"0.14.0","@opentelemetry/node":"0.14.0","@opentelemetry/plugin-http":"0.14.0","@opentelemetry/plugin-https":"0.14.0","@opentelemetry/tracing":"0.14.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.0","@types/jest":"26.0.20","@types/node":"14.14.25","@typescript-eslint/eslint-plugin":"4.14.2","@typescript-eslint/parser":"4.14.2","eslint":"7.19.0","eslint-config-prettier":"7.2.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.1","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.5.0","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.8.1","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.8.1","dist":{"shasum":"cf617b9834eac54f30502e10f7d5319f76b0a3fc","integrity":"sha512-DYwDD0fXfv6HhDiW1R0zZku5gqf9BUGx/lDRB+Q/N/dpUBOteemMn9Ji6s3Y0Gn3qXykduxQTT1dV07sZVkcag==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.8.1.tgz","fileCount":24,"unpackedSize":267047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIQhWCRA9TVsSAnZWagAAvdQP/R7qoYalL2cRd+nV0x01\nbtZm1vIdmXVscym5n7GBl0l3NE7HO7hJosFLfFwL6Ox25nLpFynEeLFfLBxL\nBtBCqvjAopZdXKexsCT5I8JNRphwIp7go+AMMWZozblEXcfaaJv1f9yTV+/r\nyweuCuiAfHiMSKiSr+dY09lztHTsE8aVDZMzbxH/gNRFO2wuvMvq8DtulxXc\nkaKp6PSqlOwCKaq99dEb0Mik3QaQbp5nOZbpN2dI/1klGo0LQhtzQgcY9gbY\ndS4uPRWE6XuWyT0SB0KZPlLNK70fcmOAuyyUvZ9W41W2vc+K9q07Vm0rMaLu\nyWmnFroQBtdcS829jZMNnqidgsEwEOpOKH+cVmZROluEZBlWl7npkJqryESx\neLSgdzCLTGwjyj+f9CcT+/kcxmWwi4bZTQrrFqiDso3Y8/SvrZOdEK0q095o\n2qeu5H0CrV7KBNc5/B6p1j0CpdKA7ehyipTYIMDrmiWFmageERIssUMbB15l\nzeeccfeOrxU6XEr0xLRoI67fCcaQfcvmgnnZnkYXnr4+ZLlCw/mM9AEi8HyZ\ngECRHm3Rj3KnbKyGRcb8v+Bghqgm6adW4tPp/3WEzAijPUc78OudWlIKRl5l\nPMhD5Nhy+F1xb2BGTaNgkYEpdv78wjSqpRxLPRwqRnuDfLcqsHXJJWrKGyi2\nWvID\r\n=jxgQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7M5bSI9otM8HEl1FP9gCej4PanqgoGSTYyJ4AucWw0gIhAMDxngCTl9wjvfcuMtmxfDiP6skquerFWS2hO7x2oBqM"}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.8.1_1612777557580_0.7339938490751712"},"_hasShrinkwrap":false},"0.0.0-experimental-4e732dc":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.1","@opentelemetry/api":"0.16.0","@opentelemetry/context-async-hooks":"0.16.0","@opentelemetry/core":"0.16.0","@opentelemetry/exporter-collector":"0.16.0","@opentelemetry/exporter-zipkin":"0.16.0","@opentelemetry/node":"0.16.0","@opentelemetry/plugin-http":"0.16.0","@opentelemetry/plugin-https":"0.16.0","@opentelemetry/tracing":"0.16.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.0","@types/jest":"26.0.20","@types/node":"14.14.25","@typescript-eslint/eslint-plugin":"4.14.2","@typescript-eslint/parser":"4.14.2","eslint":"7.19.0","eslint-config-prettier":"7.2.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.1","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.5.0","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-4e732dc","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-4e732dc","dist":{"shasum":"703be30fd42fa81fc8b06ffee51c352bb3d7829a","integrity":"sha512-Pi0b1fZsZMkZGb64KqMt3ckTNkaCvuQARrW2LtAjmVvFmX7haAzixFgc2MSEAQNyrO0j+CSxvJIjPpnUsFSNxg==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-4e732dc.tgz","fileCount":24,"unpackedSize":267750,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIpvqCRA9TVsSAnZWagAAk1YP/Rl0alpEWU5j/IzOvl4a\nXVmyQMuDovVghushm5vU/FxeJGpS2i6WfsvVvaWm2JHlV2y8ewYux6IAZtS0\ngJYmC00/qEtg6Qfx5pcN5FGUb7IqVxL05FoX8+NCdj7PIogPL8Y2blYA8DXk\nJeQTb11G6+VNch44hIsmTmTKpCe7O/3K+Juz2aVIUyQGMuhnuSI64J64evXV\nJAqntHGr3UO1D6logX8LDUi7+RbgS7uqJYoySsYvGyFqj47it3YiSgJj+Oif\nIiO5Dve4Y55Cxu0NluliZCQFXGraEGDHYvewHCA9mtvyD9ViFZlZI2cpPmGm\nhl55JxXgyKrE77NgFfA4UdOk+JqvoN/MgVPqvu0HgoG/3UgHo5imktr430LG\n453yGr9RT070cGuEzKzOn+D8Dluwvkx2SiJIWXBPIEf2cO+AdijK0P13QnpI\nqUO5ZEDRuTt17gp78K6u2MOoEOZe4XZuB4aWdv8t82btbj0/CS7mlipNmP3d\nGqBjHEiztwN4Fv+9HidttMoUCkRXM0VSTTVHrqVD9NXYsxM2ibyOHakWEcnn\nv6E0BSTR8nE3+ZSRykEIy08DFMpwpqK4FRbL2BRIwz4dups4sXV34PreHIap\nbAYLPD7VJ5bIvyxR1kClr2mKu81KhMuHiKYSy0BKow+G/Ml8VybHby5NLK7V\nQwVz\r\n=3qcv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7M6mKqn0zw9nspgmjn4jjp6UNCT8Roa8VRZP6myyYOgIgVZiaaQMf58cIPnsfob/a2iVDDVof+diFHS50TVRfudc="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-4e732dc_1612880874508_0.9208084088175317"},"_hasShrinkwrap":false,"deprecated":"This version has been deprecated"},"0.9.0":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.1","@opentelemetry/api":"0.16.0","@opentelemetry/context-async-hooks":"0.16.0","@opentelemetry/core":"0.16.0","@opentelemetry/exporter-collector":"0.16.0","@opentelemetry/exporter-zipkin":"0.16.0","@opentelemetry/node":"0.16.0","@opentelemetry/plugin-http":"0.16.0","@opentelemetry/plugin-https":"0.16.0","@opentelemetry/tracing":"0.16.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.0","@types/jest":"26.0.20","@types/node":"14.14.25","@typescript-eslint/eslint-plugin":"4.14.2","@typescript-eslint/parser":"4.14.2","eslint":"7.19.0","eslint-config-prettier":"7.2.0","eslint-plugin-import":"2.22.1","eslint-plugin-prettier":"3.3.1","jest":"26.6.3","prettier":"2.2.1","ts-jest":"26.5.0","ts-node":"9.1.1","typescript":"4.1.3"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.9.0","_id":"@fwl/tracing@0.9.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-A5xE9I1z3gNDebEDWB/fl15WZDcQsj2LHqTy/RJBoJfSigAuc0uw7Atz9uuS6r4buRX6urezLgcBVWBDZTMCdw==","shasum":"e8e5c0b77f0728680d7de0fa79db70805a42a9ca","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.9.0.tgz","fileCount":20,"unpackedSize":267888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIqFHCRA9TVsSAnZWagAAUW0QAIAvsdz8vz1hHQkoP7tP\n/3Pi5oUiNmloNCmTwJK3HTNIHkrTrLkkSDLcKMk+oTJ+XwYpFe+QHSABCOyx\nAjuwJD7GnMdA9lRP6lGaRaWvhpkMc2rWE+QiyaempTAnBX/fc3l6Yq1rsryP\nBzfK4grpAhuhyG0V3zeHvyO/Qj4L+15e+2iME5G/Msv0akzOkURIpFWuCoA+\n/t1quZOjd/gdvdbCTUMeNuitWi+LI/n+d/qNjhn5jdFAin5cn9MHRFr/yQ3N\nAsGoH20T6FO8f3ErGzYcaZ6wlI7vkX2YQy6K6pFejC7EzrbCDBhWAMNY1o6v\nFkvRHEdrq0QIKJCc5sCo2RMwQ61qmfKIKHaq/hmgoG8HM/xAnudiZ0EmIRrD\nzFxgPpe/Jeu+m4/77GbkPvewoQevAB2IWgSLfnwJ+GwitMzMRStCcXaFNU0s\n8KszuLzsXpIHWCEhaTO1WLD9cmJlmXkgfIt2KerxTUMlFXXiUP4VX9bKl7eG\naRQ/TgVwUUpk1s9bKAJ2ySZ/tmOEYyJ97bTlt3zcBoNlpegzToMB6AGoZtq5\niBoAmSphayCIuS/21VZYJx3yhv/wYRr6WUZMP3D2aVvukzGygejjWGJiR7dX\nHXI8LuC5uK7p4wVf6OkVyBi8XwTFg84nR0aFyHeK2QtCejEKPMHx/eELbTjK\nTidy\r\n=/y8y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKueTVOV+zZqGxmVRLi5H/dKp8vKMhAAzZmFZUeu+B+wIhAIlF8gKa3Gn4qQEfiyhcGd9iHCf5m9vREzxMnzaDi78r"}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.9.0_1612882247175_0.3288461391761506"},"_hasShrinkwrap":false},"0.0.0-experimental-ab9f3e6":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.17.0","@opentelemetry/context-async-hooks":"0.17.0","@opentelemetry/core":"0.17.0","@opentelemetry/exporter-collector":"0.17.0","@opentelemetry/exporter-zipkin":"0.17.0","@opentelemetry/node":"0.17.0","@opentelemetry/plugin-http":"0.17.0","@opentelemetry/plugin-https":"0.17.0","@opentelemetry/tracing":"0.17.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"26.6.3","prettier":"2.3.0","ts-jest":"26.5.6","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-ab9f3e6","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-ab9f3e6","dist":{"shasum":"c31eeb8ff55a0e9f12c115337f1b67306c7a0506","integrity":"sha512-m+oPqyGhhELSUFjZnoilTQLlnWEZc2VN31P5v3/QaoYfEShWgF7J9IRjg67uFroe5/yMqBD24KWxRFn9LuUxMA==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-ab9f3e6.tgz","fileCount":24,"unpackedSize":270354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrQ7fCRA9TVsSAnZWagAAJQ4QAIv1Lv5s3Brz3cmtY0CA\nlv8UHCfAT2mdoOweR7RJtQ+cEuQHl2NBQBJrnMGH3b/bh6OMNb2w1Gcj0n30\nt5LG0NxsHBcOkJAAV/Sk0QpE4WLcDmTB7cyjG2+HxjrjilIGfrqwFjYggyQ9\niRKj74bEK2swTZAr7zTugTcUX9yREKhKsC+1XKiqwhpl/vPBCb2r0SO0Hv0l\nj/GPEqDVjkd/83wfGB3oh6IBommxOPzPLH195NJkQ4v19viOYyyFZFKWgVj1\nz/WzYXHEfg07JdlOG10ooYiu/liomqYSqHnCoq64tS/OGlePP7tF/KFR9jnX\nsvQN1OQvxbdDoJY0vzwvZ3uyX00mw5RnsoImQLaECE0OKTXAfKvkvjeCedeT\n2NyoGX+6NAMRUtATJ056z5dTVJ3uD6dH93V2Ug9cuCs3mT7EnFnXHfZ65Txr\nDuE6wImBXht+eSFj0vQtBF481D3byHuIwayRJ97A1iCtu6R+1xnU2p5HEHYT\nV0swn9AuAJQnqpbr2+PMB3AsbTSsyaXxPcSC/EywumwnI2ElxqPc8shHHCie\nWi0vHxKGNyv47Bg5wXmliquGF1b3cjCL6PBU9tkeUzHOhw1U20A1kg3nK6KR\nFIZbcHGrm+2yk4S9TLn8Eql2zCRIIvwZpY7QpHCYETebvPOHT0zM1Xl3CNqa\n2h1x\r\n=AxIN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZPEQxKKPhIp60Q+IRr77cG0DiuVy/iSY4z7+DMomsjQIgKnrStlZxkRMIAiQt+QyV3W/c96TWMMH/c0iLA1IC0DU="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-ab9f3e6_1621954271025_0.7422199305777208"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-6df0bd1":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.18.0","@opentelemetry/context-async-hooks":"0.19.0","@opentelemetry/core":"0.17.0","@opentelemetry/exporter-collector":"0.19.0","@opentelemetry/exporter-zipkin":"0.19.0","@opentelemetry/node":"0.17.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.17.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"26.6.3","prettier":"2.3.0","ts-jest":"26.5.6","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-6df0bd1","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-6df0bd1","dist":{"shasum":"50da264bfc08f8e0f2acb136d16a08657aae7ff3","integrity":"sha512-QGQrllwnPcaP4ZVMYc0n0XWe3ilQFsTFuLlr2fyu3HR82oJfriunpacLleWyw4CHibqOSxYexRPpPcE61rXh3w==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-6df0bd1.tgz","fileCount":24,"unpackedSize":408351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrjD5CRA9TVsSAnZWagAAB9sQAIlvAvJGzzbhcZ5FG6l+\n3OD9gvhTqudkMyCV/CGNRM5z7yj4OMgIi67vM3jdx2iJKEHLaGh1mb/0TKS5\n63dQjoMnyVvwVVjWmsUclQo5ZcV4t9Ebojt/FP3VEOLNuupQIpuFjRnE5WWB\nGJMpLIRNl4g8F8/bAMjqBj7tywG6/Ng1NseW38FEAAa5THDGY/tZSixl8MKF\nGfpRQ7vYaiGYNi0KZp4LDT7bIx/rEH1Hz3Q3913fnFSWxD7lM7ShFghA2Ciu\n9ImQV3nYAgrswg+pGtNQP4CrsB6BHOaNIbW8KBrklX0w0q+2rTWo1N5mVm7a\nL05Vq+7i0cF0LZwy8TKxaqJdm1w2Q16ZCPBdjLo82D4FXTTlyk7OYLF/UH0D\nAJOeCDpGyT6GUws5EhVAKc9cwZcYOXuhXDfVHpr5xIq7WOgLQU8GOOtR+pHn\nLl1YGlTkFZVRZreLg6Hvyeq3LjzTv4vCVDFb/5GXcjQONCy+9Cvg+mkHl1aw\noDDkKieJMDFWZLp9DSDkr3vTil8Hj8rZ21YrE1mhdEn674vBOXxk6jEmHQtP\nd1WBvHOYm59vV1iS8yTmZb6VpoYxsneVXJpgMvFi6VHm6UVlygkG2p5Ur/xU\npBGTUYIPISrUy8i4N4h8SRSO1cQFJZLVbez5LuaC/ug0awCVSCjlCm2CPJN5\nO0f0\r\n=HMgK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrOfJD7Gps2Uc4NzcsCVK22LsJdPshhtw2uT+b4WTALwIgPJothPOEN5uaGWemPoBtxcaY166gnzV9l1WkyqcAf4A="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-6df0bd1_1622028537098_0.9054661605043728"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-fb17e8a":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.18.0","@opentelemetry/context-async-hooks":"0.19.0","@opentelemetry/core":"0.17.0","@opentelemetry/exporter-collector":"0.19.0","@opentelemetry/exporter-zipkin":"0.19.0","@opentelemetry/node":"0.17.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.17.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"26.6.3","prettier":"2.3.0","ts-jest":"26.5.6","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-fb17e8a","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-fb17e8a","dist":{"shasum":"208c4023a1531c23ee007042a1f4077983072682","integrity":"sha512-6nuz12gUcXpLd+kmJ0IY6JZgnv2NirgBRhPCqs7yD5VQh9+oET2G0Ai/dH8xe6MaDRRToqeh5uPT6r6LsKWTlQ==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-fb17e8a.tgz","fileCount":24,"unpackedSize":412022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrjJuCRA9TVsSAnZWagAANL8P/2q78uhJe4zOxlKCxYX2\nckd79HeCoXH5sh7u1jNuOEytZclihEYJQF5ikp6c8G1Gocmoqx4CxN3gUR//\nDqMEX1yhrKn3gmhHJknISJE0tnPpYBSxKXzXJTCzgIOex3RK0x6GKkyGjxux\nAz+b/W/+HJqTNzm41uyfJn90BRSf/wiT0XpwXULJ6w+5BHxI7Ij7sCdsF728\ntVcMdRz7eWfOmIi1TkT+cSjoD7ZYNJP/pQmFpYL+ywoSS0bpYO2zc84mKCxj\ntjrCE4Uz/YgIEWuWWqDsLv5twQFYF0gyxP2gyyx3iz6vt9YvwgucQRpRI2y8\nMJDUTFvBEfKs/+hBT2m4aIUXY1Fu3MmE4bhFDu7gAfHjboynyjwGYKHz/Mnu\n03dwgy8rIt0ntUlOpH4ZNwMctUHiJNU/tTFh2ghw4ORylYAD++LtVaQsPQys\nPbHAWekuVXS+LEBcZCk9QiFgCQxRPzaZ6a7x5o76hhOviwpiFu4yRJdErdTF\nMfGQgMMm6RkICRFQ631BVo8OogZBi8iLxStG517kfY9FIxfw1t0pN8rGEJYI\nBKxNTuLZgOHJUpHtIFZ+5yUdb87WKM261OtSW961q+4rB9qGkRC3ZulG6pUj\nR5eHaiCLZqeA6chEgH0zuHr6uvzdBUVV7lIM01RWpbUcH+2CqNNtlOuYOvd+\n0QH1\r\n=Rguv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHwdgx8ny/dhYeHhn3eOZ5iFuFnx1W7ccXzBIbaDyFzyAiEA/fQ/Z8UiaVWQ2Hlnv5hhpwxw64iuy7fMHVEuY6dk9+U="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-fb17e8a_1622028909516_0.7894733908947231"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-ef5b6e1":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.18.0","@opentelemetry/context-async-hooks":"0.19.0","@opentelemetry/core":"0.19.0","@opentelemetry/exporter-collector":"0.19.0","@opentelemetry/exporter-zipkin":"0.19.0","@opentelemetry/node":"0.19.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.19.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"26.6.3","prettier":"2.3.0","ts-jest":"26.5.6","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-ef5b6e1","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-ef5b6e1","dist":{"shasum":"b753ac3733505a184f1b3b544ae59c6c2810f64d","integrity":"sha512-vCVXnuCYpDA9c+LbZbcpeIAYTBjy2hI64OIVB7MC2p7O3wnIjYuHTX58ntgE90iTwMeeSHOwbJbrxaAt+nhdgw==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-ef5b6e1.tgz","fileCount":24,"unpackedSize":262982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrlSPCRA9TVsSAnZWagAASCgP/0BwiT7Fhdq46OMgwA92\nMs7hDpDINOtT54K0x6mqr8Ea7SrHaffIQeJaMMk15bQfx7FqmkLpO0QJNkFH\nciux3AUr+w9EJrh0KekEEKWg/SMIk2MCGZQCmymNaSYyn38QTkKl+NtXjWaw\nf9m3tVcLUGcywEkrxPJm6BMf3nX65mA3C+OLP1uwQ8pRXIVKctAnCcasyZT+\n5Uevyo3f6qc3YEw/GxsEPseT2BjFyz1zK6En38o5wXLrjf98Ii9wSwdztSwA\nfc3V371xrWdNIFXaaNa0wzN+fqMKwVpgaIIlKGekptEWIRt9WZNE3Xvmjdfq\nh5V10wcvi3jc6gUGwvY3pSHl5xx6DsUrMRviDRsc+o9mhfCAgrnLOAbSekbR\nKbtmbvzWX2Q0VvZ9AK/lVFP/MOCZghZHQtB7BT7Ma0WQy56H7AQ68VR9G8wJ\n2Oyywg0ytyZKSqfoR0TXEcpwNJJ+vxfCyaLbtTl7HM0FRIXdKkyT/PWZKky1\nQP4nd7F+cehw9dYk579Baq0b04RFM95A93Ct8MYJb2CHg5d4ulbKdy9zuqcL\nSqHacGL3YfadWfMTXICVSq7CV7FHq3QvfoTE09BBmA+3HvbF25iqi6bucHWh\nmT/SKbHooXXxQwN3H9RLKAFdQw8HFp304LPK/HwmqnU32Y6LEQbW5QsHZNtC\nZ2Oa\r\n=B3n9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFaoeDMhLVDiENwis+jbLzb3Dr+zofBXY9yIviz1I8DwIgXvH5cCyTzgJEmWCiEV/E3ehKuUmt+RsEcUDK8pp2+Lw="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-ef5b6e1_1622037646963_0.8820465185198414"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-0d950f9":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.18.0","@opentelemetry/context-async-hooks":"0.19.0","@opentelemetry/core":"0.19.0","@opentelemetry/exporter-collector":"0.19.0","@opentelemetry/exporter-zipkin":"0.19.0","@opentelemetry/node":"0.19.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.19.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"26.6.3","prettier":"2.3.0","ts-jest":"26.5.6","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-0d950f9","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-0d950f9","dist":{"shasum":"b06838201233d5718e146db2b68d3366a077c92b","integrity":"sha512-LWnbSZW4XJlYLOU5vcYzMgfvl6GaVPpuSiuMiqKucMySPwOZ5Z1xxaK5TdH0EGqWg8OyEmDH0otLUdZBabhdhQ==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-0d950f9.tgz","fileCount":24,"unpackedSize":260425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrmFaCRA9TVsSAnZWagAAz/AP/iFmmJqyTEU36/nH46JG\nav1CUsBraMU1lz2Qi8nO8HcnY3L8OF19JFZ/sxMB/ozJR4BQ+jjAUUD2y9xr\ngamcNxGCuKTrc+X9yAhNDqU+5XZwrwjbfyU3N+HLvNofTXowIgY/u023Ckg7\nZuTy1qveO5pTotChc/5/WxDGMRv21OoOyB0ljehIQF6aW+3GATEOnM4/arl3\neH0ukNnmLflnIMNKIbh8HSybULyDxxQeQzPbctRu5G40GwgFHbIuC66TMbTo\nHWyBns/UzJJZ9dBFegtWovKfyBYcGoWEYAKxCsFXZilI/yK9Ys34kK2WJ6UF\n2IPnfpIzDFkYJ0/KsS4rskyqRCBB5I1B+0X8vmgpZeebhHYwWDdUwF5/V2Qc\nqN5Le1mQDBNBN/K4XH6rwxaec9Qp90thNYSi61tqic/opb9TSSPROWOmPQP4\nNA6GJRsmnfCAKxFlo96L5n3lfw3nC0v1oBeTO5LjU7QE5BTj12oLDZSiTL0v\njHa8zE/BM+tHq3aLJsu1uLjL0lKRRpmRF5r0YAAqbWl1dWOqoOAZB4sB56X/\nE9KucMuVDSXPAgF8BfJD6KIK3oPUNa/0v0h7ktSqfGpzkLckbKkBOcVX9FTZ\nUKJWxyjBAEEK7bjlXi0nC1BhJPMQZYXbEStsitWeYF7VxhM7z2entDzrIPnf\nMUH9\r\n=4DbC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnAjHBZ0atFkWcQAuyr1UgnnkWBGDZSu5ahvJl7gRUmAIgIbBXqt31fHiSSaD3KGziSTYjANrgRiZhfMoQjWX3QrM="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-0d950f9_1622040921600_0.07580106734292191"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-21768af":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.0-rc.3","@opentelemetry/context-async-hooks":"0.19.0","@opentelemetry/core":"0.19.0","@opentelemetry/exporter-collector":"0.19.0","@opentelemetry/exporter-zipkin":"0.19.0","@opentelemetry/node":"0.19.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.19.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"26.6.3","prettier":"2.3.0","ts-jest":"26.5.6","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-21768af","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-21768af","dist":{"shasum":"2cd216c2a7d23ea236a6b5db1dd78b04cea288e5","integrity":"sha512-um0d3usdIvXeWThM8ZjlgXIw6JWaQ6DzWadpnpr52gqjPSA0UNc9FxuYv5mhHAU7T7kt0m4EiIsLI8n3R0NEoA==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-21768af.tgz","fileCount":24,"unpackedSize":311155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrmlrCRA9TVsSAnZWagAAbHEP/1xK5bmTzgXBsTVibsh0\ntXeaLFTQpybRvO/NxN1smKqM2HZY6V0iFGaSGldDGYFAzfF6m+9pWyfWPiHI\nwg7cRW1rc+C7mObsTZ6IFB20OZ3soJUY+eOU7N+atd+5EyfZoOXCJxBRBkX1\n0gvdTNj3tkyFKEZkODrYkrl9C1sn3Gr7Ett2qY4DYi33YTXpiZFrwIWh9DEU\n8atWoRqlD1zl5lUlc0rvKISJYtwTTIus9qivjfb+ePgdU9TFBkcSJwBMNyb+\nlp8U4etkTka77VnfOJmH4oCzOz7/uJyd1m0WJn5Wpi8Dha/beEcYhIs5IdzR\nUeH2Mt8WkPvr5vc95xB+z+bk6JRF/tznGBzUAy3K1Q7hdyLKRivLxdAjyDpn\nPo0kVWvhvb0PQnNLddFLZfgpWvfZJwy5MC8MK+6gGRkdSAaXIdR64XiXoC4P\nQlGku/bukNl6IVTUd/xLLXB3TPzKW3WaoJQQhaKPO/e88IbdRifmzAt7aglN\n6wFbV6GgTHm9rL2+5iOZd97enX2grobFB/yRQmuaAhZN2Ydvj63S7vTzpaF+\nT2zXic0h+ltiOXM9zwxzvjB23SXL8Ly7ssEF4nTGQniUEqb+xc3ie3wj5I4Q\nEgO+wFMhrNRIKsGaaE/dllqn4cbPvl6GmVU8N7WG+Gvxe8dSQa1hHd853Vz6\nUKYA\r\n=IMtv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCY0zPAWREJoMEG8CI3eOfKYqk7LD6lBYMdwELvaPjNdAIhAKH+DZBSLaSF1ot5i429e5fjYWyH5XwN5S/eQhfdUXmQ"}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-21768af_1622042987515_0.4052558285533032"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-21cd9c3":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.0-rc.3","@opentelemetry/context-async-hooks":"0.19.0","@opentelemetry/core":"0.19.0","@opentelemetry/exporter-collector":"0.19.0","@opentelemetry/exporter-zipkin":"0.19.0","@opentelemetry/node":"0.19.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.19.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-21cd9c3","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-21cd9c3","dist":{"shasum":"94408d0eaecda5ae16ac8183fc5caa159a3e9f6b","integrity":"sha512-LmEReVaSWRRcfpVvaHrEW0p7ayjYAX2oIIPm76ONLaVlznrtwmVvlLghxIM2vNfyhsWCcw0SET0+nyUGRsgR4w==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-21cd9c3.tgz","fileCount":24,"unpackedSize":311158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr1KTCRA9TVsSAnZWagAAKQsQAIQ5btEPVAdSGMpC0GmA\n8Z9O4Y/OsjHlLczYGfFc+F8XPyrh4f3z1m3PYpxhXOpoCcAxvp8u/masM4IM\nDcj2bU9GzCYRXeXDvdKTtEO52j3mdwcD5MHP0HHXMxW6PmYUBjuVRAk7Eq7Z\n+93fUKyUQ8uClfN0jI/JjTArDCTj7htRhRTRXOTYh81c5Qx8U1gz++qNYi6k\nsORS24ojQjrZmRFVaCo55KBcuj8Lv5tCqpfsZxxFZIcFVNOGalc69bghhaYJ\nlHUvsI/WWHfFWYG79LfH0r0nQJQv6yX1MtDwkuiqJpLuptuSnUvIDncN2Di6\nvFU5h+vTV8LaSkbF9Pf6FBPpyGaVSHCRXKH/6VEVPozYmdiPgIphUIoocSB9\nLtv2wn5Kxku63hW0g9bzgGkcKMa1lptFXvQNhDv372KpVYPMrBS4B6OOG3fh\n8FxO07o36w8mCEaPGCB1NAxFV5OMyUDMKxWvs0Yj5i7fGZZYkKOCYt8lzpy2\nry0r5yTjsI+DKyD71nB051e8OF4DCPlOQCFg+s/9tPcuPJTq6y9+JvAc+mNz\noE+REWn5AMoKhslJNljGLK56AV273NTPA1chQjqyKWHs4cQ00dOe1xmr2S3U\n9Qh7slPSvEIScywoJ5Csw25B2pW9iAahrN3hqfspVEuTc07j2I7eakcr2u5j\nSHea\r\n=QQXx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5Llf8jA6lwESB/hhbuT26UC17LDs9OisA2Nec37CXVgIgPyRehtkeseOhaiCgWHsHH+qzREBbHW1oGz6Mdq5pesU="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-21cd9c3_1622102675082_0.9893026723424849"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.10.0":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.0-rc.3","@opentelemetry/context-async-hooks":"0.19.0","@opentelemetry/core":"0.19.0","@opentelemetry/exporter-collector":"0.19.0","@opentelemetry/exporter-zipkin":"0.19.0","@opentelemetry/node":"0.19.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.19.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.10.0","_id":"@fwl/tracing@0.10.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zJWO8nrDuEFu6j3YS64NIvMgEJunFrTC7sHOe5CDfZpp7Pcatntbu5f8r8RFvs+sRmR9EdXVV+U4vEUegnMBjw==","shasum":"cd8e36ff11a9b891d0f650c3e36aa13aa7ace173","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.10.0.tgz","fileCount":20,"unpackedSize":311138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr1UnCRA9TVsSAnZWagAANAQP/1N8SaTuJgNjZl64HsGL\n7E8sKpXBTGOyTcFUgqb2DnyXjdnlxMv53BjnxFmZHnUlcbU4nlwFOxT3+lcU\nrhxD+z7UQRIihlMFzc8OF+b42V42/2jf6qCyRKzfRgC3hTvewEFCZfrpt3YQ\n2Vpib6SAZF18po/T2L2K9FomfDKLC6ogsqmaz+ZJVeXVFM7mjyRss9WRMVwu\nnRu4Y5tt0JCGClUNKCo9gVjErql85lNKBtd4F2I/Kz7tpbzqqHCC7pB5JqMt\nJrm4GIZx0XJZnjSpMNx/3zW9FhWkcmTKrgRil+Dhcka30NY8iNE1rZqpSFR3\nMEICjZnmJfB6ZwtwhSAmZUE4WudH7xwvsx6RE2PLn/Xy1KaYWbX45adTN59d\n9jiDRRLa2hfuVNo0e9MkWTYWee6nnrewE7X7UHIH6Yskq1HiRDb7KfESdnVb\nOrRBpcZ/1qAKf0uZnbzAR01svW3RDgHJ4biBkEfVjBE4rM73L59NZoh7j0DK\nfyGiWLxCBkk2PPNBbMWHWO8BFFF7iemIPPcYhnwT0OD4K0555kOJSMvl6W4J\n6p+/wHXAGR8+dOu74Y8fSAUiTtgZ03DACa6UvjtO5UHn0uu3KBsPFb04SH0Y\npH+jYCv7fqOhJvMfjXU1K6oLuQ+fRr2Ky/xfZfUc7Lvwf1ftaBhR05zFLY3J\nEFlg\r\n=Hz/D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC0wAdrOJO9uCpaT5Qw7VWXQnDu5tZFUs0u0OCQ9gDW3AiEA6Lm29/UvlaTtUbfJFTDTxwrGS5IIXhL/HHrCiPuA2ug="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.10.0_1622103335289_0.5793821019919594"},"_hasShrinkwrap":false},"0.0.0-experimental-0af6405":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.0-rc.3","@opentelemetry/context-async-hooks":"0.19.0","@opentelemetry/core":"0.19.0","@opentelemetry/exporter-collector":"0.19.0","@opentelemetry/exporter-zipkin":"0.19.0","@opentelemetry/node":"0.19.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.19.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-0af6405","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-0af6405","dist":{"shasum":"38877362186658f043b65627e5e1f7794f0d3a38","integrity":"sha512-ba/0JZjDb5w4Sf5XWAYLbn5KsieQ60k3cmZD87m5EwOhEyU6UZLDIbdSaMM8PaN8hzfXdS1/0AotesH9UQcU1w==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-0af6405.tgz","fileCount":24,"unpackedSize":315255,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr5wjCRA9TVsSAnZWagAAYFIP/3bo5lW4KEbL3N0EH4LY\n/FKq6oa579QIYrM4pjS1Y7taf7bhKjA8mQAaOMvqbA1d4lTzfvwSxy5RBGLY\n2s7zUBGd0hSzu7YOZ1SXV5ujW2MZoL0v6IQKza0cSpHb7FIymDUUw6yec8wc\nyiDLCSbSb4nBwMgpJkKDNcof+jh5G+Vbnso3pTFgV9/Dqqr+Iyzgo1BGWmIY\nKsauG3cxfrq3Ggs/CTRUTkvkkeENXDxRiiprCV7zQISPAZ4vqqWXPveJvZ3P\ns9a+MulCBij/hsCDZ5goyfe0d+dhSDyE/IJEztK/aIMP1RV6Vr2z901TfLnR\neUHviYNAcNsYG8+S3hDGoqoSd9KC+4/uAPOoMPWctqfX5jW05nEnLXrRIsfE\njyYcHH0A67AcQJ/ECEhrJqMhQbjnORHkd9c5Bd5bE1P8af8wUiJXEQJfTEtO\nIStb94iQOrpUZ9YsJitdm2C3RX2J3hF8eXGdiTkbKkY73Aej+z91WEAzifPM\nAfV1ACifNhD5gXxo0fOBxK+FGkZqflc0h1Sc3Wrj6R8MHMmiGe1cdLilFgAB\nQvXgZMQjok2UasxvAmkweuyMOYX/Ayvrt+ddofAX2qBlNY5PDVNk89l1KrYc\nR4CIBBq7sg7CUicbrInLC5NbYivG7pGlokYryrrgKHbweE8YT2J6zTSEYQmC\nLU07\r\n=IJHH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICCYYyf1G8Z2KUi+dLnar0q7KNFYgJW8NBuJ3JcA17x2AiBPx0wvFPZxj/g7jiWgBD9L5MEsPnc394fMWxExMGMglQ=="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-0af6405_1622121507110_0.7567786150624143"},"_hasShrinkwrap":false,"deprecated":"Deprecated"},"0.10.1":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.0-rc.3","@opentelemetry/context-async-hooks":"0.19.0","@opentelemetry/core":"0.19.0","@opentelemetry/exporter-collector":"0.19.0","@opentelemetry/exporter-zipkin":"0.19.0","@opentelemetry/node":"0.19.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.19.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.10.1","_id":"@fwl/tracing@0.10.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-E7kBk+X9MvXb3FOFOPkNfnc8UeTc4jYr+/wNRWQQTeVfZ6U9bDfwNRuzY4DtKBp3aBU1sX5wZj6LcP7xJbOaUw==","shasum":"74a472017a637a13383d3b52b025216aa2f51263","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.10.1.tgz","fileCount":20,"unpackedSize":315856,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr7k3CRA9TVsSAnZWagAAhisP/iJqq9/riU0/hk1FRvib\ntktkxMBzlht3S0bX9gm0Zeq0nRX22lmoJT3oSTVDLQ/hpZerQ04nay/HeQ+i\n9oIV8hIGHDMF+mDcrZzql8sIafAi8mXEkPObw36v6z31D6fe20vCG2fRr5HQ\nb7GgHkfGxXq+Vi9PZ4G8j1ZlsQRz+8FcDvFt0YjFmiwlfAz9xIP8pKbipFfp\nk1gRtcMvSGXZKRQaawdGiSXzJQSxXvNSRKxSNa/IHsaZVJkh/j1arXnEUFhb\nqB1bN8w9sE/ciWzFx7Gd3xf4xt5Fx9WVQVUYgsE70PGg4PnzFPAW0gXDZKrE\nB9VSYtB4/vbHgboGSwFw8pvkzWB6hj+Mij/LDRgwuwNNZlFJoYj9Nnsu+hGV\nQMXlemvrq4t0JXYlYUW9fq22rWNWvz/vYG60tTvaiteNwBV/ccpLY2obttC8\njFH5s382kr9aBCzel2f10PlYclaEikPMovwGWRFni1khj87EC8vQC1oP5xGT\n5BRBddb6WZ5CrZ1v6hVammPOQKVdczVv7xUXcjw+RxdUsE+TTCdZzOQvxTQR\nujNOsRd92PB8Vtnm5vzAWRInMJouyVLFsBnI6MvEWDtKBW9jKmvERpyEBIvu\nncmIUK5xo48KEdZmu0DF1gEjG9f6dU1Lhe69M9cqWvbag2/0MSDkh84SpAat\n8XFb\r\n=bgVf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICogzFYsx+lNfKaD9osH68DYW+kGqQ+Ihq+AfIEp/iyJAiBlr5mPqgGg6dOvHLixbvFNZdQTkP12muq62ZkStuQ5xw=="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.10.1_1622128950638_0.40463569893284146"},"_hasShrinkwrap":false},"0.10.2":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.0-rc.3","@opentelemetry/context-async-hooks":"0.19.0","@opentelemetry/core":"0.19.0","@opentelemetry/exporter-collector":"0.19.0","@opentelemetry/exporter-zipkin":"0.19.0","@opentelemetry/node":"0.19.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.19.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.10.2","_id":"@fwl/tracing@0.10.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-YS/Tnj65WJ+r9B02lr+t4niI8OaAnz1TjCYzYWh5f4kyzgewUAdqu3tFhd2sdxUHip0a+MsdvetGideAkNz2nQ==","shasum":"1ac6aa2e5d4bb068c253ce3c6937922ed8adcbee","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.10.2.tgz","fileCount":20,"unpackedSize":272626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0LYrCRA9TVsSAnZWagAAAd0P/0KeqELRtUWe+zw9+mUq\nUyA8usy8/6U3Lm3YsnS9nkQL57LJ4cnPA6jyIhnFOc+ZxZRWXvpvsklBBZA+\nNPCqZsrrbPrtUtnAoeYfLpbRbO1rQQejWjWJ1uf9/NVIqfx+LS+0iI5o2iZp\nfX2OdiZke55iN43zg3rfOUQeqwdqpFioyFYix0Dyx4Yp/3Csum24AK6nNZx5\nPC7/P3GeMcXO6miJunOrc6DgyS66jk6uM5XtV4J3gpeFIkhFogEitlPiKVFU\nR7bydLrwNPOHjSxwjSwGRksRid5vQjNvvaeyUvPmNi92URuDghbQZSAl19Hq\njxx1BSeOVWqCZduVwXqgAFg1UKmqIv70vle6CZ4szjNKL3p9sVSBFl43sl2q\nn8YEFhFh1eOdAJDL2NpKRASlwy+0Q+uG9gjKRArg8xjTHt9IeL3wHilBQvPV\nDWP97ojs8D4MpvDz5+brE+YLHXlTcTh7rtgO30ghYDwaImusDj75pMvqAhad\nHqCpv34iusT9prnO5VLc0JTqjWKGVNRYuP5P8NvpL2EhCF3dd4CMu4UsiSGH\nh1GgreHSd1tdOPINsnL5ykN/mvi/XcrCd+EErKUYxeUB9Ao75bCEWUmng57H\nne6l7gxlVSQPFa0/SmtN9F/isiyDzwfSczUzUGKk/mY6M1OiFvPly2NaUt98\nbCBu\r\n=wFjn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFiNjZLdd8YhCneBSPC1uUpTnG5alIAggloM4tjl5XwxAiEAtdGxbb9lZB7GIQpsnbsAtJaTriPvZknN6Z8kMI1ncnM="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.10.2_1624290858484_0.5427408734859682"},"_hasShrinkwrap":false},"0.0.0-experimental-f81d203":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.20.0","@opentelemetry/context-async-hooks":"0.20.0","@opentelemetry/core":"0.20.0","@opentelemetry/exporter-collector":"0.20.0","@opentelemetry/exporter-zipkin":"0.20.0","@opentelemetry/node":"0.20.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.20.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-f81d203","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-f81d203","dist":{"shasum":"55cc3f487a7b1313c85f039534c01d3d9f728047","integrity":"sha512-4MnqsT2lxT3Gjfwob74SG2Ehr69Lwk9EY4nykvAc0bCp37Fe4FTmn44FzW30Edvsu8IYeSQrm1lAdv6/k84//g==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-f81d203.tgz","fileCount":24,"unpackedSize":305019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5cjpCRA9TVsSAnZWagAAhxIP/0qX+LsmgjJYVZDDcV5T\nLccjUUWUbMDqGCLi/ZCpJs8nMX15GYIa5ProJF697OSgidueKJnziVoBsI6P\n+ZkBkhkrYZEXVe8IEMOIqVaUDCSLsnpqbBNKbAN3SgfdfnARWRShsfzGBQtk\nevWv1XPuo3Uve1MpOPBNiEmUrnjLslM0Il9UTkeexq9gnNC1J6dzJ/XOo2bS\n5TBzHBdoFMG/K0S2ug9Hb1o+xcbtQ2O53TFaWrcV2a8JhbfyYjs1cLlUzyH8\nDhhUbbFT2NGWUG+gisuMFGpHF+ixO+ml6+fv+j7HfyBwVjZ7+uBpp+riQ3ga\nRQEHoiQKJ+oJ6IBAuo6sBacHwKAeUDWZEarT5D953gAl0z8M+7vD3sT+hwn+\nFrQcjhBcDJsUHH+SNaN8RSU50qbPv96Gg0vgfLaN7tSI0vxRPWTwWuIN44mW\nrgDPhM5+G4Kr44ALhIPiuu8f/pP6/p0V04KxxAQSgJoDFNHWwMZyF5vFSpsB\nyrEbNbgjgcMej/hJcZF+v+C3PaF3Bgvbzih33ZkNrudSuLq0C7rmIy2d/htW\nvMvbINjDbIbk3XTDXRS7hkx5Io/LDg791WYrjHhoqm8SHBaHCMl1j0lUD5Te\nqxybEW0/1siTgUwBF8Y1cDD/LIed6HDGICNPpIp4wS+daSS4Wa4bdHevkwd6\nHeJS\r\n=0a9Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC3+T+tNXnWzT/dnRhmjbzlv+NmN/N+rMORrfiyr9felAiBG3jGVPq8C6zuL+65fLiUGUziJqn6gSKIdFlw9e/RTOQ=="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-f81d203_1625671913385_0.4852576274094065"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-5c4c97a":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.20.0","@opentelemetry/context-async-hooks":"0.20.0","@opentelemetry/core":"0.20.0","@opentelemetry/exporter-collector":"0.20.0","@opentelemetry/exporter-zipkin":"0.20.0","@opentelemetry/node":"0.20.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/tracing":"0.20.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-5c4c97a","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-5c4c97a","dist":{"shasum":"23faeee65daf013a2b157fae8a184588dc479728","integrity":"sha512-cfgA6/dQslgS8U0OgeKbsTR2N6TK/PJaIzNOuoSViWtOtM2/wV6vWuoVdDAnb0MYIo0DKhYKAlMXAAHtGWAt7g==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-5c4c97a.tgz","fileCount":24,"unpackedSize":305019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6FBVCRA9TVsSAnZWagAAfc0P/isqrAP6rBHPivkT/m5w\n3Lm2vSBR9y3PKam9g2vXhXE6M7TdimCGuU//6t/LMCJlFD5zmX6+0rrvw45y\n+f9YmdfqfmQbdN2PXcDwUZ/ePRh/VLjTtX6BKYs8ZzIvKoMWBHqJu6DqNJNR\ntg4no0jREnkH94c7SLTMYDk+ZGdds4H5Uo0R2gvx2PO70i/cPiVmMCBsoCxe\nu14ZV7cJ7CqbWVGfdQqzd0t5cQHYTREDNmCttTiOEdg38vQXeLh7jWSftLCb\n96v9ndoAIr2bW5+bLturfzU405GUPDX7Ywj/lrdG65LwUGILCDiII4DYritU\nOqfvXQ+enFfBBqTB9pRTFvF/gEjeX2NW0yu+0F/E2gCP02lLi0piUh5cuF4m\nH68qf2xZ+7JnNBrPW4uugGLjGuvJa6BPWXLUC9R/WJChP+gWGXYiJEgWLMkQ\nVLxfrKgmixBTz/Z+SGJ9J5hopPYpeG4G/M07kWAr89O+EFgYEdt87eWxkUvk\nTTc/2i7d7ept/dz+8FNJuE0tCwV5n1LeKIqFaUCvkmJdK5tDrBkMCvgEAIiQ\nV5nzxyfHc/NoBt2v1zFdhdZ2tGPuvlBhBzYh3zGanVunI4Ba1CuTFwy6UfXa\npaovDGNUJoOqahTBNjwb6D2eh4g6EYIUAbGvj6EUEJAUPCHk2aJclpQksDGi\nm/l5\r\n=4oOX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLb2pGKiguUuzldUNiR1cqAB4GTEhAW5xDOjS2AjRpKQIgC79qHMY4RzlX0DOFVKyqad1iyjnFf18Ej+zxo1/7SWY="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-5c4c97a_1625837652998_0.07933075547857427"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-8e740a8":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.20.0","@opentelemetry/context-async-hooks":"0.20.0","@opentelemetry/core":"0.20.0","@opentelemetry/exporter-collector":"0.20.0","@opentelemetry/exporter-zipkin":"0.20.0","@opentelemetry/node":"0.20.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.20.0","@opentelemetry/semantic-conventions":"0.20.0","@opentelemetry/tracing":"0.20.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-8e740a8","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-8e740a8","dist":{"shasum":"d0fa8ab87e7302bd62a3e78e5d787f5cbc3e33ef","integrity":"sha512-we2A2HkAgrGo7y5XQuDqLOgaztGjb70UH+mg1HtbnFf6Y35pt53NdYTt5slXztIvdSIIHozsCUNE5GoqX1RmrA==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-8e740a8.tgz","fileCount":24,"unpackedSize":310864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6GpTCRA9TVsSAnZWagAALdgQAIOSSpohvoMegAyzJLss\nvm+cGmfjUdFplcJ+WzDrwoX8yWhEKG0+/VN98ni1E9xaJJU+/CqoM//c3d5D\nTTcytDUDC/nfjDsDpu5Ep26vHkZl96nrBIYeXZbiowIoUTk30tgbgkOpdKej\n8midgqSIMTBBkVFOVQ5YhbJhWii8YzTIhL5bqTFsjNR4eXxny/YdnPGCP78v\n1xTAAgjb1v2fI0RrxnV6o7RTmsNifUkCkSCO/UDwEozilYYzzE5dRRV5EtWh\nvtK2IPKAZ1Cf1FDP/yelCdd0xLu8Q1PEK4RpRmbWJ9K6TraVVa//RlFMMtJX\nYHqDqktAbbHyDib5seGQu+9Mz0jutG/7m4ygH71J9Og1wu6PHTscmrONYc7W\n9Jxp/tLc1ulJTTJZbwC06sEyhy70dJIuupdSbCMVj+onuTAulhXmUBW+C+WF\nnedI/j56Gkac2hfEbXxZSUALFvrJWWF797Y73z2GqpG5wEoGQ3a1k20CGX+2\n5EJ+su1rhPzcQ0ARFboQli19X6jGZIDgq3Za5oBK+OnKb807DThXoXZt/Qk9\nMYxZrCxrTnDbJVqQL978HtZTkBbmkQsrj5WNc9P8OfuMY6jRp9NQanCus6Qv\n2FmsFqtjdc6WnuqAgRSVtu76MOwzxbhYg8OKcCG3SBSH3qOaOLToDqapRXus\nY4cf\r\n=uD0s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFVSsgwHaJ1jOJ3FADhJhawqPpRzBNQVF5wZ9SOdunssAiEA0mJ/Sql1VHPOFWL6xHEF4Ib0eH4/sdYNbnGEQWn1YAs="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-8e740a8_1625844307237_0.9746287294623752"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-3f164c9":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.20.0","@opentelemetry/context-async-hooks":"0.20.0","@opentelemetry/core":"0.20.0","@opentelemetry/exporter-collector":"0.20.0","@opentelemetry/exporter-zipkin":"0.20.0","@opentelemetry/node":"0.20.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.20.0","@opentelemetry/semantic-conventions":"0.20.0","@opentelemetry/tracing":"0.20.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-3f164c9","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-3f164c9","dist":{"shasum":"8380dfeb024596f564edb0db5f59b94719e1f422","integrity":"sha512-S6nxkDObZF4e3JW1RWSGYOAlUWLM5b0m9TnH/uLRJGNGF596wwkYD2M1L0VHrKx/DAFEh7PaN9ZOykCmEX/Azg==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-3f164c9.tgz","fileCount":24,"unpackedSize":311775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6G96CRA9TVsSAnZWagAA96QP/RDFrw8Yosmpf65CYvl4\nXSkBYGkyrdRTMgh6F/qzloAkOOrYKa8OJHZLSYs2XKACnoMpi9zLe6yyKMm6\ntjS2d8rOrD6T+SkxuZWeD+08MS9vtKecT/MtCrhibAu9dQuq4eOqG7HFozVB\nIdjHwmmpTb3Oumpw3Hf3oJz4oZsXMHsbgn/F/enm5a6DugfGDzjEcSh5tt3F\nj2WN3+pOmUdtXxIpL1ylWxgfdFvLgxyitJeHwscNMMoYM50ajkAhSEOfZTBO\njbQonCuUn8yVy9CUxJ2Pi/aZe23eIpnD66epKKNoUXdgXIzIKRp9+ghb1/Sy\nE3rQmXa6n/0WL7Xd9EbOPBeDRclkurN0QRnzLAw4ms0vjHtjedgyciHqKLie\nmDSwbYqrzZbkxAKnx4p10sRSwYv/cP4NPQiRIkbBIVbIGkuggXnvUlSNwSbv\n9Y7VtZLjCN1WTcDwDFoyE3T1tyGvMIYWMTQhWj7s8drI0NAI2GVDbxa6/5hu\nkwUx0eaPGqmlQN37FICiIFX2G4N7YVe2CQoGgbmDkWkDQPhlDnrsZqEdtD2y\nbyXdfp5+lwc811nTkTEsIej3ryi21tscA8eQ1aLtr6WQP6BISQeWti51e95k\nrXRgoklzJRBHEedI1BQNBqIYzVn3A+wgkRHcjYxGDMUqe2Jt1FFFyjftuPSy\nTSif\r\n=umJA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA12Ju47IDASNAqUGTGhhrBYv7gqkXUCw7BpOJUZ8qwdAiEAsyJFAwCjRzMdoKS1g6ImFb4zWSmRm1dJI1jyQTiZJB4="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-3f164c9_1625845625796_0.5944125464950869"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-f91b8a5":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.21.0","@opentelemetry/context-async-hooks":"0.21.0","@opentelemetry/core":"0.21.0","@opentelemetry/exporter-collector":"0.21.0","@opentelemetry/exporter-zipkin":"0.21.0","@opentelemetry/node":"0.21.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.21.0","@opentelemetry/semantic-conventions":"0.21.0","@opentelemetry/tracing":"0.21.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-f91b8a5","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-f91b8a5","dist":{"shasum":"4c179b6408acaa06dc90a7ed4b526100e1e08634","integrity":"sha512-Dpu9hWiHIHjjtlk7r7/DP3YxD7iPTIjyljP6xsQO4xvB7ObJ0rzBvcHBo4RlVLPKNus5tx9TsbUT4fRJdMMe8A==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-f91b8a5.tgz","fileCount":24,"unpackedSize":329817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9Um+CRA9TVsSAnZWagAA6fAP/i+rtkgP763fGOG8Iz7A\nVTsle61HMMmXeHEkG/XudU68+8w3KkjyyKGgJPDPupNSkoAuLJgcjA0Egx93\ngncFfIbvY1Xhvlh9aCA/UpsiNLWXbtRpzaZ9h1UHpRqwC/Y2Gzx4fh/yAG1U\n+pcyRp6O4gGMm+UvC5swyW9RYd9uk10wKS5ZueGBYYHQZ5JNfCvkNx3g7nUk\n9bbFkwPLVmASq93GUmLROTsgTtsnoMAyDLKddJKIWIhftiBCq8es/Jp+Z/qH\nKN3mVBIJpBLnTQmPuju6wKnOSkhHMDnWohfHvNaD8Q4Tk2FF/YQKnvVie1yy\nNmQtJ+2GsO3nmpjWFWhIrsi8uL4wTtn/w/0+wB5yPRxmufpQlPFNS049aXiP\nysDKVMQ4/+LS0+mOidABNDlix1eE+3heq5VwvRhG/7OM8usFjrD9WORZ7FQU\nuDyAravoY/2kndNttGGY8fQwf3yMMEcgzURSxPL9F4YhQMlDVV/DckJWdkzN\nzI866UD4hiQr3hLcB07PyjjcS1DEd2fn/wawg8rPp0C3kJs/7HkN2XzWolXf\n3GG5Wvxu3C6PYrYOwxNxkRSAfQ9jB/A/tZiYykUD2fCJRRUXisWQOBzft3ic\n9btZxQ79YAHkR73q94R1WHbt86RgZbSx+HMh7Vi34FZDFRGCItbs0+H/pFT1\nMWWL\r\n=bo1+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmEm1Jt3TmsBRajAAjFRDunRXqsmpEz3hI0M3276+IPAiB6wQ0ia8l3rB5Tn1mg31ex7/NO7fFkr5+xMhjH56qdQw=="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-f91b8a5_1626687934630_0.07958964021120196"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-5b4af6e":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.20.0","@opentelemetry/context-async-hooks":"0.20.0","@opentelemetry/core":"0.20.0","@opentelemetry/exporter-collector":"0.20.0","@opentelemetry/exporter-zipkin":"0.20.0","@opentelemetry/node":"0.20.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.20.0","@opentelemetry/semantic-conventions":"0.20.0","@opentelemetry/tracing":"0.20.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-5b4af6e","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-5b4af6e","dist":{"shasum":"44281c95efdd379cacc5cc3f7cbcf9397caff4ab","integrity":"sha512-ZN8P30ZQ2ErP9wPYWE9il0/aaCt2e/aL64OO29eOtoPrNewva+YNPgWRKXcyOf3E0aFp72qAyMmi5ZKL9QQ6UQ==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-5b4af6e.tgz","fileCount":24,"unpackedSize":334487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9WbgCRA9TVsSAnZWagAAOsIP+gIJHqoDCLH2SiSltrmQ\nhbMS2IAnjjKpTxSTpY4bZDP0p22ZM9l8KoEG1ghtFYZskdwSd0wtt+wQrwQf\nUwx1eJW02+n1J1NTD8sFmDgEhEutzIysN2m/aY5hdCze18RTMHoxJW0ZUTvL\noWaRuiXQHDw0SmYnOGFgx+/rL2QeLgsTuiU60iz7VB4TmoCMpn6Mremc+teX\nIfsODT5rRhkw2051b1UTUwFleuyd50o1ADMjcwQCBB8pSQotqiwwM3v4l7Xa\n012ipsODxt+G33tAh/1fxMaRnvVhVj4thpmM9MmaPJMaGVZQAqC6v9OXyNif\nMdIegj16sZz2L7q69xkrctxLx4p/ps0bMBgpyIQ5IgGrDc+8khdzh6Vi5kUv\nmXtecX9Yq750BwFxYOEgLqwSakeqSUaM4wMJO4QJg66jCVRQwXVmy5rqTON0\noz3rwHuFyB3HHTdR7bQ1AhUDBWfE5WXuvyhJPUpR709l8vt8YL8p3/OXRC49\njZ+fDsPScKQFhcIXn0PJZGqle/IR/6BAicXD7E3D6HW6rFPtetcRgOrMzPJ5\nG1hrPJL33BGkaNl8cP6GCbALXkYWMFRnlcsqbi/9kzCfeDfbX+J4Jpg4LdYv\nEO0UUy1ZW4HKKbJ7RB3tC5bN6e8bYC2f2Ls1H1XzEldNoiNN1c6Wj952/BSA\n4GPu\r\n=YpHe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEnV3MBw2pA3MbcMXwmoYhMfXu+2AiuNkkffGzmN6shIAiASXcHz8M2/pre2rxPCw0PtU+vD6ql+AEYvcV/zLBmqLA=="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-5b4af6e_1626695392572_0.00016092499553854722"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-3e40e0a":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.20.0","@opentelemetry/context-async-hooks":"0.20.0","@opentelemetry/core":"0.20.0","@opentelemetry/exporter-collector":"0.20.0","@opentelemetry/exporter-zipkin":"0.20.0","@opentelemetry/node":"0.20.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.20.0","@opentelemetry/semantic-conventions":"0.20.0","@opentelemetry/tracing":"0.20.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-3e40e0a","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-3e40e0a","dist":{"shasum":"8e5ee764e32080ca3e5b43e6b8b55c3284b608c8","integrity":"sha512-WIMCAdO3EH7chhY2ixgRlgyp3looBVbN4oW+shdtvVHZfmzds+T3HA5mzWY/MHildzgjOSQs5lO4Lew+2hVn+w==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-3e40e0a.tgz","fileCount":24,"unpackedSize":334564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg991JCRA9TVsSAnZWagAArIcP/0xalRxJYrBrIvBr+L41\niWYqXaKhTwh7jYeARCn0CM+433B9m5YzPG7/ap/cL1F9JO44SfIaalk9AZ+T\njsROlSMhS04llLppmWfGvh4ZynZsOADb1lI4b2XNcSVcEwf+iWnvAwscOkzS\nJOy8kuNcwK9YWlJegj7o9NCH+2GN+AyJpOJQnI7xDIRwo0Td+OWvv2bz+aU8\nLyQv9An01GrNGGOZfUe4sYW4X5qeag+TQS0ptXqhjwcfa2tUJj8R8IdLG9wO\nzizxklQL8FZtjlmvsr0SXCqbgdvvDJIb1L1A/6ci5Tb/lpj0NGGErKUuk5q+\nGBAQ3bZlZ+dVW3Prn2YE/j4/h8f+8F49h3H/cuPQxUeKenTKhkcRvpkz9fNT\nYdeSoanPq8VTtOY13PGK3XGz2XX6B2dXahbs5QaLzSMl9bI+fRndGEX7NFyp\n1D0El6k8Q0qq/usXlKk5ZCHq/nTBRqFdfb4TYMc/5Fa3+ETPHGN88EzX84Qe\n7Ye0qwv2CMBc5SqYXGN2q6w34ztW8/h3sz0HbLgLwwHYAxgTLOv5Kj3T7qZH\nRxo64dktK/IGuCYY14aK9IjisBRswXR9GGI5OAk6Mgbynfve2W+aLl75JeF6\nB9o2VvO6Y5DsLJRd4byO7IAzgqMgUSgPGMERTF7WfOr8z4ZSr0aUa/Oxr2yZ\nccFI\r\n=6oip\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZUrqh75aGJqtcKdNM2QVgW7qjob3a/7+Qs7kvuxMjpAiAVpmcN3sgqHi4stoF4rcvOut9PXDvR0dy0uu1KQMIVig=="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-3e40e0a_1626856777299_0.3299135024505724"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-bc52d84":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.20.0","@opentelemetry/context-async-hooks":"0.20.0","@opentelemetry/core":"0.20.0","@opentelemetry/exporter-collector":"0.20.0","@opentelemetry/exporter-zipkin":"0.20.0","@opentelemetry/node":"0.20.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.20.0","@opentelemetry/semantic-conventions":"0.20.0","@opentelemetry/tracing":"0.20.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-bc52d84","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-bc52d84","dist":{"shasum":"c656b7ff437e740913220c48c29f0a0b9560b767","integrity":"sha512-ywox9q9V8XHVX188IrkanZ3s/jCNaRjOJKYJJCSMmiv3LrlHSKKGzw5PY4rowvEah1K/ADYnqptPm6Z0c2iI/g==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-bc52d84.tgz","fileCount":24,"unpackedSize":334579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9+D8CRA9TVsSAnZWagAApoUP/1bv5F/yaLatBHTQKydV\ns/16wNGp3aTaAUxTq1SLw0aMd205unZtadKU6koJnXZjBNFTMuzww/UXPpVi\nSqf3XF9NEB1Rebf4fyOjF0ueyWQa7BXGpe6QRev+ifsic9/lppU97utYsKkX\nGWU14A4LAGiis6L4n6wTGDum5RseyHhTN7djBb9bq8ca3UPcv6M9Zn7Pn1Th\nC7SSck6oo4tzVEUeNLIg7BL5PtArT1PAA76UFWib6M0G5+JFu6YMRUuesyxT\ndX9mE9fJyq/IwrAl5tFpAfiK+KrfaSH5KgvdWp3xgxXNXf26esakB8pPW4r2\nDenhbOycg6kn0el7tE44Jxfe+R+QI3Rbr9LMTeXhUPcisVKP1e8x+PvKXI1a\njtmGD1Sr6jFatt8pG4vND6aKldhPZboa4nb8GH5xx9Sr9oKiPvXG8RHp+mZH\nabQMDRfR0oN02E1UiIMx/7AJNxQx1bRv252bHIhFE5ggOv/QVMO2lZditmtY\nZrB1zIMbKnOBdDhc/2F1+bkMcI22GEdtouc589MCtHGYjs37sTUlNepEWTHW\n6B1ua8YJHnFhIBg6IRvMSQj5Yy2C9rxfq36IIrw6OXwF1/uwWS1R9/gDfM3R\n4gu5siKA4bVgtFyQjK/m6p6EdqHPcT76dYgQb0fAfWyHisk4ENHUkQw1XR8G\nlZYH\r\n=wxQC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBflvTngH1WBq4rcZxpy9KL65xHkGSwyCrw8io3eRZCuAiAalW0Vm0AynV2QpMTPVImHQm6zqiz7zpioxy1ysxqiMA=="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-bc52d84_1626857724002_0.8210340512434027"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-35f870f":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"0.21.0","@opentelemetry/context-async-hooks":"0.21.0","@opentelemetry/core":"0.21.0","@opentelemetry/exporter-collector":"0.21.0","@opentelemetry/exporter-zipkin":"0.21.0","@opentelemetry/node":"0.21.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.21.0","@opentelemetry/semantic-conventions":"0.21.0","@opentelemetry/tracing":"0.21.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-35f870f","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-35f870f","dist":{"shasum":"aff099f90b73ae4f4e0ba97ae3ecca357d674996","integrity":"sha512-6KtqDJxK4ALuFGAwquE8bkgFVslBZp3EWKyzJvti4GOfzuO40nGYhjTtqUFDIqVUP8vjDT7H66T/OaykhOmQEQ==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-35f870f.tgz","fileCount":24,"unpackedSize":329909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9+nRCRA9TVsSAnZWagAANtAP/0/6utYBW3UykqJuOA0n\nTOqGdzxCprz82lIO+w4rziHnpmMKse+9R9+HUH2zl4Aqhwx7uopDKP4oser6\nddJgAUD0oZqLdqKGpb+cmU3NRit3sW+tHt1ucFpwus88vDRHMxTAAUlGlZZn\nqkTOfWRfMxn7sZNdWKsAS/Z+E5yPyhgwnLLCyvl7uv4Hqyyai90+Gx6fJo9O\n53poIzWt3JKtH20UtWlHCa6PtaWSQCx9zE6zMplbn7POgnQ5l749j00THF60\n1eB6MwNNBMjUl+uvcxbmgu9NoHqwTbj+60kaYnVQV4g42DAgc/8iEiPicNuU\nNoMtzbj/P0ZSEFcgx4rf/fzlyXq7/5UWl9q9uEZlOfhWJXKtpWxwd7LLTTCz\nltf6RYPURRc7f4ddyHTRU8pxev18vSNnlieje2BFF38gPb/XLKrceVdKDCjT\nzq6VtX2Cq9L3iD1p0K5glNeKoWSff9Q1gGf7/WeXwv5hOSFYqlTB8HKH4z0K\nXY57/GmMuXNqScVjFltMy3e+e3PASKGh9r7Y49PMnB5jNaBhRxysbXbNfXF3\nulPPpmHnayzLPkbggve8rOu5TWKPVqmEvetuwj1I4MF+otaxBZYBXUuudptJ\nmPg6UnGSPgt985bjGMBJNEqKtyeLXJ0ynwNSnx/PRgjhrUG6KjfyF8eXBrUZ\nuwXG\r\n=+IN0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYtfWECoY6IFYO7tPVC5nrnyX0ZwgfORVTYswRNTr8ygIhAKGO74hQyC09LVOL2uW6nXYIK4GftOoJCVJFhW/bRo+6"}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-35f870f_1626859984845_0.5774212814774087"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-d1f6855":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.1","@opentelemetry/context-async-hooks":"0.22.0","@opentelemetry/core":"0.22.0","@opentelemetry/exporter-collector":"0.22.0","@opentelemetry/exporter-zipkin":"0.22.0","@opentelemetry/node":"0.22.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.22.0","@opentelemetry/semantic-conventions":"0.22.0","@opentelemetry/tracing":"0.22.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-d1f6855","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-d1f6855","dist":{"shasum":"e35820f7f1735f8909ff86cee8df3027fd756ede","integrity":"sha512-lQDgLToTE/Zp7olyUf37Oe7JPl6skxZUq+9oO12aUw3/dyYf/wBpI+iq+8gNtVVNGdMoSQLIhkcUmrBQ+cTEoQ==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-d1f6855.tgz","fileCount":24,"unpackedSize":277453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9/KnCRA9TVsSAnZWagAAOWUP/As/kKnpsgOsi8QG9bxB\nbnf9TjIeStcIRv0c28RecD6AqeFdfx0rTyTWVS5xaRVzV2JXFsFgy++LYtfg\nP8AJC9/ADQhs8qjOoPPuhA9ENLhtFvf6OydhGNEgAab+n+57am8Q6opPkzD9\nZOWpE08fu69SqGQbPeNo7htqIYy/Kc7OVshfbXtpk3qWR13+Riom8sfsz0Ob\nCqSZJRqA8Et5Cpy6JDXgvgSQ7713g4mZzqw6VVVozPy0b3b4x0M8Yg53fhny\njnDnXc0Jg2/piiVLQ49enEjenmQB+6J60fxcoY2PSYxJkdRfa0mSKO6fNxGm\nMNss7uMJy5nhBvLb9Vs1Peb8uzubyiQRAvtKzIQxmr9BHUiQD7zFOyFpQxYF\nFtS4/hEzyL+92f4hiGbYRu97xDDljtGU/brlbuYYsJEZt8hkJKrpWa/zvEuk\nmHzm46eGWGfbdx9HpLPVLO3eOfdkx9HKU/EWgtvY6HlQcamCL1SucxItk7dE\n06UmVu0tIEeDOTZdXBsFlKP5VRKbUChYKo+yYL5mlXok74lb9UoireFDuKH3\n/CuIKA95P1Uyhu4c4t55WBQtIYOpykkAJk6RnFtmDZJcO754XtsYJu8eGxXV\n0QvS0mu+HXLG6VehNzWVrGiGFDJwPnm7syUVz63di4wRrzzlAfM6m8gyH03+\nQtpo\r\n=Gucc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF3h4Wsg199nl206CJn1RAyz3VvP4lbUmNnNnfc56O1mAiEAh3DBiFKL/r0I+tux/j+XKiyOKDXuOYUcv5CQLoe2efo="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-d1f6855_1626862247661_0.4061887658235239"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-77ca84d":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.1","@opentelemetry/context-async-hooks":"0.23.0","@opentelemetry/core":"0.23.0","@opentelemetry/exporter-collector":"0.23.0","@opentelemetry/exporter-zipkin":"0.23.0","@opentelemetry/node":"0.23.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.23.0","@opentelemetry/semantic-conventions":"0.23.0","@opentelemetry/tracing":"0.23.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-77ca84d","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-77ca84d","dist":{"shasum":"74f5191f8ad91cb1396582ab3ead0752073e0299","integrity":"sha512-mD77tRTim6uOvtu4d+ViqZ824P4aCVFg5zy+hAteGFX+hy98vR3oqakZYC1LEG67HaDx+H3Ududmm6EIjdkojg==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-77ca84d.tgz","fileCount":24,"unpackedSize":277453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9/tsCRA9TVsSAnZWagAAiFsP/Rb35YM4m82jHSNAbVgq\no8WdYLxLiHD7p7SuSy3HH/vHb5mxg5cpztYH3T8/KEgSP0zAZGyvVldTCS6Y\nKg32qf5c9HAAdnRfLQWDOmUpnbFgJoNkK+4NxGYxiqhhw5N09JEpvxSehI10\nWkQFKP0zw5ZEfehNhC9ay5WlBL7nMuA+a86w75P6gppklAi1DOIe3p1m2j9q\nlu4UL40lbjEMNv1GF+RUH29bt0OSBVZlyeaSGTKNcV2Ph7KyPuEvq5f4d/4b\nZlCC1mW8ySBUe8/h39BG8XhuzB3zfQ+B512+cJ4YGEPdJga3LNcYskFUGfJc\nhVOCuYl/zhN4Hu5vEii+1Vnzwb0RtSsb9rlLvTDGGtgGBmrjeozAG7Y01Ekp\nbXuuhKmsvvgytnyIgaokQhBjWjeec9FIboAWtQD9P21s8boASJRQ+Z5wSvvJ\nGNxF2RrKbL7y3Lq+HroNXC7gksreYtuDMVvBHWIbT7znkXS/yKOegwjCaCvd\nsdUuvKAM3elj0zaI9f6rzUHH+xa7/PY1aUfTfllvlkJ4zAuw9dA48OY2IUp6\nddUB5Iuwurw7Gjay3/e63kbzvqrDiPU3b/MSBM4yI669JpPW8PLHpYrT7aG9\nHohimO9P1Ds8hVPkl7YtyEdBI5CRWybVPXymUwsKC9P9XCrKMGuMw62E3zC7\n2kKA\r\n=Z7Xn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbPKQwECdvG9yGhwKRBFqNorAUBKZzTSQfCHwjih1ChQIgEnnTs7GOB8euDM4IpLejiBcjzavxuYbCF1EL9uEKXHg="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-77ca84d_1626864491980_0.8289652093506639"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-015066d":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.1","@opentelemetry/context-async-hooks":"0.23.0","@opentelemetry/core":"0.23.0","@opentelemetry/exporter-collector":"0.23.0","@opentelemetry/exporter-zipkin":"0.23.0","@opentelemetry/node":"0.23.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.23.0","@opentelemetry/semantic-conventions":"0.23.0","@opentelemetry/tracing":"0.23.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.23","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.25.0","@typescript-eslint/parser":"4.25.0","eslint":"7.27.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.3","eslint-plugin-prettier":"3.4.0","jest":"27.0.1","prettier":"2.3.0","ts-jest":"27.0.0","ts-node":"10.0.0","typescript":"4.2.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-015066d","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n> Note that if you configure several exporters, the `serviceName` property that will be used to define the service name of all exporters will be the first one.\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-015066d","dist":{"shasum":"2be4f2afb9c7a5ca3a54fb9f7e62fd04e56e2991","integrity":"sha512-6VLmCB9bZQNVDT/Bh6pUh5rr6rXgVgIAqrZXWLhSnzV5kuSvGvEY9ZipI1CpEKW431qclPxHMMXESrKUVrvoBA==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-015066d.tgz","fileCount":24,"unpackedSize":278306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+A/WCRA9TVsSAnZWagAA9cIQAJPC7IXdu1zMe9ktzGMv\nLJE96qOOxmaOaXkZwNS23rtrJnXtK2/A1wfpa4/v3v3N6R13OcVjUnylrjrP\n8SozT/AS6b/dGSiWH4ziOUSo3nTsmVMRh9QtcGXFqe39pNBYBIF6Zv0JLkBB\nYYKFBZa1KRBHGJbsWY45m4g/RFQp+2IRBnQid2fUsXY8B/4zyoUug9/UNurC\nnFgaYuxAKYdK2dWA57VQfWwT/slkQjVzkDq6wAeIB1T/Q7nzX9GJjJSwsTkC\nEsB9Mg/RauqrZby2IrvebECinsu00h7clavRMmaW5I6MtWUbZlMtjGMEa1dc\nXgNoZVLic8+HIqxcTQMShcOabJsZ7dvva/IC8J/VVfnSFXjX2324v5yK0dm4\nZ6m2gQb1tOPHpzpwQMX+sY8JbFYpU8l9dV8H68WSJxfz9Oi5rO6Iv8IIcwbc\n0wg1Gsb8IXG1w/0NJFEva2pu3AqTmw1mUGKVYVEhvlV7CrIc5qRC8rlm+AmS\nOMeYyK5YzdjqAp8lovr4xZzcKfNnHWxQJ4vtdfhIqmkeRFJRHkpPyMClKd7P\nQ4A4jOvEo7Mz9RCjr/gAFX2Qzfr29J3a3VJGAGGF+37dGjQKZPpXPaSlLkV+\nURUvt9endLqRJpyQbOBYJdWSc2T7f3eiZ7kPBhkGWPCCZvwGdCtIkYmB42hB\nim4n\r\n=RS90\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICFd7d0R4ojTdFRc58EWWXCvkYqJEZQpXQWb7z1dYvyGAiBhbz/hGcqrR4uD2zSWzC/fdZJ1Arnj7GrJf1pr7yET1g=="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-015066d_1626869718734_0.9187258801926288"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-4ebbdd8":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.1","@opentelemetry/context-async-hooks":"0.23.0","@opentelemetry/core":"0.23.0","@opentelemetry/exporter-collector":"0.23.0","@opentelemetry/exporter-zipkin":"0.23.0","@opentelemetry/node":"0.23.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.23.0","@opentelemetry/semantic-conventions":"0.23.0","@opentelemetry/tracing":"0.23.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.24","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.28.4","@typescript-eslint/parser":"4.28.4","eslint":"7.31.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.4","eslint-plugin-prettier":"3.4.0","jest":"27.0.6","prettier":"2.3.2","ts-jest":"27.0.3","ts-node":"10.1.0","typescript":"4.3.5"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-4ebbdd8","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n> Note that if you configure several exporters, the `serviceName` property that will be used to define the service name of all exporters will be the first one.\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-4ebbdd8","dist":{"shasum":"48accfbb92ef179668b36396acc945db0ea47342","integrity":"sha512-M2QlPUNIOg1JS9tgfMn1tW3dXowZs0lddAxH7cgrloGBnuCcLDwfY7zNNb19B7hH36jjVJTdh1ydhSQ2Bt/VnQ==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-4ebbdd8.tgz","fileCount":24,"unpackedSize":89960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+uQOCRA9TVsSAnZWagAAlwYQAJ0TXWcs0dm7tnydrwgN\nL8/nO5tV35g2R7gRceWxvxkT4reWkmj1go80ZkFIuuPny3jMH7dE3R0Ez60p\n/+lofYVW5plOrKbm8x1L2tTyuEi4NJ2vzoV4miHlkgaIIcMcmlneVPapfnR4\ngZLaZi5JEDBjAC3gQ5WlqJ8vNjEOlvLIy3AFruf3P1n/cfuzjkeJm22vBJAJ\nZmbQ9ioTV5Fj+lAjxNEL4CWCTWX6tPSt08O+iU5RaIOtUpIppHTaVxu2MJQH\nt1OnHWXuU3YALH3VBiDBq0Bpy/30olvZqhTCxZX+G05qLasBYG960WzdpzhA\nGyOA41mKHYpiJXcgyFpZElO0dz3hxvcJUJFc+pnF8PvJeOPkVu6yDqr/S6Qz\nF6ME0ANzi77OclcS1IH9WikQUskZdMjAyS0ltihD/ABtrv+b1zV9l/W6Qdwy\npc5MEoDdaWhTLpR33ZB6/WezT95zyBP1/Ezo/CIMhwBypvqYMW6MzBW3mR58\nkXYfKsJhIGjsttdzX4KbcYD2NfQje90Bj+hMtJdgLzXZMAf53mz0wokwuu1C\nLNlPrk2HazGHtwhubxxLa9NIi13AoM3iX7cORUJP2YlKl14E9R0PtdTxNjkD\nA675bBfqRk3ZvqZsFjn/DllFPkE7v2E5uaQyZdeXsPaxj5w1L912vYtgrx+j\nRAqW\r\n=Zk9X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFMzS06RFDjpkTAIpb775P1iUnCtrAeFT938K332aNOQAiEAypRe6sCVivor/DAm1fycwLXoUvw1dMd09MIJICuy+WM="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-4ebbdd8_1627055117974_0.7634004996390236"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.10.3":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.1","@opentelemetry/context-async-hooks":"0.23.0","@opentelemetry/core":"0.23.0","@opentelemetry/exporter-collector":"0.23.0","@opentelemetry/exporter-zipkin":"0.23.0","@opentelemetry/node":"0.23.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.23.0","@opentelemetry/semantic-conventions":"0.23.0","@opentelemetry/tracing":"0.23.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.24","@types/node":"15.6.1","@typescript-eslint/eslint-plugin":"4.28.4","@typescript-eslint/parser":"4.28.4","eslint":"7.31.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.23.4","eslint-plugin-prettier":"3.4.0","jest":"27.0.6","prettier":"2.3.2","ts-jest":"27.0.3","ts-node":"10.1.0","typescript":"4.3.5"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.10.3","_id":"@fwl/tracing@0.10.3","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-5ffYsJOCWzYNaViu1mAl33X8EDCxamgJBPHufsDASxoFJjWD+WLTWUXZ6FbVmhrCFkpsetGsZyRbABaZnRpTyg==","shasum":"88152f33b343432e13b3dbe3db82a7d9e3e33df9","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.10.3.tgz","fileCount":20,"unpackedSize":89940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+ul3CRA9TVsSAnZWagAAVgIP/jL19C+J0s5arqrFlVQt\ndzUrry7lGbnFb0g/v87qJXG8h6xfkoqbn2Eo4oXmshzwK6vCxOujWes4ftj7\nzAlvga7IkaU6DQ6scDxQooWK0Op1fB2w5c/V/MQmcNCrnRsmJ0sQv3pdu3EI\neTpFCVqS3LM9STI69Wp3Os4PrqnpLGyNCnUL0pwOI2K/7Pei63LCbq/IjQMy\nJGeRdvAgAt99Fsczer4p8XR7nhPyVHCkTj/XcY8B2b4r/yPNlgiUE9WYdF6h\nRnr9gArRNcWMcUhBXxyeQSa9uYJY5zYk47LoX+eNy98GU+6PHrx5dbi9XO5I\n7F77LqslHG9P13DWr05JYu6Do/cy8Co/L3EM8Qbui0PRQAb6J6XKj41ZE8by\nQBJKwBa2jQVJRLML2FzBNQwzjJWsrV/SS1YVZu0PrJQlEW2xAVbGvjxFyPhU\neqGcz56lynvVl/II3VxhqNFpYid6G76C8cYDWSISMdL4DZZ01bUOgTMmArBO\nidswglTbWAVK9DKvknIsdFQyaU6GIggn1nOa0slshdZiqS1/Y8GF+NNfFoEf\n57vtLfiT4DIjWcair1gsZduIgt39AWPHtQ6KhSfdz+Miuh05LT0xS+ZZWoxd\nF8PWK4Cqj2NtKIB8rLgwzZw2MsENjtoKSGOMd0qqyPUxOnkcko9y811KGx1t\nChML\r\n=3DHL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlp4UNI3q9AcY7iJ5x+ICOoxOI4f9s2Oq668HRyVyDrQIgKLmxjp6Q7v+FfKUtoFYDxjUy8jBk4MW1jOewSpa68pw="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.10.3_1627056503298_0.2807114218279536"},"_hasShrinkwrap":false},"0.0.0-experimental-102e518":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.2","@opentelemetry/context-async-hooks":"0.25.0","@opentelemetry/core":"0.25.0","@opentelemetry/exporter-collector":"0.25.0","@opentelemetry/exporter-zipkin":"0.25.0","@opentelemetry/node":"0.24.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.25.0","@opentelemetry/semantic-conventions":"0.25.0","@opentelemetry/tracing":"0.24.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"27.0.1","@types/node":"16.7.2","@typescript-eslint/eslint-plugin":"4.29.3","@typescript-eslint/parser":"4.29.3","eslint":"7.32.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.24.2","eslint-plugin-prettier":"3.4.1","jest":"27.0.6","prettier":"2.3.2","ts-jest":"27.0.5","ts-node":"10.2.1","typescript":"4.3.5"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-102e518","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n> Note that if you configure several exporters, the `serviceName` property that will be used to define the service name of all exporters will be the first one.\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-102e518","dist":{"shasum":"a254b4a08bba775e8d9451b388003cc3bddf8607","integrity":"sha512-o3luirZmlhFHERDLShc5i5wuBKLLuS9nA6AfSoL4PjgYPIC6wzqnYfueRF2e0wwQz/XRji+9rUerMNl1DTMdBg==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-102e518.tgz","fileCount":24,"unpackedSize":112324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ3a/CRA9TVsSAnZWagAASEEP/iXpRDSSIAtRbDCQP0Lr\noxI9lvVkeLaWW9vvYKSKvi1sDIA+qy3kaXot1+Fsfhrd4swL9E+98MYB/gMX\nIItA05ZHO1tOhgoqYdW3swMpB17o3BE9dz6nnTx/Nd4vSkkmhdLpMSWfmIA0\nivxMXIP/VDWvZ20JNxOnZMTy3Iq8oE2wg9yT5qisCa+6AUf0BpeTLdBzj3f3\n+XIiHyDbVhk4+rm5bCn9GHDQt7wjW+0Z7L1GgZqwqkZLrEL3tkQ8GtaoByOh\nvTIq/q8qnBofag7gcDD8ymJjhu/JuTOx7TgeafIJ8sNYDi2Lka/G+pyf1O/2\ntk8L9UmbKXq7u+pJe4CIxDgCufVuE2yf148IVVIpKW6GepJPmvwf7x8x44jJ\naS/DLLWxv3QS0sjDBcx5aM7BmE7c6J0RAF4Xcu13g8mVozThcFveu9mjMqfU\nvl9gOiDfkhj5+eSvp76STfFOzcyLs2qi30+sOJR/aob6l7+Yur6+7Enp2BOL\nhxO+1gH4dJ8JWtzcGCPq7C94/e4tV7kupitClyi8sTk903CgMPbqhvr8pZDq\njjTghpUUKR5e2MkWnC5H0OgLZT2WVONz0Axqg7Tywzj9/9vBpb8F1VBjyIGg\ndcTcm6zh2lou3U1cPWiTBAJA1YTbAMRiM0zR+/U6oi8dIcE70nYmktWoQHTu\nU2qv\r\n=0E/i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAoHa+umBE10SZ79tTnPZSkQLn9FEo5S/ZW5+oPHGRfFAiEAvqBKtnzmdCFsvaGyTuGiSWGyhklG83LqNszSw6WEXM0="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-102e518_1629976255822_0.38478453733312334"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.0.0-experimental-4c289e8":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.2","@opentelemetry/context-async-hooks":"0.25.0","@opentelemetry/core":"0.25.0","@opentelemetry/exporter-collector":"0.25.0","@opentelemetry/exporter-zipkin":"0.25.0","@opentelemetry/node":"0.24.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.25.0","@opentelemetry/semantic-conventions":"0.25.0","@opentelemetry/tracing":"0.24.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"26.0.24","@types/node":"16.7.2","@typescript-eslint/eslint-plugin":"4.29.3","@typescript-eslint/parser":"4.29.3","eslint":"7.32.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.24.2","eslint-plugin-prettier":"3.4.1","jest":"27.0.6","prettier":"2.3.2","ts-jest":"27.0.3","ts-node":"10.2.1","typescript":"4.3.5"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.0.0-experimental-4c289e8","readmeFilename":"README.md","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n> Note that if you configure several exporters, the `serviceName` property that will be used to define the service name of all exporters will be the first one.\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2020 Fewlines SAS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@fwl/tracing@0.0.0-experimental-4c289e8","dist":{"shasum":"18c6a5e2fba449e45f81f298735dd37a75ca9adb","integrity":"sha512-klbJ8ehWopyxlQjIyT4z1Crn8Yn2mV4SVqUIFbcCvOSEeaDhInb1zeBq9GC1PZCafW6kX+flOsuLKniIBU5mWA==","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.0.0-experimental-4c289e8.tgz","fileCount":24,"unpackedSize":113034,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ4PNCRA9TVsSAnZWagAAafQP/RJ6fSNykHu5BEwzixSw\nz3ABxCTHmDEHH9ChDSyNMEdghkrRiQMa2Oh5qS+zMcwjAbxE8lNT3ivrrJKw\nUbfQ/s884wukUWUgGJCIjjRfkZgRxhtfGlKjrxRxOHS/5jBND05DkquXpJ2U\nBaVCMnFegDt5OZHwVWF2JnkcY7i45l1MuWnZAw7GqCf2u27+lywfyq5cpqBk\nJ96IgLG3lhwjGiLFcEhnEs/W1qCWdTHqgmVtv2ywtwTjINKPfcJqy9Aqs+WM\nuEWKCgKpWONX69N3CsAf8UnozXCuiPXWbQZfJO2ncR3ZG0JxI36G1NTMpQiy\nJ0jGffyqIdw1XwSbP092Fl8OVMIezv2K2uwnZPeiXl54ZyzQ1RRfGsITH8R9\nvNE9hvzhFYI2B3GsrYpU1uLE5RTdAdNrN1sukGafHzKkVWAPXDac0e5tca2x\nZJG6pPmj3IP2/XsjNzgocc8xL5M9EOM5iatplnPT7U1+TLZ83YUN3BXAbxYN\nDfvQjGj8PNKJDim/ECvfmvCOEau0pWk9n+xZ831s8U2AswWmiTLPUH8SRmWt\nLac16oMhR0ETbIkEj7GX04c3ipc//Nu29sF5TQDdL+0XBMwGZ/oJX85idnEb\n+jLbE65yd4aKsz1wjfAKOM79vp6/tRE74N8IMTgWhV8f18RUtqMGPsnqFvLy\ngTVt\r\n=Ds2Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDapz8R3ZXpGJGRqTDPZ9M6pFVCQfltrBwoG8EV91/O0AiEA7h4fFyw575LS7XrOUbxM+PFRDvw/7f8PZVLB6iazXPY="}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.0.0-experimental-4c289e8_1629979597450_0.35883686916585944"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"0.10.4":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.2","@opentelemetry/context-async-hooks":"0.25.0","@opentelemetry/core":"0.25.0","@opentelemetry/exporter-collector":"0.25.0","@opentelemetry/exporter-zipkin":"0.25.0","@opentelemetry/node":"0.24.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.25.0","@opentelemetry/semantic-conventions":"0.25.0","@opentelemetry/tracing":"0.24.0"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"27.0.1","@types/node":"16.7.2","@typescript-eslint/eslint-plugin":"4.29.3","@typescript-eslint/parser":"4.29.3","eslint":"7.32.0","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.24.2","eslint-plugin-prettier":"3.4.1","jest":"27.0.6","prettier":"2.3.2","ts-jest":"27.0.5","ts-node":"10.2.1","typescript":"4.3.5"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.10.4","_id":"@fwl/tracing@0.10.4","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-remy8vAAAFdNF1kIifsGD6qmoIbnSyT9QdFz1jYwCkvCUUzv46Z7U7ku2uoMdlp8C4rDP4iFFkMIwu+2Sn2q1w==","shasum":"14b12ab75d15ed691bc55877ff146b93984d883b","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.10.4.tgz","fileCount":20,"unpackedSize":113194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ4i+CRA9TVsSAnZWagAAK2IP/RiK3uMnSckkpqUIUXOp\nrTiVOhoXxWv4U0BUNGMxOUQr9z/aVaAYZHH8q6jb5vCito3XiqfZKmdrjUdy\n0SBNgKkTx1gIHPUDJOtjf/1Tu7Olz/hl3ZyOSqwme/UNKEJbTV3tsM0mm7Db\njhuhES8VPX/bSeNsM+A4M7dZzx57UlEaFAJfQyg+CRY0aFwVstJuF/AYAnwI\nCp2djf+R5rMbJ2q4u3vxGk7NSfuB3eRFJPU/gXDN2Q9JP2WZICw0mXNaRwEo\n7stTbnOdUwgmAB4BHvIMk4ocsbDKtP7RHGM4zZ10bPoA+6fmHn1q2jnjqiMJ\nFlaG1O6o5skN1XJriEYbw6U0+LJiKfnmxasyDQt+qkBbzePIe5h7WtUZ/6Qe\ndDFkdXdUpu8FwKFtQI4iWVwRYs0OcySGSTD1VskA9CljYc0SVmu3HEyocu+q\nW5a6ej7VqqEvmJEdA2niN+ZwzZSvnuod8hjn61E0HsuISP8DUiRdBzvMa+re\nuBe9EH+U+VhTe+vWENkX+vkPtRFG+U4FybEJYkh2tULjxvGkKb1ReBFAC3Jx\ngka23g1EoglpRPyUJ8k4Qwgt6DlX0wPP8r+9+kw0siRvhl5G83AZW+LUILaq\nAFs90ds6Sr2hCN6fDQZKjKXoFOgpy0Xvn0OETA2N3t0oVtpJHKQu1EfXq27Y\nTDX4\r\n=vmRr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCd0L1dEiWkaGBdLocfRl+/aRrVP0r/R8UF5CvG8ZLm9wIhAOUIsW+shIf/VRgbEzb7iXZULHEkrlKFmVx/m/XXMwqA"}]},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.10.4_1629980862617_0.4994537029296344"},"_hasShrinkwrap":false},"0.10.5":{"author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.2","@opentelemetry/context-async-hooks":"0.25.0","@opentelemetry/core":"0.25.0","@opentelemetry/exporter-collector":"0.25.0","@opentelemetry/exporter-zipkin":"0.25.0","@opentelemetry/node":"0.24.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.25.0","@opentelemetry/semantic-conventions":"0.25.0","@opentelemetry/tracing":"0.24.0","@types/node":"16.7.2"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"27.0.1","@typescript-eslint/eslint-plugin":"4.29.3","@typescript-eslint/parser":"4.29.3","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.24.2","eslint-plugin-prettier":"3.4.1","eslint":"7.32.0","jest":"27.0.6","prettier":"2.3.2","ts-jest":"27.0.5","ts-node":"10.2.1","typescript":"4.3.5"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"license":"MIT","main":"dist/index.js","name":"@fwl/tracing","scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"types":"dist/index.d.ts","version":"0.10.5","_id":"@fwl/tracing@0.10.5","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zJpHXsBKVJ5m8MA/PKTENb6OyM2bTo0zez0TUzus3+qaG1zHixMScZnrT2uyoFFd8kTN8KeX3I2E6ImKU78rAw==","shasum":"99dc648c10f806c9226788c3f2ebbf2f990ef015","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.10.5.tgz","fileCount":20,"unpackedSize":111162,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKZWhSv/qDS+vqJ61JJrs6UjtY+C5LIMFFdmoD/BpWzAIgDyY5N9XFGpwTPja9luPJ4tohB9Q9ehN7SRyWNRDBSd4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXq/zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiuA/+J4L+mJUzVIlkF9wddv/YuiISL2vgHjBB44oVFr5rBJXnrRqN\r\ng8d69ZDtqk4YhT7pva4ol536cHjNOUc7dDW9MJXUfV7/kaXwFyzxdBItMDHh\r\n55xFfuWTyHHzg/3awInlbXy6iLtHteaBre4KQFsNOhYBiZlSOsIgk6PKhXMb\r\n03U6EZCrxxv9MHa06Al+B01GTpWA6T5tyLqajRDX1lK0H2G0CZE97px1I1Li\r\n+8JDgUtDOt7c5Nys844RmXXNuT4xfyR9gzaAAVZ4xkl1NCFYctsmUyaTig06\r\nnZ7+b056wpKllksGV9ZNN0aTCii+x4owLu4ofqh7Opt7w3ki7DE90PN1iGAF\r\nQhC86KG0n5RDti6TRvDUjs8KZrxP1f57X60z5xIM/Y37voaYSX9JDw+Zm/xF\r\nK5zX0bHSD5m55Box3G4Ll3jHHx0pg7cU+GoWA0GxbX0ZXLpVNBo1nuAm4YQt\r\nLooGleAQfh7T+DtcLSxqB1Zdy+uacEcljKlQU8Yc+1pCbetvcqzJRdVsvxUS\r\nk4IAWFt3l1iXJFpYI01hOZblbBeEd73ky7OHCLt5U19OorwS1pEm85nheSKl\r\ncN80B3ZEra5RHll4B2dval/WBnsXOK53gUWLNZV2bZvxBgYnNpt8wVC2Hh+J\r\n88zh1zlyNf0BnBPoWZPgPAgqkKe7bZUjxQE=\r\n=JW+t\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.10.5_1650372595521_0.48923254296333174"},"_hasShrinkwrap":false},"0.10.6":{"name":"@fwl/tracing","author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","version":"0.10.6","repository":{"type":"git","url":"git+https://github.com/fewlinesco/node-web-libraries.git","directory":"packages/tracing"},"scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"dependencies":{"@fwl/logging":"0.1.2","@opentelemetry/api":"1.0.2","@opentelemetry/context-async-hooks":"0.25.0","@opentelemetry/core":"0.25.0","@opentelemetry/exporter-collector":"0.25.0","@opentelemetry/exporter-zipkin":"0.25.0","@opentelemetry/node":"0.24.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"0.25.0","@opentelemetry/semantic-conventions":"0.25.0","@opentelemetry/tracing":"0.24.0","@types/node":"16.7.2"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"27.0.1","@typescript-eslint/eslint-plugin":"4.29.3","@typescript-eslint/parser":"4.29.3","eslint-config-prettier":"8.3.0","eslint-plugin-import":"2.24.2","eslint-plugin-prettier":"3.4.1","eslint":"7.32.0","jest":"27.0.6","prettier":"2.3.2","ts-jest":"27.0.5","ts-node":"10.2.1","typescript":"4.3.5"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"bugs":{"url":"https://github.com/fewlinesco/node-web-libraries/issues"},"homepage":"https://github.com/fewlinesco/node-web-libraries#readme","_id":"@fwl/tracing@0.10.6","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-PCLXB0Ez5ICdi73QpzKtGKKwbdKgh4Zk3R27wG7+zYggNqLcbkaN61V18+hpTWySPhMcf8dl25IUP/Xy3KzmUA==","shasum":"05143ade3c0cf9571f452884fd1a9712b9fe919e","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.10.6.tgz","fileCount":20,"unpackedSize":111432,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/LEd5GShsaZMBJrdI25haZ8UEr/UJUeEEzXweQ17nsAiAIN0GaTb4JsUQqu6AMZ8p2jTZYOSlwl/wBCTWvCzKnSQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZrQvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPHhAAiqoh88PPubSTTpLBXZ2PvevlqBkLCFFP0hUWXwmDnlT2htA5\r\n+v3mCSpnbbg3867OIcCkC/mCD3o6MfxEq2jYHQH9fMzTSQFYPtEq/Z7BYZDF\r\nF4Eu5DiU6cs8Nk8uGzzhy91P2mQkjzX41hf5lCZUL1jHg7cKeCoqfU9egPor\r\nirUzC8pI8kM9f2awrwUCO5u4BAy2R7R2TAHBXlk73yihJ/wls09d1rpy5LLM\r\nWrNVe+loE7LZw9QMYxNsnL2YfVU7E6+5hUlMsJVOeCgTsWBPxscVFlMMYX6T\r\nxIetBiSpNwPRsFr1At9R/N4qZZa4qJKJlriF6S2Yfv5O3wYqpTk5hk6AOGOa\r\nUYZaJ4WtpwoRjMHILT0hhBh2b4sYAJxLUFvoUt3AZsZXIe64MEoz54Cah9fe\r\nPfH30ANmQwu96Qe+tXMNzUmPrWwWHn922qsrUh677ms4kCrFero/rJ3NZbq0\r\nIapzKX+EE4P2Vdr09nQgwCMQYfZip0giZNU1DFD/NJCi81HCLDxLFzWvEwj0\r\nxXBXti/LLuHakbnpHeEahkRkZAyZo1DeWIQW/P+/DOt3wiQM7apNzudHc6qY\r\nxKELaaAQMQ0AWQsI2Ux2hp1Ttj4g/1CuXnfIH+W3N9O9N7ZCUaB/Y7ibVfZ0\r\nvBAVZ0Vny+ZltnSnIDZjEMPlF4oO98euh5I=\r\n=ZhiP\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.10.6_1650897967264_0.46452138735409565"},"_hasShrinkwrap":false},"0.10.7":{"name":"@fwl/tracing","author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","version":"0.10.7","repository":{"type":"git","url":"git+https://github.com/fewlinesco/node-web-libraries.git","directory":"packages/tracing"},"scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"dependencies":{"@fwl/logging":"0.1.4","@opentelemetry/api":"1.1.0","@opentelemetry/context-async-hooks":"1.2.0","@opentelemetry/core":"1.2.0","@opentelemetry/exporter-collector":"0.25.0","@opentelemetry/exporter-zipkin":"1.2.0","@opentelemetry/node":"0.24.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"1.2.0","@opentelemetry/semantic-conventions":"1.2.0","@opentelemetry/tracing":"0.24.0","@types/node":"17.0.31"},"devDependencies":{"@fewlines/eslint-config":"3.1.2","@types/jest":"27.4.1","@typescript-eslint/eslint-plugin":"5.21.0","@typescript-eslint/parser":"5.21.0","eslint":"8.14.0","eslint-config-prettier":"8.5.0","eslint-plugin-import":"2.26.0","eslint-plugin-prettier":"4.0.0","jest":"27.5.1","prettier":"2.6.2","ts-jest":"27.1.4","ts-node":"10.7.0","typescript":"4.6.4"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"gitHead":"a907848f39909c4597dac11b9076cfa83410d1da","bugs":{"url":"https://github.com/fewlinesco/node-web-libraries/issues"},"homepage":"https://github.com/fewlinesco/node-web-libraries#readme","_id":"@fwl/tracing@0.10.7","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-K0A/Zow4rJRn3+35siuNcggQ9YLbM0OmBU2UzXv/JEYlcm8XhvOkV1FlROTmlzg1GxNdCOJWf5ZCAbpVr5jRyg==","shasum":"f978aaa1fe6987915fccb0e3bbbb404fb1ea8295","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.10.7.tgz","fileCount":19,"unpackedSize":108045,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE8MI3mwyMd8rpST8JTRhyqfgWdk9Pz2zNgBQ9k9ss9HAiEAypgPYO++jiWZ7NEEqx/Q3OCC4WxQyldwYikgP7msjeM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJib6DBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3bg//R9ak5FMjHsBtLoIeNADH4FURaFfKPAPxUBH4z2lQlSl06Uxi\r\nciXexxybEecpwFKQ71ik/caNfu3jWOqicHJbvCPmev4LPRypHVxTKNDHeb27\r\n1KFD0DQT7r6kozT1+uI19HrtOyyrI5CicmgyPOmjxYf2jT9exO61Owq7QZ52\r\nbUs/ssgGcgXtCnv9PGNiMN0aC9g724Z1AwLhLo2iLwOu/DjcB8BNPKS3wDxj\r\nwOdQHbu8PsxveSUHulif05sALq8u5olaHilfQZm7Q3UZioJHbUHUWX5WSvHz\r\nSb0jIrAJ71YANC2V/18NMc6c11tbt60xNmTBpGi92fUYOe7dJbYBAe1WfWCB\r\nRcidS3CZkT+7Jm13+W78QLqH7KP6CnfiMYHHMW86ocFRfh8y3MA8BAD9/PiS\r\noWdcanzOC3S7h0+fflGuLKORUdOSskhG2DJr/2yd4+oz8zXzBnsQAzfX6QVc\r\n8kRPqYSAkGkKCSLfs9DRTZTUn7dc6ya7dJ+UFSQxahSUCGASEx1dYTW5napo\r\nbBwa+yfH4Kl9hYoW6qF05kqFSnIkPE3E17k+o1QxRUj/1LnMigFHAQqvVJDA\r\nOWrgxfwg+vIbd1mc+py/YC7uSKR8RD/2n4kwcMQmdg3pxoQ7XYfi1ARhF0vt\r\n20okVC2yfaxZ/im5N8+TNSFOQNvz7FzCTDM=\r\n=h6r6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.10.7_1651482817170_0.7880008342350746"},"_hasShrinkwrap":false},"0.10.8":{"name":"@fwl/tracing","author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","version":"0.10.8","repository":{"type":"git","url":"git+https://github.com/fewlinesco/node-web-libraries.git","directory":"packages/tracing"},"scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepare":"yarn build","postinstall":"yarn build","prepublishOnly":"yarn lint","preversion":"yarn lint","test":"jest"},"dependencies":{"@fwl/logging":"^0.1.7","@opentelemetry/api":"1.1.0","@opentelemetry/context-async-hooks":"1.2.0","@opentelemetry/core":"1.2.0","@opentelemetry/exporter-collector":"0.25.0","@opentelemetry/exporter-zipkin":"1.2.0","@opentelemetry/node":"0.24.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"1.2.0","@opentelemetry/semantic-conventions":"1.2.0","@opentelemetry/tracing":"0.24.0","@types/node":"17.0.35"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"gitHead":"1d46da441ca540a6b3139cbdc1259d6a0a822e89","bugs":{"url":"https://github.com/fewlinesco/node-web-libraries/issues"},"homepage":"https://github.com/fewlinesco/node-web-libraries#readme","_id":"@fwl/tracing@0.10.8","_nodeVersion":"16.15.0","_npmVersion":"lerna/5.0.0/node@v16.15.0+arm64 (darwin)","dist":{"integrity":"sha512-D9aL/ZB839pUwxYqsZEQgFeTBB4oiC2e5eMlKglXutY2e+lnkulJqzBGxW1gJztoMV7Cu10IUb5ZGMInlq42dA==","shasum":"f0a5b92817825925c65661d263c658aaa785d926","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.10.8.tgz","fileCount":19,"unpackedSize":106348,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFsleW+JG4WBiKqlrf3vAxRhQVotBvmNbiqG8VsdVyJqAiBM6EZwrTpFeKe1qL6SO6U/8KSmn7Wxu21sIMFfsSE0uQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJioKEOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWdBAAklp0Nrksab0wuTEKNnnCn5rejWCynYYtUgTC1slD2J8Fy2MY\r\n69y/kZzsRi7c9VSf7ym00XktDtMq0Wjo3xmcGV0ilIf5qCX8nbHMMOz9XYMW\r\ngYNJ+WjUKd3nUYG4pVlCOKIKfZJMHVMwWYYRev/5H5CgzEgStNsoq3VpRFHm\r\nc6n2fCBnWyJkjh9q0RASgiq5R2cpaxxFK+VefZ00ElEQVzU1FF/V191pSMcg\r\n4L75wLJGZ3nF7yJq44Hdne/+8l58wk2L7fryb9PDqYQYHKqWmvwZOhLZpkUO\r\nSkmMSGXXNmoR4H9LVwkAPxurISqUl4GYeSLQOE/aI/Y/os45cNJis+gvNiPy\r\n3Fr9VLeRgYDCm0qR2P6tPRGzIRV1B5Z2JsedlLEBYTAgKzFaC96Z4Vsbk4yq\r\nSd0wKEVagFoBHgWK6+ksrLlWnhz6KmyiY7WIVOaVGRM68sp0lY6Zm2KuoFcD\r\nqqNKE3c1OfY6dWh5opPkRT2vFvedxWIf/iwWnME8E3Z9jL6bwy+OSqb6rZkB\r\ndTi0/cjJ4obdLQFMmL3oF13IXno5z3snFrlwNoHYLu9uaNjzv/e+4oDAZCWd\r\nj+ydOoqwJ73e4iePlVtGeX3Fa6NxuglLVVkjr+bqgm2117hOPH7I/QamKPqt\r\nifFQvU52Yqh7bxPP9BWfvr67XoM4onwtQNM=\r\n=xhzz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.10.8_1654694157872_0.33752644580229707"},"_hasShrinkwrap":false},"0.10.9":{"name":"@fwl/tracing","author":{"name":"Fewlines"},"description":"Tracing part of Fewlines Web Libraries","license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","version":"0.10.9","repository":{"type":"git","url":"git+https://github.com/fewlinesco/node-web-libraries.git","directory":"packages/tracing"},"scripts":{"build":"tsc","clean":"rm -rf dist","experimental-publish":"yarn publish --new-version \"0.0.0-experimental-$(git rev-parse --short HEAD)\" --access public --tag experimental","prelint":"prettier --trailing-comma all --write './**/*.md'","lint":"eslint --ext ts --ignore-pattern dist .","prebuild":"yarn clean","prepublishOnly":"yarn lint && yarn build","preversion":"yarn lint","test":"jest"},"dependencies":{"@fwl/logging":"^0.1.8","@opentelemetry/api":"1.1.0","@opentelemetry/context-async-hooks":"1.2.0","@opentelemetry/core":"1.2.0","@opentelemetry/exporter-collector":"0.25.0","@opentelemetry/exporter-zipkin":"1.2.0","@opentelemetry/node":"0.24.0","@opentelemetry/plugin-http":"0.18.2","@opentelemetry/plugin-https":"0.18.2","@opentelemetry/resources":"1.2.0","@opentelemetry/semantic-conventions":"1.2.0","@opentelemetry/tracing":"0.24.0","@types/node":"17.0.35"},"eslintConfig":{"extends":["@fewlines/eslint-config/node","@fewlines/eslint-config/typescript"]},"jest":{"preset":"ts-jest","testEnvironment":"node","testPathIgnorePatterns":["dist/"]},"gitHead":"1b885c96412544c76eba916f30d00aeeea2892f9","bugs":{"url":"https://github.com/fewlinesco/node-web-libraries/issues"},"homepage":"https://github.com/fewlinesco/node-web-libraries#readme","_id":"@fwl/tracing@0.10.9","_nodeVersion":"16.15.0","_npmVersion":"lerna/5.0.0/node@v16.15.0+arm64 (darwin)","dist":{"integrity":"sha512-JmUeJIfzbJdvxvjmbFDC3B5MwZ3OCn1nhn5oGIk5HN2YN2NqI0733w9K7YUAF2y+x9Rt0NyyMqUQfNRV6OvTcg==","shasum":"afb0cf8d2dcfbe70bc8a8e734a3e58cc22157d0d","tarball":"https://registry.npmjs.org/@fwl/tracing/-/tracing-0.10.9.tgz","fileCount":19,"unpackedSize":106300,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRyUjTeV41IEad1Mx3K4QlrfEXXCIOpQ0mkd/kMCSbPwIhAIie3fK0vtt/1/oiJPaR4XezunitF9h5Nru1Yr3mriDQ"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJioaDVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPCg//f2Gv+ZNvLMXRP7Lca5K808oVzcbzp39/cAPZZa1JQ6JMtGhy\r\nLNYI/UVxnEzsDR6CSJQGPZFu/eCAH3pniQxkCU+CLTPTSanQikTtbPAW6Ca6\r\n6/FooKcFg3NIiGyZXzWIM+FV7lg5ybDaNDUFpplWlrtIK+I97dUfY/1HtkF1\r\n2Lx/xnPHB4FcWMucDiP+5+eZLkD0iqSlNY4tpMd4dRo/JYfGXs/WMTlUj1xC\r\nmTNnDHTd/7NKtouZHkwCGW6EO9HMpuDII9TM/TAKRriMlhLC0KqcyT8gIVce\r\nr34W9owjc3yUsvMqAi4ltbFNegVHYjyc/tTB8BQEOKZNXOnRqt4zyApRsuBH\r\n8dM7EZHhdWGYGnob5Rou0/L2q/Qn2GOY62nORdWKnSnnBWu0vEnc0qMlSIID\r\n9K1YB2VldX7IPlo7rRZuNtSr2UavIcnBvZq/vF+seAGspPbrlrSu7xt344X7\r\nG6BIEHmpnKh4HhQMAhDO0vEbXOUc5PIfyQpve8xLXV7eaErw53gRIcc+l40F\r\nrNcNMipQfBBBT2gCTAK9MsOD002AUL5wpP3et8c/6+kyqEQpZKWSqYFEBfHN\r\n1y6XlxRATyx/I8nFmW1ICeCubjdv94zetCv7A4Jg4l1yEROS5UskJt9rqglI\r\nNHkXxyN8uDBBc61LABpJW7zr3fokXKLNf0o=\r\n=u3/q\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fewlines-tech","email":"tech@fewlines.co"},"directories":{},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tracing_0.10.9_1654759637147_0.8017659782372109"},"_hasShrinkwrap":false}},"time":{"created":"2020-06-19T13:25:37.026Z","0.1.0":"2020-06-19T13:25:37.419Z","modified":"2022-06-09T07:27:17.484Z","0.2.0":"2020-07-07T08:01:06.514Z","0.2.1":"2020-07-29T09:09:21.112Z","0.3.0":"2020-08-12T09:03:48.053Z","0.3.1":"2020-08-18T13:13:12.783Z","0.3.2":"2020-08-18T15:07:51.882Z","0.3.3":"2020-08-19T12:00:45.462Z","0.4.0":"2020-08-20T13:20:47.466Z","0.5.0":"2020-12-24T16:43:52.380Z","0.5.1":"2020-12-30T19:51:34.170Z","0.6.0":"2020-12-31T10:37:37.928Z","0.6.1":"2021-01-04T17:14:39.230Z","0.6.2":"2021-01-07T15:04:20.956Z","0.0.0-experimental-64b4cf2":"2021-01-13T12:25:25.910Z","0.7.0":"2021-01-14T14:38:52.651Z","0.0.0-experimental-6d4cdda":"2021-02-01T12:36:50.443Z","0.0.0-experimental-9a2e321":"2021-02-01T12:45:20.523Z","0.8.0":"2021-02-04T17:01:18.363Z","0.8.1":"2021-02-08T09:45:57.724Z","0.0.0-experimental-4e732dc":"2021-02-09T14:27:54.609Z","0.9.0":"2021-02-09T14:50:47.369Z","0.0.0-experimental-ab9f3e6":"2021-05-25T14:51:11.179Z","0.0.0-experimental-6df0bd1":"2021-05-26T11:28:57.228Z","0.0.0-experimental-fb17e8a":"2021-05-26T11:35:09.729Z","0.0.0-experimental-ef5b6e1":"2021-05-26T14:00:47.079Z","0.0.0-experimental-0d950f9":"2021-05-26T14:55:21.765Z","0.0.0-experimental-21768af":"2021-05-26T15:29:47.683Z","0.0.0-experimental-21cd9c3":"2021-05-27T08:04:35.223Z","0.10.0":"2021-05-27T08:15:35.504Z","0.0.0-experimental-0af6405":"2021-05-27T13:18:27.270Z","0.10.1":"2021-05-27T15:22:30.864Z","0.10.2":"2021-06-21T15:54:18.636Z","0.0.0-experimental-f81d203":"2021-07-07T15:31:53.562Z","0.0.0-experimental-5c4c97a":"2021-07-09T13:34:13.363Z","0.0.0-experimental-8e740a8":"2021-07-09T15:25:07.407Z","0.0.0-experimental-3f164c9":"2021-07-09T15:47:05.940Z","0.0.0-experimental-f91b8a5":"2021-07-19T09:45:34.767Z","0.0.0-experimental-5b4af6e":"2021-07-19T11:49:52.694Z","0.0.0-experimental-3e40e0a":"2021-07-21T08:39:37.479Z","0.0.0-experimental-bc52d84":"2021-07-21T08:55:24.191Z","0.0.0-experimental-35f870f":"2021-07-21T09:33:05.040Z","0.0.0-experimental-d1f6855":"2021-07-21T10:10:47.893Z","0.0.0-experimental-77ca84d":"2021-07-21T10:48:12.243Z","0.0.0-experimental-015066d":"2021-07-21T12:15:18.877Z","0.0.0-experimental-4ebbdd8":"2021-07-23T15:45:18.131Z","0.10.3":"2021-07-23T16:08:23.433Z","0.0.0-experimental-102e518":"2021-08-26T11:10:55.967Z","0.0.0-experimental-4c289e8":"2021-08-26T12:06:37.613Z","0.10.4":"2021-08-26T12:27:42.789Z","0.10.5":"2022-04-19T12:49:55.881Z","0.10.6":"2022-04-25T14:46:07.445Z","0.10.7":"2022-05-02T09:13:37.283Z","0.10.8":"2022-06-08T13:15:58.085Z","0.10.9":"2022-06-09T07:27:17.368Z"},"maintainers":[{"name":"fewlines-tech","email":"tech@fewlines.co"}],"description":"Tracing part of Fewlines Web Libraries","author":{"name":"Fewlines"},"license":"MIT","readme":"# FWL Tracing\n\n**Disclaimer**: this package is made for our internal usage and is only open source for convenience so we might not consider Pull Requests or Issues. Feel free to fork though.\n\nThis is part of the Fewlines Web Libraries packages.\nIt provides a simple way to do tracing with [OpenTelemetry](https://opentelemetry.io).\n\n## Installation\n\n```shell\nyarn add @fwl/tracing\n```\n\n## Getting Started\n\nAs OpenTelemetry libraries need to monkey patch packages before them being called, starting the tracer should be the first thing you do.\n\nHere's an example with a simple collector (e.g. Zipkin):\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  simpleCollector: {\n    serviceName: \"serviceName\",\n    url: \"http://localhost:9411/api/v2/spans\",\n  },\n});\n\nconst tracer = getTracer();\n```\n\n### Configure several exporters\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  collectors: [\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:29799/v1/traces\",\n    },\n    {\n      type: \"otel\",\n      serviceName: \"serviceName\",\n      url: \"http://localhost:8360/api/v2/otel/trace\",\n      authorizationHeader: {\n        key: \"Lightstep-Access-Token\",\n        value: \"developer\",\n      },\n    },\n  ],\n});\n```\n\n> Note that if you configure several exporters, the `serviceName` property that will be used to define the service name of all exporters will be the first one.\n\n### Lightstep\n\nAnd an example with a Lightstep public satellite:\n\n```typescript\nimport { getTracer, startTracer } from \"@fwl/tracing\";\n\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: process.env.LIGHTSTEP_ACCESS_TOKEN,\n  },\n});\n\nconst tracer = getTracer();\n```\n\nIf you want to use Lightstep in developer mode, you could add an URL:\n\n```typescript\nstartTracer({\n  lightstepPublicSatelliteCollector: {\n    serviceName: \"serviceName\",\n    accessToken: \"\",\n    url: \"http://localhost:8360/api/v2/otel/trace\",\n  },\n});\n```\n\n## Usage\n\nOnce you have a tracer (of type `Tracer`), you will have a `span` method:\n\n```typescript\nimport { Span, Tracer } from \"@fwl/tracing\";\n\n// ...\nfunction(tracer: Tracer) {\n  tracer.span(\"span name\", async (span: Span) => {\n    // If you want to add attributes to your span with a visible value\n    span.setDisclosedAttribute(key, value);\n\n    // If you want to add attributes to your span with a redacted value\n    span.setAttribute(key, value);\n\n    // any code there that return a Promise (in this example, the callback is an `async` function so any value should do\n  });\n}\n```\n\nThis way is the recommended way as it will automatically end the span for you.\nHowever, if you ever are in need to more fine grain control (for instance, in a middleware), you can use `createSpan`:\n\nHere is an example of a logging middleware for Express:\n\n```typescript\nimport { NextFunction, Request, Response } from \"express\";\nimport { Logger } from \"@fwl/logging\";\nimport { Tracer, Span } from \"@fwl/tracing\";\n\nexport function loggingMiddleware(tracer: Tracer, logger: Logger) {\n  function onCloseOrFinish(span: Span, startTime: bigint): () => void {\n    return function () {\n      const response = this as Response;\n      response.removeListener(\"finish\", onCloseOrFinish);\n      const end = process.hrtime.bigint();\n      logger.log(\n        `${response.req.path}: ${response.statusCode} in ${end - startTime}`,\n      );\n      span.end();\n    };\n  }\n  return function (\n    _request: Request,\n    response: Response,\n    next: NextFunction,\n  ): void {\n    const startTime = process.hrtime.bigint();\n    const span = tracer.createSpan(\"logging middleware\");\n    response.once(\"finish\", onCloseOrFinish(span, startTime));\n    next();\n  };\n}\n```\n\nKeep in mind that this method is only required because we need to call `next()` and we want to start the span across the whole request.\nThe recommended method is to use `tracer.span`.\n\n## Tracing during tests\n\nIf you need to use the tracer in a testing environment, we provide a `InMemoryTracer` class that act as a regular tracer, except you won't have to launch `jaeger` to run your tests.`InMemoryTracer` also provides you with a way of testing your spans with the use of the `searchSpanByName`. The usage is the same, you just need to initialize `InMemoryTracer` instead of using `startTracer()`.\n\nHere is an example of use in a test file using `jest`:\n\n```ts\nimport { InMemoryTracer } from \"@fwl/tracing\";\n\nlet tracer: InMemoryTracer;\n\nbeforeEach(() => {\n  tracer = new InMemoryTracer();\n});\n\ntest(\"verify span attributes\", () => {\n  expect.assertions(1);\n\n  // Call the code that is using a tracer.\n\n  const [span] = tracer.searchSpanByName(\"test-span\");\n\n  expect(span.attributes[0].attributeName).toBe(\"attribute value\");\n});\n```\n","readmeFilename":"README.md","homepage":"https://github.com/fewlinesco/node-web-libraries#readme","repository":{"type":"git","url":"git+https://github.com/fewlinesco/node-web-libraries.git","directory":"packages/tracing"},"bugs":{"url":"https://github.com/fewlinesco/node-web-libraries/issues"}}