From 9198c0f5bd756182bc8d2209c91ffd5d927b91d7 Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Fri, 2 Aug 2019 15:54:14 -0700 Subject: [PATCH 1/8] New package core-tracing with support for Open Census --- common/config/rush/pnpm-lock.yaml | 82 ++++-- rush.json | 4 + sdk/core/core-tracing/Changelog.md | 3 + sdk/core/core-tracing/LICENSE.txt | 21 ++ sdk/core/core-tracing/README.md | 23 ++ sdk/core/core-tracing/api-extractor.json | 32 ++ .../lib/implementations/noop/spanNoOpImpl.ts | 33 +++ .../implementations/noop/tracerNoOpImpl.ts | 25 ++ sdk/core/core-tracing/lib/index.ts | 29 ++ sdk/core/core-tracing/lib/interfaces/Event.ts | 25 ++ .../core-tracing/lib/interfaces/Sampler.ts | 37 +++ .../lib/interfaces/SpanOptions.ts | 43 +++ .../core-tracing/lib/interfaces/TimedEvent.ts | 25 ++ .../core-tracing/lib/interfaces/attributes.ts | 20 ++ sdk/core/core-tracing/lib/interfaces/link.ts | 29 ++ sdk/core/core-tracing/lib/interfaces/span.ts | 117 ++++++++ .../lib/interfaces/span_context.ts | 66 +++++ .../core-tracing/lib/interfaces/span_kind.ts | 50 ++++ .../core-tracing/lib/interfaces/status.ts | 165 +++++++++++ .../lib/interfaces/trace_options.ts | 27 ++ .../lib/interfaces/trace_state.ts | 63 ++++ .../core-tracing/lib/interfaces/tracer.ts | 92 ++++++ .../lib/plugins/noop/noOpSpanPlugin.ts | 52 ++++ .../lib/plugins/noop/noOpTracePlugin.ts | 35 +++ .../opencensus/openCensusSpanPlugin.ts | 61 ++++ .../opencensus/openCensusTracePlugin.ts | 47 +++ sdk/core/core-tracing/lib/tracerProxy.ts | 26 ++ .../lib/utils/supportedPlugins.ts | 4 + sdk/core/core-tracing/package.json | 95 ++++++ .../core-tracing/review/core-tracing.api.md | 274 ++++++++++++++++++ sdk/core/core-tracing/rollup.base.config.js | 105 +++++++ sdk/core/core-tracing/rollup.config.js | 14 + sdk/core/core-tracing/rollup.test.config.js | 3 + sdk/core/core-tracing/tsconfig.json | 61 ++++ 34 files changed, 1768 insertions(+), 20 deletions(-) create mode 100644 sdk/core/core-tracing/Changelog.md create mode 100644 sdk/core/core-tracing/LICENSE.txt create mode 100644 sdk/core/core-tracing/README.md create mode 100644 sdk/core/core-tracing/api-extractor.json create mode 100644 sdk/core/core-tracing/lib/implementations/noop/spanNoOpImpl.ts create mode 100644 sdk/core/core-tracing/lib/implementations/noop/tracerNoOpImpl.ts create mode 100644 sdk/core/core-tracing/lib/index.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/Event.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/Sampler.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/SpanOptions.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/TimedEvent.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/attributes.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/link.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/span.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/span_context.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/span_kind.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/status.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/trace_options.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/trace_state.ts create mode 100644 sdk/core/core-tracing/lib/interfaces/tracer.ts create mode 100644 sdk/core/core-tracing/lib/plugins/noop/noOpSpanPlugin.ts create mode 100644 sdk/core/core-tracing/lib/plugins/noop/noOpTracePlugin.ts create mode 100644 sdk/core/core-tracing/lib/plugins/opencensus/openCensusSpanPlugin.ts create mode 100644 sdk/core/core-tracing/lib/plugins/opencensus/openCensusTracePlugin.ts create mode 100644 sdk/core/core-tracing/lib/tracerProxy.ts create mode 100644 sdk/core/core-tracing/lib/utils/supportedPlugins.ts create mode 100644 sdk/core/core-tracing/package.json create mode 100644 sdk/core/core-tracing/review/core-tracing.api.md create mode 100644 sdk/core/core-tracing/rollup.base.config.js create mode 100644 sdk/core/core-tracing/rollup.config.js create mode 100644 sdk/core/core-tracing/rollup.test.config.js create mode 100644 sdk/core/core-tracing/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 8a6fb5c021ec..9c68792a7255 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -17,6 +17,7 @@ dependencies: '@rush-temp/core-auth': 'file:projects/core-auth.tgz' '@rush-temp/core-http': 'file:projects/core-http.tgz' '@rush-temp/core-paging': 'file:projects/core-paging.tgz' + '@rush-temp/core-tracing': 'file:projects/core-tracing.tgz' '@rush-temp/cosmos': 'file:projects/cosmos.tgz' '@rush-temp/event-hubs': 'file:projects/event-hubs.tgz' '@rush-temp/event-processor-host': 'file:projects/event-processor-host.tgz' @@ -9713,7 +9714,7 @@ packages: dev: false name: '@rush-temp/abort-controller' resolution: - integrity: sha512-YZB6V1xg82Kr6pXb7ROrUOn04B0z+uMjGfx3h01o1YlNs0nK1PWjUGxbv7S2W3jVqdtrigRrUCb0N7ssWt/qmg== + integrity: sha512-RuhnSQySoyCi5RWYPvJ0/Lkcae++dII8y5MmaB2lyctYmgZSNGZQiHC8ynz1Ff+nx1aSrFm+OTR5fN6OM86nZA== tarball: 'file:projects/abort-controller.tgz' version: 0.0.0 'file:projects/core-amqp.tgz': @@ -9784,7 +9785,7 @@ packages: dev: false name: '@rush-temp/core-amqp' resolution: - integrity: sha512-P8CiVrSH6xDLznsrnE5Ml2Udf2c1kVSESkHPxfHgKkj3qo1w5CYK7WE6wtkLIkD31kPyFoHWsHBC5XyVs3GJLA== + integrity: sha512-TO5tSHoJ1Uxi7Um7qtmzxYsEipKbbVF7wsY5faQRM4XvRkcjjL2cKSRrYyHNmSWZSniQ+KFfol5lHo3zOt+gDQ== tarball: 'file:projects/core-amqp.tgz' version: 0.0.0 'file:projects/core-arm.tgz': @@ -9820,7 +9821,7 @@ packages: dev: false name: '@rush-temp/core-arm' resolution: - integrity: sha512-DxPkCs1exvhv8SRAI7jx9CVtepRR3Qj9++ynwASgqjPh85+9Wo3xSl+mohWi+c/nmON9kdHlzp4qvq7psKkk9A== + integrity: sha512-6qM3GwDqOSp1yOIQKFqERC8tTW+BIR+9tgvlm/Ohje5N1Nj6Cspy/YVtVO/efHYP9LMJ9hi2rjCXU6Plp4An9w== tarball: 'file:projects/core-arm.tgz' version: 0.0.0 'file:projects/core-asynciterator-polyfill.tgz': @@ -9839,7 +9840,7 @@ packages: dev: false name: '@rush-temp/core-asynciterator-polyfill' resolution: - integrity: sha512-oJErNaXrpCzEEVyYVvv8gcBRnv36c76LBxalfW/l4wlABmUh9u+EuvwI46ig0V3m1bmIluW4S/9O08nO18uyGw== + integrity: sha512-v2OkkGp4BscubKnr7qikdSqLJttDTy5skuwpX+KeQv9H5aMDtfGU4CKUmqdwGsI/+vnXlPU57ZBVJ0BtucQBng== tarball: 'file:projects/core-asynciterator-polyfill.tgz' version: 0.0.0 'file:projects/core-auth.tgz': @@ -9879,7 +9880,7 @@ packages: dev: false name: '@rush-temp/core-auth' resolution: - integrity: sha512-3A4yvJDci4zsEaNhc5KDCr0gAwjKpH9EWw+pU1s6orOqh4RcEpssVPmUFoNKPk7+qDMRqS/IhAvWAjIgiI+Dag== + integrity: sha512-AVe2WfWPpab/mPESHoXACFqnYn8KyHT12AxqypS0RVPo/yQllkiRSaBaY+Qv//K25+jJKOHgyrHqhjLJRzvczQ== tarball: 'file:projects/core-auth.tgz' version: 0.0.0 'file:projects/core-http.tgz': @@ -9961,7 +9962,7 @@ packages: dev: false name: '@rush-temp/core-http' resolution: - integrity: sha512-caXXYC9LfmiCewIDnlJUMxfxTDvkDUoVrySHWJ1He4/PGxDUGJAMnkazdFsXf4/rrF/tUtzYJ5WNokgZPYqLKw== + integrity: sha512-HBS+FpI24GB29G+6v9HX7hePp1rULVnlcNe0Pw8ueEangIz40aWXh1Y3zPtVz9A6/wz/p2nC7W8k/TNl066cfQ== tarball: 'file:projects/core-http.tgz' version: 0.0.0 'file:projects/core-paging.tgz': @@ -9981,9 +9982,48 @@ packages: dev: false name: '@rush-temp/core-paging' resolution: - integrity: sha512-MTsl2eG0FXkUyouQVkSEpgLuG6tNUKE8ckhH8y4B3VUevh/MOS/ghpCqXFRKEAMF7jVfB1s2BSSorGYFuWlcDg== + integrity: sha512-2u4fno6260w1XLYISrBU+SlPSNrMlY9/Au3oQxjk4EzkWkZXOuDrC9WKNu5w0EHEktYtOi8eX9lAU9+JtZR3Hg== tarball: 'file:projects/core-paging.tgz' version: 0.0.0 + 'file:projects/core-tracing.tgz': + dependencies: + '@microsoft/api-extractor': 7.3.4 + '@types/mocha': 5.2.7 + '@types/node': 8.10.51 + '@typescript-eslint/eslint-plugin': 1.13.0_0b5e999c52a893676e7127c05369c7b6 + '@typescript-eslint/parser': 1.13.0_eslint@5.16.0 + assert: 1.5.0 + cross-env: 5.2.0 + eslint: 5.16.0 + eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-detailed-reporter: 0.8.0_eslint@5.16.0 + eslint-plugin-no-null: 1.0.2_eslint@5.16.0 + eslint-plugin-no-only-tests: 2.3.1 + eslint-plugin-promise: 4.2.1 + inherits: 2.0.4 + mocha: 5.2.0 + mocha-junit-reporter: 1.23.1_mocha@5.2.0 + mocha-multi: 1.1.0_mocha@5.2.0 + prettier: 1.18.2 + rimraf: 2.6.3 + rollup: 1.18.0 + rollup-plugin-commonjs: 10.0.1_rollup@1.18.0 + rollup-plugin-json: 4.0.0 + rollup-plugin-multi-entry: 2.1.0 + rollup-plugin-node-resolve: 5.2.0_rollup@1.18.0 + rollup-plugin-replace: 2.2.0 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.18.0 + rollup-plugin-terser: 5.1.1_rollup@1.18.0 + rollup-plugin-visualizer: 2.5.4_rollup@1.18.0 + tslib: 1.10.0 + typescript: 3.5.3 + util: 0.12.1 + dev: false + name: '@rush-temp/core-tracing' + resolution: + integrity: sha512-QLUT0kQIoWe4V02xaBiWpWATkW5Gqi0y39uYpu0qXbpogrTouiI/WVu/qQFqvrksojBFBJajCQQM6DOgbqBtcw== + tarball: 'file:projects/core-tracing.tgz' + version: 0.0.0 'file:projects/cosmos.tgz': dependencies: '@types/mocha': 5.2.7 @@ -10023,7 +10063,7 @@ packages: dev: false name: '@rush-temp/cosmos' resolution: - integrity: sha512-C/dkPEdiFfMi1Qz6BaTMvSF218Ht9TIHjxBcYIC2H20Kfb0/fVR1ThW1H1uFPidEPtct/Qz8wlJWBVUfiumPNQ== + integrity: sha512-QdnsCtEZYRaiLoFGvg8zhJFo6FdtllFmm5mJaVrGP54JtFcGxgKXtE21v7LuuBoe/+jo/pROjMv59yvrxw/qsw== tarball: 'file:projects/cosmos.tgz' version: 0.0.0 'file:projects/event-hubs.tgz': @@ -10099,7 +10139,7 @@ packages: dev: false name: '@rush-temp/event-hubs' resolution: - integrity: sha512-oyo9iC0F31bWD+/p5AtfkUcnFIovsqgZUq/VAdsRDjPoRHmAU7g5V6hGy5XYHnjKSRbFMGjYN+Wz1e/mT1TxqQ== + integrity: sha512-senhWyZk3l8A041gtjoRjoLcikYZKIcCZRZjtuMVaVjDc+P9fttnMfAE+Bc7BThmRYYYURn/2WocPAKtKjNLBQ== tarball: 'file:projects/event-hubs.tgz' version: 0.0.0 'file:projects/event-processor-host.tgz': @@ -10157,7 +10197,7 @@ packages: dev: false name: '@rush-temp/event-processor-host' resolution: - integrity: sha512-8hJE2VpoJpenKjzTXTKZnpWJianXLxiKUtXJExYIhysC7LaRFLaNXqv0kATHnfh9ACNd47oSfSO8csydQV/x5Q== + integrity: sha512-8cK8BQGt608wzcnNTZBssdPfgdyX7xQbvTA8Q8U0Hqe5XKbykhzHpx/Y32+CE6bOW17QDbKmIgxPYywIRRBFag== tarball: 'file:projects/event-processor-host.tgz' version: 0.0.0 'file:projects/identity.tgz': @@ -10208,7 +10248,7 @@ packages: dev: false name: '@rush-temp/identity' resolution: - integrity: sha512-NqrV60lDVJSHs0mX7B1GDqF+ZlqkIQC6ak41MQhkfO3Expk4+EsZc9W8SuBGF3OA952d7voYiScu7/Llp0dnew== + integrity: sha512-rF7sKJQVnOCy3Tnu/sMdcwk8DAN7IAqJV2fo9wtrtJ2yOqMwqwxeNGYteel2EPnOqH0D6p3qdB1hCuwAsyXF0Q== tarball: 'file:projects/identity.tgz' version: 0.0.0 'file:projects/keyvault-certificates.tgz': @@ -10237,7 +10277,7 @@ packages: dev: false name: '@rush-temp/keyvault-certificates' resolution: - integrity: sha512-QXnSrcEl4SWcc1wYPRy2BeupDtio52G/miaEJAgse04u88EeU5YoZpQNtZ9l2rzpd/wuJmB2GMkVgUXRnB6zgg== + integrity: sha512-0Rr3TCScxlCMTaQ42DE3wAzan3NPSnborTqYIH8v/tJnxaFbjfD15Z0x2qGdmpn6Rs+45kG26uwKeG14AxtNPA== tarball: 'file:projects/keyvault-certificates.tgz' version: 0.0.0 'file:projects/keyvault-keys.tgz': @@ -10307,7 +10347,7 @@ packages: dev: false name: '@rush-temp/keyvault-keys' resolution: - integrity: sha512-MyqA/8uu5hwV/QAJYyS0dKOpixsYXhqanHEaqgUr5MK3y+CfNKX1/PA5u7TqujiROxXgjeXoGiIPcRmblFOOxg== + integrity: sha512-xPulaHwiYJ1qe1lgx2f3YIJgn/n5RnpIzf1EJppRq0lu/Oq6spX1ZYzXUmK1hWv98KGit7ryt8kw9/ffzN8BaQ== tarball: 'file:projects/keyvault-keys.tgz' version: 0.0.0 'file:projects/keyvault-secrets.tgz': @@ -10376,7 +10416,7 @@ packages: dev: false name: '@rush-temp/keyvault-secrets' resolution: - integrity: sha512-Kflt5b838Qhaj+aJi0E24WrQX1LsBsvjhcCxP1cLaSB4kwwCyjWLzHithaomyK3DLY7G029+VtWojYYVlDjt1g== + integrity: sha512-I2NMoFjZFDUEowFdFO7/T1kbyOW/qfBaE4FcjEPrmTTQe7w+nisRgSz1OK/VZXtckgS7lJCX1AjbMqG6e+XixA== tarball: 'file:projects/keyvault-secrets.tgz' version: 0.0.0 'file:projects/service-bus.tgz': @@ -10454,7 +10494,7 @@ packages: dev: false name: '@rush-temp/service-bus' resolution: - integrity: sha512-pGmuhpiqNLjt0lRX/4q7hUdnFKpcT3OaYmGsq3I9sPEEYS6zn+Rr8kAX291NNHdEPBh6nyUUqftpalELJSq3Yg== + integrity: sha512-93tbhWPPZ04ozrpvFWfn2wOaLRvnilD6vxPq7xMAnyvi52T7HjHo+NyY1S8bojg4xciYHiDrByvNGxVlgPxVIQ== tarball: 'file:projects/service-bus.tgz' version: 0.0.0 'file:projects/storage-blob.tgz': @@ -10525,7 +10565,7 @@ packages: dev: false name: '@rush-temp/storage-blob' resolution: - integrity: sha512-T4hbFg8h5S7RcyLHXW7HUXAQmpQ4IR3fyS43dlanQsxODisWkgkgEE/NpkLW6v4XG4nZLmUBJC3Rziz/vVqcjw== + integrity: sha512-O9urZlGKQ1g4q8rHMVMRZx+yIpQKI9aZDIZ6VkYXfxjbsi6KSCHjW7k1FQBxoPZv9hk3bGcTBh2DfFfVSa9gDA== tarball: 'file:projects/storage-blob.tgz' version: 0.0.0 'file:projects/storage-file.tgz': @@ -10596,7 +10636,7 @@ packages: dev: false name: '@rush-temp/storage-file' resolution: - integrity: sha512-mddX2+fGdsOiO6MYnvgsXXY7iY5lkyqIJVn+UYpuJ0Hioxxaf16WBj/RtqTvV6+HHxBXKZ1Mgf+ERSyvJN3NBQ== + integrity: sha512-T8/LjmL+LzpeHkEZYIngTSdHgtLopUvlbUHSkzCCkxeVyXi8rUVIwf+P+OcNZ8DNKPH/27xc/zf5zVunVuwSJg== tarball: 'file:projects/storage-file.tgz' version: 0.0.0 'file:projects/storage-queue.tgz': @@ -10666,7 +10706,7 @@ packages: dev: false name: '@rush-temp/storage-queue' resolution: - integrity: sha512-vzHosalOlYTuZXeMq203NI3hVVkPV/Rj8pMvciVP7V52/pSocKHx69rO/ifHvBWzwQwLcJtCoQhxAkEGw9rVQA== + integrity: sha512-FrYcWgIUWbnLdsgPTJqK0xP9kS1ElkifwhzRZ7bC1w4T3wgGwbEleN+1weyt+79EatjIVSelsZTzX6tUuIwBEw== tarball: 'file:projects/storage-queue.tgz' version: 0.0.0 'file:projects/template.tgz': @@ -10717,7 +10757,7 @@ packages: dev: false name: '@rush-temp/template' resolution: - integrity: sha512-uPHAfdfuRcAzIkfBXfMawiZC8rXarqHPLodrKMLJX31JLlLIzdHXhHES0+bVNn2Jtse0erx0gNzWu2eAXTWEQA== + integrity: sha512-Ke/uOOWmrBKdkteo3wsma9x9Dda9mgqZLsDQTxXOG/YS2tBdKzf7kcQxZqjUBNnKCQXerpbu0/3YghicCc7NNA== tarball: 'file:projects/template.tgz' version: 0.0.0 'file:projects/testhub.tgz': @@ -10742,9 +10782,10 @@ packages: dev: false name: '@rush-temp/testhub' resolution: - integrity: sha512-udls4i3EzzYaovrHK3RsC59ihzLbrw1JnfrAHRexyiVwphcVtNtIVhQ9Taqy6wkdAInOARVYaq6O8OAIThAO1Q== + integrity: sha512-qcngMCJsJmX+G0stXZchWUI/WxyiMNfPI6MBDVbg/YMXc/lqEmttj/MghcZQiS+FMR859XarQzv5mfGa1q5DZQ== tarball: 'file:projects/testhub.tgz' version: 0.0.0 +registry: '' specifiers: '@azure/abort-controller': 1.0.0-preview.1 '@azure/amqp-common': 1.0.0-preview.6 @@ -10764,6 +10805,7 @@ specifiers: '@rush-temp/core-auth': 'file:./projects/core-auth.tgz' '@rush-temp/core-http': 'file:./projects/core-http.tgz' '@rush-temp/core-paging': 'file:./projects/core-paging.tgz' + '@rush-temp/core-tracing': 'file:./projects/core-tracing.tgz' '@rush-temp/cosmos': 'file:./projects/cosmos.tgz' '@rush-temp/event-hubs': 'file:./projects/event-hubs.tgz' '@rush-temp/event-processor-host': 'file:./projects/event-processor-host.tgz' diff --git a/rush.json b/rush.json index c78c9b81fc74..04313d963de4 100644 --- a/rush.json +++ b/rush.json @@ -401,6 +401,10 @@ { "packageName": "@azure/template", "projectFolder": "sdk/template/template" + }, + { + "packageName": "@azure/core-tracing", + "projectFolder": "sdk/core/core-tracing" } ] } diff --git a/sdk/core/core-tracing/Changelog.md b/sdk/core/core-tracing/Changelog.md new file mode 100644 index 000000000000..d73e414c1e49 --- /dev/null +++ b/sdk/core/core-tracing/Changelog.md @@ -0,0 +1,3 @@ +# 1.0.0-preview.1 5th August 2019 + +Provides low-level interfaces and helper methods for tracing in Azure SDK diff --git a/sdk/core/core-tracing/LICENSE.txt b/sdk/core/core-tracing/LICENSE.txt new file mode 100644 index 000000000000..21071075c245 --- /dev/null +++ b/sdk/core/core-tracing/LICENSE.txt @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission 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: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE 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 diff --git a/sdk/core/core-tracing/README.md b/sdk/core/core-tracing/README.md new file mode 100644 index 000000000000..e3e2ed80aa73 --- /dev/null +++ b/sdk/core/core-tracing/README.md @@ -0,0 +1,23 @@ +# Azure Core HTTP client library for JS + +This is the core HTTP pipeline for Azure SDK JavaScript libraries which work in the browser and Node.js. This library is primarily intended to be used in code generated by [AutoRest](https://github.com/Azure/Autorest). + +## Getting started + +Coming soon.... + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +If you'd like to contribute to this library, please read the [contributing guide](../../../CONTRIBUTING.md) to learn more about how to build and test the code. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/sdk/core/core-tracing/api-extractor.json b/sdk/core/core-tracing/api-extractor.json new file mode 100644 index 000000000000..ea431776e9eb --- /dev/null +++ b/sdk/core/core-tracing/api-extractor.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "types/index.d.ts", + "docModel": { + "enabled": false + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/core-tracing.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } + } + \ No newline at end of file diff --git a/sdk/core/core-tracing/lib/implementations/noop/spanNoOpImpl.ts b/sdk/core/core-tracing/lib/implementations/noop/spanNoOpImpl.ts new file mode 100644 index 000000000000..0b602b907960 --- /dev/null +++ b/sdk/core/core-tracing/lib/implementations/noop/spanNoOpImpl.ts @@ -0,0 +1,33 @@ +import { Span } from "../../interfaces/span"; +import { SpanContext } from "../../interfaces/span_context"; +import { Attributes } from "../../interfaces/attributes"; +import { Status } from "../../interfaces/status"; + +export class SpanNoOpImpl implements Span { + context(): SpanContext { + throw new Error("Method not implemented."); + } + setAttribute(key: string, value: unknown): this { + throw new Error("Method not implemented."); + } + setAttributes(attributes: Attributes): this { + throw new Error("Method not implemented."); + } + addEvent(name: string, attributes?: Attributes | undefined): this { + throw new Error("Method not implemented."); + } + addLink(spanContext: SpanContext, attributes?: Attributes | undefined): this { + throw new Error("Method not implemented."); + } + setStatus(status: Status): this { + throw new Error("Method not implemented."); + } + updateName(name: string): this { + throw new Error("Method not implemented."); + } + start(startTime?: number): void {} + end(endTime?: number): void {} + isRecordingEvents(): boolean { + throw new Error("Method not implemented."); + } +} diff --git a/sdk/core/core-tracing/lib/implementations/noop/tracerNoOpImpl.ts b/sdk/core/core-tracing/lib/implementations/noop/tracerNoOpImpl.ts new file mode 100644 index 000000000000..8d00b5392c39 --- /dev/null +++ b/sdk/core/core-tracing/lib/implementations/noop/tracerNoOpImpl.ts @@ -0,0 +1,25 @@ +import { Tracer } from "../../interfaces/tracer"; +import { SpanOptions } from "../../interfaces/SpanOptions"; +import { Span } from "../../interfaces/span"; +import { SpanNoOpImpl } from "./spanNoOpImpl"; + +export class TracerNoOpImpl implements Tracer { + getCurrentSpan(): Span { + throw new Error("Method not implemented."); + } + startSpan(name: string, options?: SpanOptions | undefined): Span { + return new SpanNoOpImpl(); + } + withSpan unknown>(span: Span, fn: T): ReturnType { + throw new Error("Method not implemented."); + } + recordSpanData(span: Span): void { + throw new Error("Method not implemented."); + } + getBinaryFormat(): unknown { + throw new Error("Method not implemented."); + } + getHttpTextFormat(): unknown { + throw new Error("Method not implemented."); + } +} diff --git a/sdk/core/core-tracing/lib/index.ts b/sdk/core/core-tracing/lib/index.ts new file mode 100644 index 000000000000..d8b06e6a3195 --- /dev/null +++ b/sdk/core/core-tracing/lib/index.ts @@ -0,0 +1,29 @@ +export { TracerProxy } from "./tracerProxy"; + +// Utils +export { SupportedPlugins } from "./utils/supportedPlugins"; + +// Plugins +export { NoOpSpanPlugin } from "./plugins/noop/noOpSpanPlugin"; +export { NoOpTracePlugin } from "./plugins/noop/noOpTracePlugin"; +export { OpenCensusSpanPlugin } from "./plugins/opencensus/openCensusSpanPlugin"; +export { OpenCensusTracePlugin } from "./plugins/opencensus/openCensusTracePlugin"; + +// Implementations +export { SpanNoOpImpl } from "./implementations/noop/spanNoOpImpl"; +export { TracerNoOpImpl } from "./implementations/noop/tracerNoOpImpl"; + +// Interfaces +export { Attributes } from "./interfaces/attributes"; +export { Event } from "./interfaces/Event"; +export { Link } from "./interfaces/link"; +export { Sampler } from "./interfaces/Sampler"; +export { SpanContext } from "./interfaces/span_context"; +export { SpanKind } from "./interfaces/span_kind"; +export { Span } from "./interfaces/span"; +export { SpanOptions } from "./interfaces/SpanOptions"; +export { Status, CanonicalCode } from "./interfaces/status"; +export { TimedEvent } from "./interfaces/TimedEvent"; +export { TraceOptions } from "./interfaces/trace_options"; +export { TraceState } from "./interfaces/trace_state"; +export { Tracer } from "./interfaces/tracer"; diff --git a/sdk/core/core-tracing/lib/interfaces/Event.ts b/sdk/core/core-tracing/lib/interfaces/Event.ts new file mode 100644 index 000000000000..ea21c330174a --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/Event.ts @@ -0,0 +1,25 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Attributes } from './attributes'; + +/** A text annotation with a set of attributes. */ +export interface Event { + /** The name of the event. */ + name: string; + /** The attributes of the event. */ + attributes?: Attributes; +} diff --git a/sdk/core/core-tracing/lib/interfaces/Sampler.ts b/sdk/core/core-tracing/lib/interfaces/Sampler.ts new file mode 100644 index 000000000000..ae4f3338ec86 --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/Sampler.ts @@ -0,0 +1,37 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SpanContext } from './span_context'; + +/** + * This interface represent a sampler. Sampling is a mechanism to control the + * noise and overhead introduced by OpenTelemetry by reducing the number of + * samples of traces collected and sent to the backend. + */ +export interface Sampler { + /** + * Checks whether span needs to be created and tracked. + * + * TODO: Consider to add required arguments https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/sampling-api.md#shouldsample + * @param [parentContext] Parent span context. Typically taken from the wire. + * Can be null. + * @returns whether span should be sampled or not. + */ + shouldSample(parentContext?: SpanContext): boolean; + + /** Returns the sampler name or short description with the configuration. */ + toString(): string; +} diff --git a/sdk/core/core-tracing/lib/interfaces/SpanOptions.ts b/sdk/core/core-tracing/lib/interfaces/SpanOptions.ts new file mode 100644 index 000000000000..602d07e10c24 --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/SpanOptions.ts @@ -0,0 +1,43 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Span } from './span'; +import { Attributes } from './attributes'; +import { SpanKind } from './span_kind'; +import { SpanContext } from './span_context'; + +/** + * Options needed for span creation + */ +export interface SpanOptions { + /** The SpanKind of a span */ + kind?: SpanKind; + + /** A spans attributes */ + attributes?: Attributes; + + /** Indicates that events are being recorded for a span */ + isRecordingEvents?: boolean; + + /** + * A parent SpanContext (or Span, for convenience) that the newly-started + * span will be the child of. + */ + parent?: Span | SpanContext; + + /** A manually specified start time for the created Span object. */ + startTime?: number; +} diff --git a/sdk/core/core-tracing/lib/interfaces/TimedEvent.ts b/sdk/core/core-tracing/lib/interfaces/TimedEvent.ts new file mode 100644 index 000000000000..3b46df2e87a6 --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/TimedEvent.ts @@ -0,0 +1,25 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Event } from './Event'; + +/** + * Represents a timed event. + * A timed event is an event with a timestamp. + */ +export interface TimedEvent extends Event { + time: number; +} diff --git a/sdk/core/core-tracing/lib/interfaces/attributes.ts b/sdk/core/core-tracing/lib/interfaces/attributes.ts new file mode 100644 index 000000000000..a9fecfac5f1a --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/attributes.ts @@ -0,0 +1,20 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Defines a attributes interface. */ +export interface Attributes { + [attributeKey: string]: unknown; +} diff --git a/sdk/core/core-tracing/lib/interfaces/link.ts b/sdk/core/core-tracing/lib/interfaces/link.ts new file mode 100644 index 000000000000..fadac28adf7f --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/link.ts @@ -0,0 +1,29 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Attributes } from './attributes'; +import { SpanContext } from './span_context'; + +/** + * A pointer from the current {@link Span} to another span in the same trace or + * in a different trace. + */ +export interface Link { + /** The {@link SpanContext} of a linked span. */ + spanContext: SpanContext; + /** A set of {@link Attributes} on the link. */ + attributes?: Attributes; +} diff --git a/sdk/core/core-tracing/lib/interfaces/span.ts b/sdk/core/core-tracing/lib/interfaces/span.ts new file mode 100644 index 000000000000..96304dd7c6c7 --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/span.ts @@ -0,0 +1,117 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Attributes } from "./attributes"; +import { SpanContext } from "./span_context"; +import { Status } from "./status"; + +/** + * An interface that represents a span. A span represents a single operation + * within a trace. Examples of span might include remote procedure calls or a + * in-process function calls to sub-components. A Trace has a single, top-level + * "root" Span that in turn may have zero or more child Spans, which in turn + * may have children. + */ +export interface Span { + /** + * Returns the {@link SpanContext} object associated with this Span. + * + * @returns the SpanContext object associated with this Span. + */ + context(): SpanContext; + + // /** + // * # TODO + // * Returns the Tracer object used to create this Span. + // * https://github.com/open-telemetry/opentelemetry-specification/issues/21 + // */ + // tracer(): Tracer; + + /** + * Sets an attribute to the span. + * + * @param key the key for this attribute. + * @param value the value for this attribute. + */ + setAttribute(key: string, value: unknown): this; + + /** + * Sets attributes to the span. + * + * @param attributes the attributes that will be added. + */ + setAttributes(attributes: Attributes): this; + + /** + * Adds an event to the Span. + * + * @param name the name of the event. + * @param [attributes] the attributes that will be added; these are + * associated with this event. + */ + addEvent(name: string, attributes?: Attributes): this; + + /** + * Adds a link to the Span. + * + * @param spanContext the context of the linked span. + * @param [attributes] the attributes that will be added; these are + * associated with this link. + */ + addLink(spanContext: SpanContext, attributes?: Attributes): this; + + /** + * Sets a status to the span. If used, this will override the default Span + * status. Default is {@link CanonicalCode.OK}. + * + * @param status the Status to set. + */ + setStatus(status: Status): this; + + /** + * Updates the Span name. + * + * TODO (revision): https://github.com/open-telemetry/opentelemetry-specification/issues/119 + * + * @param name the Span name. + */ + updateName(name: string): this; + + /** + * Marks the end of Span execution. + * + * Call to End of a Span MUST not have any effects on child spans. Those may + * still be running and can be ended later. + * + * Do not return `this`. The Span generally should not be used after it + * is ended so chaining is not desired in this context. + * + * @param [endTime] the timestamp to set as Span's end time. If not provided, + * use the current time as the span's end time. + * TODO (Add timestamp format): https://github.com/open-telemetry/opentelemetry-js/issues/19 + */ + end(endTime?: number): void; + + start(startTime?: number): void; + + /** + * Returns the flag whether this span will be recorded. + * + * @returns true if this Span is active and recording information like events + * with the AddEvent operation and attributes using setAttributes. + */ + isRecordingEvents(): boolean; +} diff --git a/sdk/core/core-tracing/lib/interfaces/span_context.ts b/sdk/core/core-tracing/lib/interfaces/span_context.ts new file mode 100644 index 000000000000..c67602a25d78 --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/span_context.ts @@ -0,0 +1,66 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TraceOptions } from './trace_options'; +import { TraceState } from './trace_state'; + +/** + * A SpanContext represents the portion of a {@link Span} which must be + * serialized and propagated along side of a distributed context. + */ +export interface SpanContext { + /** + * The ID of the trace that this span belongs to. It is worldwide unique + * with practically sufficient probability by being made as 16 randomly + * generated bytes, encoded as a 32 lowercase hex characters corresponding to + * 128 bits. + */ + traceId: string; + /** + * The ID of the Span. It is globally unique with practically sufficient + * probability by being made as 8 randomly generated bytes, encoded as a 16 + * lowercase hex characters corresponding to 64 bits. + */ + spanId: string; + /** + * Trace options to propagate. + * + * It is represented as 1 byte (bitmap). Bit to represent whether trace is + * sampled or not. When set, the least significant bit documents that the + * caller may have recorded trace data. A caller who does not record trace + * data out-of-band leaves this flag unset. + * + * SAMPLED = 0x1 and UNSAMPLED = 0x0; + */ + traceOptions?: TraceOptions; + /** + * Tracing-system-specific info to propagate. + * + * The tracestate field value is a `list` as defined below. The `list` is a + * series of `list-members` separated by commas `,`, and a list-member is a + * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs + * surrounding `list-members` are ignored. There can be a maximum of 32 + * `list-members` in a `list`. + * More Info: https://www.w3.org/TR/trace-context/#tracestate-field + * + * Examples: + * Single tracing system (generic format): + * tracestate: rojo=00f067aa0ba902b7 + * Multiple tracing systems (with different formatting): + * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE + */ + traceState?: TraceState; +} diff --git a/sdk/core/core-tracing/lib/interfaces/span_kind.ts b/sdk/core/core-tracing/lib/interfaces/span_kind.ts new file mode 100644 index 000000000000..688650f2beb6 --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/span_kind.ts @@ -0,0 +1,50 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Type of span. Can be used to specify additional relationships between spans + * in addition to a parent/child relationship. + */ +export enum SpanKind { + /** Default value. Indicates that the span is used internally. */ + INTERNAL = 0, + + /** + * Indicates that the span covers server-side handling of an RPC or other + * remote request. + */ + SERVER = 1, + + /** + * Indicates that the span covers the client-side wrapper around an RPC or + * other remote request. + */ + CLIENT = 2, + + /** + * Indicates that the span describes producer sending a message to a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + PRODUCER = 3, + + /** + * Indicates that the span describes consumer receiving a message from a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + CONSUMER = 4, +} diff --git a/sdk/core/core-tracing/lib/interfaces/status.ts b/sdk/core/core-tracing/lib/interfaces/status.ts new file mode 100644 index 000000000000..be84093ce18d --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/status.ts @@ -0,0 +1,165 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The status of a Span by providing a standard CanonicalCode in conjunction + * with an optional descriptive message. + */ +export interface Status { + /** The canonical code of this message. */ + code: CanonicalCode; + /** A developer-facing error message. */ + message?: string; +} + +/** + * An enumeration of canonical status codes. + * + * TODO (revision): https://github.com/open-telemetry/opentelemetry-specification/issues/59 + */ +export enum CanonicalCode { + /** + * Not an error; returned on success + */ + OK = 0, + /** + * The operation was cancelled (typically by the caller). + */ + CANCELLED = 1, + /** + * Unknown error. An example of where this error may be returned is + * if a status value received from another address space belongs to + * an error-space that is not known in this address space. Also + * errors raised by APIs that do not return enough error information + * may be converted to this error. + */ + UNKNOWN = 2, + /** + * Client specified an invalid argument. Note that this differs + * from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments + * that are problematic regardless of the state of the system + * (e.g., a malformed file name). + */ + INVALID_ARGUMENT = 3, + /** + * Deadline expired before operation could complete. For operations + * that change the state of the system, this error may be returned + * even if the operation has completed successfully. For example, a + * successful response from a server could have been delayed long + * enough for the deadline to expire. + */ + DEADLINE_EXCEEDED = 4, + /** + * Some requested entity (e.g., file or directory) was not found. + */ + NOT_FOUND = 5, + /** + * Some entity that we attempted to create (e.g., file or directory) + * already exists. + */ + ALREADY_EXISTS = 6, + /** + * The caller does not have permission to execute the specified + * operation. PERMISSION_DENIED must not be used for rejections + * caused by exhausting some resource (use RESOURCE_EXHAUSTED + * instead for those errors). PERMISSION_DENIED must not be + * used if the caller can not be identified (use UNAUTHENTICATED + * instead for those errors). + */ + PERMISSION_DENIED = 7, + /** + * Some resource has been exhausted, perhaps a per-user quota, or + * perhaps the entire file system is out of space. + */ + RESOURCE_EXHAUSTED = 8, + /** + * Operation was rejected because the system is not in a state + * required for the operation's execution. For example, directory + * to be deleted may be non-empty, an rmdir operation is applied to + * a non-directory, etc. + * + * A litmus test that may help a service implementor in deciding + * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE: + * + * - Use UNAVAILABLE if the client can retry just the failing call. + * - Use ABORTED if the client should retry at a higher-level + * (e.g., restarting a read-modify-write sequence). + * - Use FAILED_PRECONDITION if the client should not retry until + * the system state has been explicitly fixed. E.g., if an "rmdir" + * fails because the directory is non-empty, FAILED_PRECONDITION + * should be returned since the client should not retry unless + * they have first fixed up the directory by deleting files from it. + * - Use FAILED_PRECONDITION if the client performs conditional + * REST Get/Update/Delete on a resource and the resource on the + * server does not match the condition. E.g., conflicting + * read-modify-write on the same resource. + */ + FAILED_PRECONDITION = 9, + /** + * The operation was aborted, typically due to a concurrency issue + * like sequencer check failures, transaction aborts, etc. + * + * See litmus test above for deciding between FAILED_PRECONDITION, + * ABORTED, and UNAVAILABLE. + */ + ABORTED = 10, + /** + * Operation was attempted past the valid range. E.g., seeking or + * reading past end of file. + * + * Unlike INVALID_ARGUMENT, this error indicates a problem that may + * be fixed if the system state changes. For example, a 32-bit file + * system will generate INVALID_ARGUMENT if asked to read at an + * offset that is not in the range [0,2^32-1], but it will generate + * OUT_OF_RANGE if asked to read from an offset past the current + * file size. + * + * There is a fair bit of overlap between FAILED_PRECONDITION and + * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific + * error) when it applies so that callers who are iterating through + * a space can easily look for an OUT_OF_RANGE error to detect when + * they are done. + */ + OUT_OF_RANGE = 11, + /** + * Operation is not implemented or not supported/enabled in this service. + */ + UNIMPLEMENTED = 12, + /** + * Internal errors. Means some invariants expected by underlying + * system has been broken. If you see one of these errors, + * something is very broken. + */ + INTERNAL = 13, + /** + * The service is currently unavailable. This is a most likely a + * transient condition and may be corrected by retrying with + * a backoff. + * + * See litmus test above for deciding between FAILED_PRECONDITION, + * ABORTED, and UNAVAILABLE. + */ + UNAVAILABLE = 14, + /** + * Unrecoverable data loss or corruption. + */ + DATA_LOSS = 15, + /** + * The request does not have valid authentication credentials for the + * operation. + */ + UNAUTHENTICATED = 16, +} diff --git a/sdk/core/core-tracing/lib/interfaces/trace_options.ts b/sdk/core/core-tracing/lib/interfaces/trace_options.ts new file mode 100644 index 000000000000..2bad26194d26 --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/trace_options.ts @@ -0,0 +1,27 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * An enumeration that represents global trace options. These options are + * propagated to all child {@link Span}. These determine features such as + * whether a Span should be traced. It is implemented as a bitmask. + */ +export enum TraceOptions { + /** Bit to represent whether trace is unsampled in trace options. */ + UNSAMPLED = 0x0, + /** Bit to represent whether trace is sampled in trace options. */ + SAMPLED = 0x1, +} diff --git a/sdk/core/core-tracing/lib/interfaces/trace_state.ts b/sdk/core/core-tracing/lib/interfaces/trace_state.ts new file mode 100644 index 000000000000..78561119a426 --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/trace_state.ts @@ -0,0 +1,63 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Tracestate carries system-specific configuration data, represented as a list + * of key-value pairs. TraceState allows multiple tracing systems to + * participate in the same trace. + */ +export interface TraceState { + /** + * Adds or updates the TraceState that has the given `key` if it is + * present. The new State will always be added in the front of the + * list of states. + * + * @param key key of the TraceState entry. + * @param value value of the TraceState entry. + */ + set(key: string, value: string): void; + + /** + * Removes the TraceState Entry that has the given `key` if it is present. + * + * @param key the key for the TraceState Entry to be removed. + */ + unset(key: string): void; + + /** + * Returns the value to which the specified key is mapped, or `undefined` if + * this map contains no mapping for the key. + * + * @param key with which the specified value is to be associated. + * @returns the value to which the specified key is mapped, or `undefined` if + * this map contains no mapping for the key. + */ + get(key: string): string | undefined; + + // TODO: Consider to add support for merging an object as well by also + // accepting a single internalTraceState argument similar to the constructor. + + /** + * Serializes the TraceState to a `list` as defined below. The `list` is a + * series of `list-members` separated by commas `,`, and a list-member is a + * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs + * surrounding `list-members` are ignored. There can be a maximum of 32 + * `list-members` in a `list`. + * + * @returns the serialized string. + */ + serialize(): string; +} diff --git a/sdk/core/core-tracing/lib/interfaces/tracer.ts b/sdk/core/core-tracing/lib/interfaces/tracer.ts new file mode 100644 index 000000000000..bec95f236048 --- /dev/null +++ b/sdk/core/core-tracing/lib/interfaces/tracer.ts @@ -0,0 +1,92 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Span } from './span'; +import { SpanOptions } from './SpanOptions'; + +/** + * Tracer provides an interface for creating {@link Span}s and propagating + * context in-process. + * + * Users may choose to use manual or automatic Context propagation. Because of + * that this class offers APIs to facilitate both usages. + */ +export interface Tracer { + /** + * Returns the current Span from the current context if available. + * + * If there is no Span associated with the current context, a default Span + * with invalid SpanContext is returned. + * + * @returns Span The currently active Span + */ + getCurrentSpan(): Span; + + /** + * Starts a new {@link Span}. + * @param name The name of the span + * @param [options] SpanOptions used for span creation + * @returns Span The newly created span + */ + startSpan(name: string, options?: SpanOptions): Span; + + /** + * Executes the function given by fn within the context provided by Span + * + * @param span The span that provides the context + * @param fn The function to be eexcuted inside the provided context + */ + withSpan unknown>( + span: Span, + fn: T + ): ReturnType; + + /** + * Send a pre-populated span object to the exporter. + * Sampling and recording decisions as well as other collection optimizations + * are the responsibility of a caller. + * + * @todo: Pending API discussion. Revisit if Span or SpanData should be passed + * in here once this is sorted out. + * @param span Span Data to be reported to all exporters. + */ + recordSpanData(span: Span): void; + + /** + * Returns the {@link BinaryFormat} interface which can serialize/deserialize + * Spans. + * + * If no tracer implementation is provided, this defaults to the W3C Trace + * Context binary format ({@link BinaryFormat}). For more details see + * W3C Trace Context + * binary protocol. + * + * @todo: Change return type once BinaryFormat is available + */ + getBinaryFormat(): unknown; + + /** + * Returns the {@link HttpTextFormat} interface which can inject/extract + * Spans. + * + * If no tracer implementation is provided, this defaults to the W3C Trace + * Context HTTP text format ({@link HttpTraceContext}). For more details see + * W3C Trace Context. + * + * @todo: Change return type once HttpTextFormat is available + */ + getHttpTextFormat(): unknown; +} diff --git a/sdk/core/core-tracing/lib/plugins/noop/noOpSpanPlugin.ts b/sdk/core/core-tracing/lib/plugins/noop/noOpSpanPlugin.ts new file mode 100644 index 000000000000..11d96ac5edc4 --- /dev/null +++ b/sdk/core/core-tracing/lib/plugins/noop/noOpSpanPlugin.ts @@ -0,0 +1,52 @@ +import { Span } from "../../interfaces/span"; +import { SpanContext } from "../../interfaces/span_context"; +import { Attributes } from "../../interfaces/attributes"; +import { Status } from "../../interfaces/status"; + +export class NoOpSpanPlugin implements Span { + private _span: any; + + constructor(span: any) { + this._span = span; + } + + context(): SpanContext { + throw new Error("Method not implemented."); + } + + end(endTime?: number): void { + this._span.end(endTime); + } + + start(startTime?: number): void { + this._span.start(startTime); + } + + setAttribute(key: string, value: unknown): this { + throw new Error("Method not implemented."); + } + + setAttributes(attributes: Attributes): this { + throw new Error("Method not implemented."); + } + + addEvent(name: string, attributes?: Attributes): this { + throw new Error("Method not implemented."); + } + + addLink(spanContext: SpanContext, attributes?: Attributes): this { + throw new Error("Method not implemented."); + } + + setStatus(status: Status): this { + throw new Error("Method not implemented."); + } + + updateName(name: string): this { + throw new Error("Method not implemented."); + } + + isRecordingEvents(): boolean { + throw new Error("Method not implemented."); + } +} diff --git a/sdk/core/core-tracing/lib/plugins/noop/noOpTracePlugin.ts b/sdk/core/core-tracing/lib/plugins/noop/noOpTracePlugin.ts new file mode 100644 index 000000000000..4161a78f3dd7 --- /dev/null +++ b/sdk/core/core-tracing/lib/plugins/noop/noOpTracePlugin.ts @@ -0,0 +1,35 @@ +import { Tracer } from "../../interfaces/tracer"; +import { Span } from "../../interfaces/span"; +import { SpanOptions } from "../../interfaces/SpanOptions"; +import { NoOpSpanPlugin } from "./noOpSpanPlugin"; +import { SpanNoOpImpl } from "../../implementations/noop/spanNoOpImpl"; + +export class NoOpTracePlugin implements Tracer { + private _tracer: any; + + public constructor(tracer: any) { + this._tracer = tracer; + } + + startSpan(name: string, options?: SpanOptions): Span { + const span = new SpanNoOpImpl(); + const noOpSpanPlugin = new NoOpSpanPlugin(span); + return noOpSpanPlugin; + } + + getCurrentSpan(): Span { + throw new Error("Method not implemented."); + } + withSpan unknown>(span: Span, fn: T): ReturnType { + throw new Error("Method not implemented."); + } + recordSpanData(span: Span): void { + throw new Error("Method not implemented."); + } + getBinaryFormat(): unknown { + throw new Error("Method not implemented."); + } + getHttpTextFormat(): unknown { + throw new Error("Method not implemented."); + } +} diff --git a/sdk/core/core-tracing/lib/plugins/opencensus/openCensusSpanPlugin.ts b/sdk/core/core-tracing/lib/plugins/opencensus/openCensusSpanPlugin.ts new file mode 100644 index 000000000000..1e3aa3f5669a --- /dev/null +++ b/sdk/core/core-tracing/lib/plugins/opencensus/openCensusSpanPlugin.ts @@ -0,0 +1,61 @@ +import { Span } from "../../interfaces/span"; +import { SpanContext } from "../../interfaces/span_context"; +import { Attributes } from "../../interfaces/attributes"; +import { Status } from "../../interfaces/status"; + +export class OpenCensusSpanPlugin implements Span { + private _span: any; + + public getSpan() { + return this._span; + } + + constructor(span: any) { + this._span = span; + } + + end(endTime?: number): void { + this._span.end(endTime); + } + + start(startTime?: number): void { + this._span.start(startTime); + } + + context(): SpanContext { + throw new Error("Method not implemented."); + } + + setAttribute(key: string, value: unknown): this { + this._span.addAttribute(key, value); + return this; + } + + setAttributes(attributes: Attributes): this { + throw new Error("Method not implemented."); + } + + addEvent(name: string, attributes?: Attributes): this { + throw new Error("Method not implemented."); + } + + addLink(spanContext: SpanContext, attributes?: Attributes): this { + // Since there is no way to specify the link relationship + // It is set as Unspecified = 0 + this._span.addLink(spanContext.traceId, spanContext.spanId, 0, attributes); + return this; + } + + setStatus(status: Status): this { + this._span.setStatus(status.code, status.message); + return this; + } + + updateName(name: string): this { + throw new Error("Method not implemented."); + } + + isRecordingEvents(): boolean { + throw new Error("Method not implemented."); + } +} diff --git a/sdk/core/core-tracing/lib/plugins/opencensus/openCensusTracePlugin.ts b/sdk/core/core-tracing/lib/plugins/opencensus/openCensusTracePlugin.ts new file mode 100644 index 000000000000..1e1cdb086156 --- /dev/null +++ b/sdk/core/core-tracing/lib/plugins/opencensus/openCensusTracePlugin.ts @@ -0,0 +1,47 @@ +import { Tracer } from "../../interfaces/tracer"; +import { SpanOptions } from "../../interfaces/SpanOptions"; +import { Span } from "../../interfaces/span"; +import { OpenCensusSpanPlugin } from "../opencensus/openCensusSpanPlugin"; + +export class OpenCensusTracePlugin implements Tracer { + private _tracer: any; + + public constructor(tracer: any) { + this._tracer = tracer; + } + + startSpan(name: string, options?: SpanOptions): Span { + const parent = options + ? options.parent + ? options.parent instanceof OpenCensusSpanPlugin + ? options.parent.getSpan() + : options.parent + : undefined + : undefined; + + const span = this._tracer.startChildSpan({ + name: name, + childOf: parent + }); + + const openCensusSpanPlugin = new OpenCensusSpanPlugin(span); + return openCensusSpanPlugin; + } + + getCurrentSpan(): Span { + throw new Error("Method not implemented."); + } + + withSpan unknown>(span: Span, fn: T): ReturnType { + throw new Error("Method not implemented."); + } + recordSpanData(span: Span): void { + throw new Error("Method not implemented."); + } + getBinaryFormat(): unknown { + throw new Error("Method not implemented."); + } + getHttpTextFormat(): unknown { + throw new Error("Method not implemented."); + } +} diff --git a/sdk/core/core-tracing/lib/tracerProxy.ts b/sdk/core/core-tracing/lib/tracerProxy.ts new file mode 100644 index 000000000000..627acfe682de --- /dev/null +++ b/sdk/core/core-tracing/lib/tracerProxy.ts @@ -0,0 +1,26 @@ +import { SupportedPlugins } from "./utils/supportedPlugins"; +import { OpenCensusTracePlugin } from "./plugins/opencensus/openCensusTracePlugin"; +import { NoOpTracePlugin } from "./plugins/noop/noOpTracePlugin"; +import { TracerNoOpImpl } from "./implementations/noop/tracerNoOpImpl"; +import { Tracer } from "./interfaces/tracer"; + +export class TracerProxy { + private static _tracerPlugin: Tracer; + + private constructor() {} + + public static setTracer(tracer: any, tracerPluginType: SupportedPlugins) { + if (tracerPluginType === SupportedPlugins.OPENCENSUS) { + TracerProxy._tracerPlugin = new OpenCensusTracePlugin(tracer); + } else { + TracerProxy._tracerPlugin = new NoOpTracePlugin(tracer); + } + } + + public static getTracer() { + if (!TracerProxy._tracerPlugin) { + TracerProxy._tracerPlugin = new NoOpTracePlugin(new TracerNoOpImpl()); + } + return TracerProxy._tracerPlugin; + } +} diff --git a/sdk/core/core-tracing/lib/utils/supportedPlugins.ts b/sdk/core/core-tracing/lib/utils/supportedPlugins.ts new file mode 100644 index 000000000000..5eaeba3b2c20 --- /dev/null +++ b/sdk/core/core-tracing/lib/utils/supportedPlugins.ts @@ -0,0 +1,4 @@ +export enum SupportedPlugins { + OPENCENSUS, + NOOP +} diff --git a/sdk/core/core-tracing/package.json b/sdk/core/core-tracing/package.json new file mode 100644 index 000000000000..ae0de01db51e --- /dev/null +++ b/sdk/core/core-tracing/package.json @@ -0,0 +1,95 @@ +{ + "name": "@azure/core-tracing", + "version": "1.0.0-preview.1", + "description": "Provides low-level interfaces and helper methods for tracing in Azure SDK", + "sdk-type": "client", + "main": "dist/index.js", + "module": "dist-esm/index.js", + "browser": { + "./dist/index.js": "./browser/index.js" + }, + "types": "types/core-tracing.d.ts", + "scripts": { + "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", + "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", + "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1", + "build:samples": "cd samples && tsc -p .", + "build:test": "tsc -p . && rollup -c rollup.test.config.js 2>&1", + "build": "tsc -p . && rollup -c 2>&1 && api-extractor run --local", + "check-format": "prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "clean": "rimraf dist dist-esm test-dist types *.tgz *.log", + "extract-api": "tsc -p . && api-extractor run --local", + "format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "lint:fix": "eslint \"src/**/*.ts\" \"test/**/*.ts\" -c ../../.eslintrc.json --fix --fix-type [problem,suggestion]", + "lint": "eslint -c ../../.eslintrc.json src test --ext .ts -f node_modules/eslint-detailed-reporter/lib/detailed.js -o template-lintReport.html || exit 0", + "pack": "npm pack 2>&1", + "prebuild": "npm run clean", + "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node", + "test": "npm run build:test && npm run unit-test && npm run integration-test", + "unit-test:browser": "echo skipped", + "unit-test:node": "mocha test-dist/**/*.js --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=-", + "unit-test": "npm run unit-test:node && npm run unit-test:browser" + }, + "files": [ + "browser/*.js*", + "dist/", + "dist-esm/", + "src/", + "types/core-tracing.d.ts" + ], + "repository": "github:Azure/azure-sdk-for-js", + "keywords": [ + "azure", + "tracing" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "engine": { + "node": ">=6.0.0" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/core/core-tracing", + "sideEffects": false, + "private": true, + "dependencies": { + "tslib": "^1.9.3" + }, + "devDependencies": { + "@microsoft/api-extractor": "^7.1.5", + "@types/mocha": "^5.2.5", + "@types/node": "^8.0.0", + "@typescript-eslint/eslint-plugin": "^1.11.0", + "@typescript-eslint/parser": "^1.11.0", + "assert": "^1.4.1", + "cross-env": "^5.2.0", + "eslint": "^5.16.0", + "eslint-config-prettier": "^4.2.0", + "eslint-detailed-reporter": "^0.8.0", + "eslint-plugin-no-null": "^1.0.2", + "eslint-plugin-no-only-tests": "^2.3.0", + "eslint-plugin-promise": "^4.1.1", + "inherits": "^2.0.3", + "mocha": "^5.2.0", + "mocha-junit-reporter": "^1.18.0", + "mocha-multi": "^1.0.1", + "prettier": "^1.16.4", + "rimraf": "^2.6.2", + "rollup": "^1.16.3", + "rollup-plugin-commonjs": "^10.0.0", + "rollup-plugin-json": "^4.0.0", + "rollup-plugin-multi-entry": "^2.1.0", + "rollup-plugin-node-resolve": "^5.0.2", + "rollup-plugin-replace": "^2.1.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "rollup-plugin-terser": "^5.1.1", + "rollup-plugin-visualizer": "^2.0.0", + "typescript": "^3.2.2", + "util": "^0.12.1" + } +} diff --git a/sdk/core/core-tracing/review/core-tracing.api.md b/sdk/core/core-tracing/review/core-tracing.api.md new file mode 100644 index 000000000000..adb07cd6f2e4 --- /dev/null +++ b/sdk/core/core-tracing/review/core-tracing.api.md @@ -0,0 +1,274 @@ +## API Report File for "@azure/core-tracing" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export interface Attributes { + // (undocumented) + [attributeKey: string]: unknown; +} + +// @public +export enum CanonicalCode { + ABORTED = 10, + ALREADY_EXISTS = 6, + CANCELLED = 1, + DATA_LOSS = 15, + DEADLINE_EXCEEDED = 4, + FAILED_PRECONDITION = 9, + INTERNAL = 13, + INVALID_ARGUMENT = 3, + NOT_FOUND = 5, + OK = 0, + OUT_OF_RANGE = 11, + PERMISSION_DENIED = 7, + RESOURCE_EXHAUSTED = 8, + UNAUTHENTICATED = 16, + UNAVAILABLE = 14, + UNIMPLEMENTED = 12, + UNKNOWN = 2 +} + +// @public +export interface Event { + attributes?: Attributes; + name: string; +} + +// @public +export interface Link { + attributes?: Attributes; + spanContext: SpanContext; +} + +// @public (undocumented) +export class NoOpSpanPlugin implements Span { + constructor(span: any); + // (undocumented) + addEvent(name: string, attributes?: Attributes): this; + // (undocumented) + addLink(spanContext: SpanContext, attributes?: Attributes): this; + // (undocumented) + context(): SpanContext; + // (undocumented) + end(endTime?: number): void; + // (undocumented) + isRecordingEvents(): boolean; + // (undocumented) + setAttribute(key: string, value: unknown): this; + // (undocumented) + setAttributes(attributes: Attributes): this; + // (undocumented) + setStatus(status: Status): this; + // (undocumented) + start(startTime?: number): void; + // (undocumented) + updateName(name: string): this; +} + +// @public (undocumented) +export class NoOpTracePlugin implements Tracer { + constructor(tracer: any); + // (undocumented) + getBinaryFormat(): unknown; + // (undocumented) + getCurrentSpan(): Span; + // (undocumented) + getHttpTextFormat(): unknown; + // (undocumented) + recordSpanData(span: Span): void; + // (undocumented) + startSpan(name: string, options?: SpanOptions): Span; + // (undocumented) + withSpan unknown>(span: Span, fn: T): ReturnType; +} + +// @public (undocumented) +export class OpenCensusSpanPlugin implements Span { + constructor(span: any); + // (undocumented) + addEvent(name: string, attributes?: Attributes): this; + // (undocumented) + addLink(spanContext: SpanContext, attributes?: Attributes): this; + // (undocumented) + context(): SpanContext; + // (undocumented) + end(endTime?: number): void; + // (undocumented) + getSpan(): any; + // (undocumented) + isRecordingEvents(): boolean; + // (undocumented) + setAttribute(key: string, value: unknown): this; + // (undocumented) + setAttributes(attributes: Attributes): this; + // (undocumented) + setStatus(status: Status): this; + // (undocumented) + start(startTime?: number): void; + // (undocumented) + updateName(name: string): this; +} + +// @public (undocumented) +export class OpenCensusTracePlugin implements Tracer { + constructor(tracer: any); + // (undocumented) + getBinaryFormat(): unknown; + // (undocumented) + getCurrentSpan(): Span; + // (undocumented) + getHttpTextFormat(): unknown; + // (undocumented) + recordSpanData(span: Span): void; + // (undocumented) + startSpan(name: string, options?: SpanOptions): Span; + // (undocumented) + withSpan unknown>(span: Span, fn: T): ReturnType; +} + +// @public +export interface Sampler { + shouldSample(parentContext?: SpanContext): boolean; + toString(): string; +} + +// @public +export interface Span { + addEvent(name: string, attributes?: Attributes): this; + addLink(spanContext: SpanContext, attributes?: Attributes): this; + context(): SpanContext; + end(endTime?: number): void; + isRecordingEvents(): boolean; + setAttribute(key: string, value: unknown): this; + setAttributes(attributes: Attributes): this; + setStatus(status: Status): this; + // (undocumented) + start(startTime?: number): void; + updateName(name: string): this; +} + +// @public +export interface SpanContext { + spanId: string; + traceId: string; + traceOptions?: TraceOptions; + traceState?: TraceState; +} + +// @public +export enum SpanKind { + CLIENT = 2, + CONSUMER = 4, + INTERNAL = 0, + PRODUCER = 3, + SERVER = 1 +} + +// @public (undocumented) +export class SpanNoOpImpl implements Span { + // (undocumented) + addEvent(name: string, attributes?: Attributes | undefined): this; + // (undocumented) + addLink(spanContext: SpanContext, attributes?: Attributes | undefined): this; + // (undocumented) + context(): SpanContext; + // (undocumented) + end(endTime?: number): void; + // (undocumented) + isRecordingEvents(): boolean; + // (undocumented) + setAttribute(key: string, value: unknown): this; + // (undocumented) + setAttributes(attributes: Attributes): this; + // (undocumented) + setStatus(status: Status): this; + // (undocumented) + start(startTime?: number): void; + // (undocumented) + updateName(name: string): this; +} + +// @public +export interface SpanOptions { + attributes?: Attributes; + isRecordingEvents?: boolean; + kind?: SpanKind; + parent?: Span | SpanContext; + startTime?: number; +} + +// @public +export interface Status { + code: CanonicalCode; + message?: string; +} + +// @public (undocumented) +export enum SupportedPlugins { + // (undocumented) + NOOP = 1, + // (undocumented) + OPENCENSUS = 0 +} + +// @public +export interface TimedEvent extends Event { + // (undocumented) + time: number; +} + +// @public +export enum TraceOptions { + SAMPLED = 1, + UNSAMPLED = 0 +} + +// @public +export interface Tracer { + getBinaryFormat(): unknown; + getCurrentSpan(): Span; + getHttpTextFormat(): unknown; + recordSpanData(span: Span): void; + startSpan(name: string, options?: SpanOptions): Span; + withSpan unknown>(span: Span, fn: T): ReturnType; +} + +// @public (undocumented) +export class TracerNoOpImpl implements Tracer { + // (undocumented) + getBinaryFormat(): unknown; + // (undocumented) + getCurrentSpan(): Span; + // (undocumented) + getHttpTextFormat(): unknown; + // (undocumented) + recordSpanData(span: Span): void; + // (undocumented) + startSpan(name: string, options?: SpanOptions | undefined): Span; + // (undocumented) + withSpan unknown>(span: Span, fn: T): ReturnType; +} + +// @public (undocumented) +export class TracerProxy { + // (undocumented) + static getTracer(): Tracer; + // (undocumented) + static setTracer(tracer: any, tracerPluginType: SupportedPlugins): void; + } + +// @public +export interface TraceState { + get(key: string): string | undefined; + serialize(): string; + set(key: string, value: string): void; + unset(key: string): void; +} + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/core/core-tracing/rollup.base.config.js b/sdk/core/core-tracing/rollup.base.config.js new file mode 100644 index 000000000000..4697560724a9 --- /dev/null +++ b/sdk/core/core-tracing/rollup.base.config.js @@ -0,0 +1,105 @@ +import nodeResolve from "rollup-plugin-node-resolve"; +import multiEntry from "rollup-plugin-multi-entry"; +import cjs from "rollup-plugin-commonjs"; +import replace from "rollup-plugin-replace"; +import { terser } from "rollup-plugin-terser"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import viz from "rollup-plugin-visualizer"; + +const pkg = require("./package.json"); +const depNames = Object.keys(pkg.dependencies); +const input = "dist-esm/index.js"; +const production = process.env.NODE_ENV === "production"; + +export function nodeConfig(test = false) { + const externalNodeBuiltins = ["events"]; + const baseConfig = { + input: input, + external: depNames.concat(externalNodeBuiltins), + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [ + sourcemaps(), + replace({ + delimiters: ["", ""], + values: { + // replace dynamic checks with if (true) since this is for node only. + // Allows rollup's dead code elimination to be more aggressive. + "if (isNode)": "if (true)" + } + }), + nodeResolve({ preferBuiltins: true }), + cjs() + ] + }; + + if (test) { + // entry point is every test file + baseConfig.input = "dist-esm/test/**/*.spec.js"; + baseConfig.plugins.unshift(multiEntry({ exports: false })); + + // different output file + baseConfig.output.file = "test-dist/index.js"; + + // mark assert as external + baseConfig.external.push("assert"); + + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, rollup started respecting + // the "sideEffects" field in package.json. Since our package.json sets "sideEffects=false", this also + // applies to test code, which causes all tests to be removed by tree-shaking. + baseConfig.treeshake = false; + } else if (production) { + baseConfig.plugins.push(terser()); + } + + return baseConfig; +} + +export function browserConfig(test = false, production = false) { + const baseConfig = { + input: input, + output: { + file: "browser/core-tracing.js", + format: "umd", + name: "Azure.Core.Tracing", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + sourcemaps(), + replace({ + delimiters: ["", ""], + values: { + // replace dynamic checks with if (false) since this is for + // browser only. Rollup's dead code elimination will remove + // any code guarded by if (isNode) { ... } + "if (isNode)": "if (false)" + } + }), + nodeResolve({ + mainFields: ['module', 'browser'], + preferBuiltins: false + }), + cjs({ + namedExports: { events: ["EventEmitter"] } + }), + viz({ filename: "browser/browser-stats.html", sourcemap: false }) + ] + }; + + if (test) { + baseConfig.input = "dist-esm/test/**/*.spec.js"; + baseConfig.plugins.unshift(multiEntry({ exports: false })); + baseConfig.output.file = "test-browser/index.js"; + + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, rollup started respecting + // the "sideEffects" field in package.json. Since our package.json sets "sideEffects=false", this also + // applies to test code, which causes all tests to be removed by tree-shaking. + baseConfig.treeshake = false; + } else if (production) { + baseConfig.output.file = "browser/core-tracing.min.js"; + baseConfig.plugins.push(terser()); + } + + return baseConfig; +} diff --git a/sdk/core/core-tracing/rollup.config.js b/sdk/core/core-tracing/rollup.config.js new file mode 100644 index 000000000000..49a26bd6fdd6 --- /dev/null +++ b/sdk/core/core-tracing/rollup.config.js @@ -0,0 +1,14 @@ +import * as base from "./rollup.base.config"; + +const inputs = []; + +if (!process.env.ONLY_BROWSER) { + inputs.push(base.nodeConfig()); +} + +if (!process.env.ONLY_NODE) { + inputs.push(base.browserConfig()); + inputs.push(base.browserConfig(false, true)); +} + +export default inputs; diff --git a/sdk/core/core-tracing/rollup.test.config.js b/sdk/core/core-tracing/rollup.test.config.js new file mode 100644 index 000000000000..069a53566909 --- /dev/null +++ b/sdk/core/core-tracing/rollup.test.config.js @@ -0,0 +1,3 @@ +import * as base from "./rollup.base.config"; + +export default [base.nodeConfig(true), base.browserConfig(true)]; \ No newline at end of file diff --git a/sdk/core/core-tracing/tsconfig.json b/sdk/core/core-tracing/tsconfig.json new file mode 100644 index 000000000000..2e1218772c63 --- /dev/null +++ b/sdk/core/core-tracing/tsconfig.json @@ -0,0 +1,61 @@ +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */, + "module": "es6" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, + // "lib": [], /* Specify library files to be included in the compilation. */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + "declaration": true /* Generates corresponding '.d.ts' file. */, + "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, + "declarationDir": "./types" /* Output directory for generated declaration files.*/, + "sourceMap": true /* Generates corresponding '.map' file. */, + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "./dist-esm" /* Redirect output structure to the directory. */, + // "rootDir": "." /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, + // "composite": true, /* Enable project compilation */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + "importHelpers": true /* Import emit helpers from 'tslib'. */, + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [] /* List of root folders whose combined content represents the structure of the project at runtime. */, + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + "forceConsistentCasingInFileNames": true + } +} From 878e2528d0a87459c6ba66b5d9eddf104efb654a Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Fri, 2 Aug 2019 16:05:25 -0700 Subject: [PATCH 2/8] Update lock file --- common/config/rush/pnpm-lock.yaml | 125 ++++++++++++------------------ 1 file changed, 51 insertions(+), 74 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 9c68792a7255..13dc49680fdf 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -124,13 +124,11 @@ dependencies: karma-webpack: 4.0.2_webpack@4.39.0 long: 4.0.0 mocha: 5.2.0 - mocha-chrome: 1.1.0 + mocha-chrome: 2.0.0 mocha-junit-reporter: 1.23.1_mocha@5.2.0 mocha-multi: 1.1.0_mocha@5.2.0 mocha-multi-reporters: 1.1.7 moment: 2.24.0 - ms-rest: 2.5.3 - ms-rest-azure: 2.6.0 nise: 1.5.0 nock: 10.0.6 npm-run-all: 4.1.5 @@ -184,7 +182,7 @@ dependencies: webpack: 4.39.0_webpack@4.39.0 webpack-cli: 3.3.6_webpack@4.39.0 webpack-dev-middleware: 3.7.0_webpack@4.39.0 - ws: 6.2.1 + ws: 7.1.1 xhr-mock: 2.5.0 xml2js: 0.4.19 yargs: 13.3.0 @@ -1437,6 +1435,10 @@ packages: dev: false resolution: integrity: sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + /async-limiter/1.0.1: + dev: false + resolution: + integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== /async-lock/1.2.2: dev: false resolution: @@ -1889,14 +1891,6 @@ packages: dev: false resolution: integrity: sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= - /babel-polyfill/6.26.0: - dependencies: - babel-runtime: 6.26.0 - core-js: 2.6.9 - regenerator-runtime: 0.10.5 - dev: false - resolution: - integrity: sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= /babel-preset-env/1.7.0: dependencies: babel-plugin-check-es2015-constants: 6.22.0 @@ -2507,16 +2501,14 @@ packages: dev: false resolution: integrity: sha512-IoQLp64s2n8OQuvKZwt77CscVj3UlV2Dj7yZtd1EBMld9mSdGcsGy9fN5hd/r4vJuWZR09it78n1+A17gB+AIQ== - /chrome-remote-interface/0.25.7: + /chrome-remote-interface/0.27.2: dependencies: commander: 2.11.0 - ws: 3.3.3 + ws: 6.2.1 dev: false - engines: - node: '>=4' hasBin: true resolution: - integrity: sha512-6zI6LbR2IiGmduFZededaerEr9hHXabxT/L+fRrdq65a0CfyLMzpq0BKuZiqN0Upqcacsb6q2POj7fmobwBsEA== + integrity: sha512-pVLljQ29SAx8KIv5tSa9sIf8GrEsAZdPJoeWOmY3/nrIzFmE+EryNNHvDkddGod0cmAFTv+GmPG0uvzxi2NWsA== /chrome-trace-event/1.0.2: dependencies: tslib: 1.10.0 @@ -3022,14 +3014,15 @@ packages: node: '>=0.10' resolution: integrity: sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - /deep-assign/2.0.0: + /deep-assign/3.0.0: dependencies: is-obj: 1.0.1 + deprecated: Check out `lodash.merge` or `merge-options` instead. dev: false engines: node: '>=0.10.0' resolution: - integrity: sha1-6+BrHwfwja5ZdiDj3RYi83GhxXI= + integrity: sha512-YX2i9XjJ7h5q/aQ/IM9PEwEnDqETAIYbggmdDB3HLTlSgo1CxPsj6pvhPG68rq6SVE0+p+6Ywsm5fTYNrYtBWw== /deep-eql/3.0.1: dependencies: type-detect: 4.0.8 @@ -4673,16 +4666,6 @@ packages: node: '>=6' resolution: integrity: sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ== - /import-local/1.0.0: - dependencies: - pkg-dir: 2.0.0 - resolve-cwd: 2.0.0 - dev: false - engines: - node: '>=4' - hasBin: true - resolution: - integrity: sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ== /import-local/2.0.0: dependencies: pkg-dir: 3.0.0 @@ -5994,22 +5977,22 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= - /meow/4.0.1: + /meow/5.0.0: dependencies: camelcase-keys: 4.2.0 decamelize-keys: 1.1.0 loud-rejection: 1.6.0 - minimist: 1.2.0 minimist-options: 3.0.2 normalize-package-data: 2.5.0 read-pkg-up: 3.0.0 redent: 2.0.0 trim-newlines: 2.0.0 + yargs-parser: 10.1.0 dev: false engines: - node: '>=4' + node: '>=6' resolution: - integrity: sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A== + integrity: sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig== /merge-descriptors/1.0.1: dev: false resolution: @@ -6183,29 +6166,24 @@ packages: hasBin: true resolution: integrity: sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - /mocha-chrome/1.1.0: + /mocha-chrome/2.0.0: dependencies: - babel-plugin-transform-es2015-destructuring: 6.23.0 - babel-plugin-transform-es2015-parameters: 6.24.1 - babel-polyfill: 6.26.0 - babel-preset-env: 1.7.0 - babel-register: 6.26.0 chalk: 2.4.2 chrome-launcher: 0.10.7 - chrome-remote-interface: 0.25.7 + chrome-remote-interface: 0.27.2 chrome-unmirror: 0.1.0 - debug: 3.2.6 - deep-assign: 2.0.0 - import-local: 1.0.0 + debug: 4.1.1 + deep-assign: 3.0.0 + import-local: 2.0.0 loglevel: 1.6.3 - meow: 4.0.1 + meow: 5.0.0 nanobus: 4.4.0 dev: false engines: - node: '>= 7.6.0' + node: '>= 8.0.0' hasBin: true resolution: - integrity: sha512-Zk1HvDF13TLOBH2sML+4T1o5Z3nwUYN9ah3gz4TUrnwx7Sdk0N+rq5n+uzw0/3BAQH9aejPCJILWoWi7HW0qyw== + integrity: sha512-Kq6W9jdXY3C2PhNHtSrk3GnDuoAKN+DbgJKCLfXtc5cql8oHB8+rUYlq9t1c8in6vQ6/X432E/U8h0pV5QlAug== /mocha-junit-reporter/1.23.1_mocha@5.2.0: dependencies: debug: 2.6.9 @@ -7068,14 +7046,6 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-clVrgM+g1IqXToDnckjoDtT3+HA= - /pkg-dir/2.0.0: - dependencies: - find-up: 2.1.0 - dev: false - engines: - node: '>=4' - resolution: - integrity: sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= /pkg-dir/3.0.0: dependencies: find-up: 3.0.0 @@ -7482,10 +7452,6 @@ packages: dev: false resolution: integrity: sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== - /regenerator-runtime/0.10.5: - dev: false - resolution: - integrity: sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= /regenerator-runtime/0.11.1: dev: false resolution: @@ -9484,6 +9450,12 @@ packages: dev: false resolution: integrity: sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== + /ws/7.1.1: + dependencies: + async-limiter: 1.0.1 + dev: false + resolution: + integrity: sha512-o41D/WmDeca0BqYhsr3nJzQyg9NF5X8l/UdnFNux9cS3lwB+swm8qGWX5rn+aD6xfBU3rGmtHij7g7x6LxFU3A== /xhr-mock/2.5.0: dependencies: global: 4.4.0 @@ -9560,6 +9532,12 @@ packages: dev: false resolution: integrity: sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + /yargs-parser/10.1.0: + dependencies: + camelcase: 4.1.0 + dev: false + resolution: + integrity: sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== /yargs-parser/13.1.1: dependencies: camelcase: 5.3.1 @@ -9781,11 +9759,11 @@ packages: typescript: 3.5.3 url: 0.11.0 util: 0.12.1 - ws: 6.2.1 + ws: 7.1.1 dev: false name: '@rush-temp/core-amqp' resolution: - integrity: sha512-TO5tSHoJ1Uxi7Um7qtmzxYsEipKbbVF7wsY5faQRM4XvRkcjjL2cKSRrYyHNmSWZSniQ+KFfol5lHo3zOt+gDQ== + integrity: sha512-ZyTOcKkPXTGZSy4u5Qlo23m3kxbAhENzHCL1dI9lZawvkcFQ4IXVimLaTbPu0we6Af536q7SqSihDBPU5wy44w== tarball: 'file:projects/core-amqp.tgz' version: 0.0.0 'file:projects/core-arm.tgz': @@ -9925,7 +9903,7 @@ packages: karma-typescript-es6-transform: 4.1.1 karma-webpack: 4.0.2_webpack@4.39.0 mocha: 5.2.0 - mocha-chrome: 1.1.0 + mocha-chrome: 2.0.0 mocha-junit-reporter: 1.23.1_mocha@5.2.0 mocha-multi-reporters: 1.1.7 npm-run-all: 4.1.5 @@ -9962,7 +9940,7 @@ packages: dev: false name: '@rush-temp/core-http' resolution: - integrity: sha512-HBS+FpI24GB29G+6v9HX7hePp1rULVnlcNe0Pw8ueEangIz40aWXh1Y3zPtVz9A6/wz/p2nC7W8k/TNl066cfQ== + integrity: sha512-81nCKIpQV87NKB9yhYwvC/lI8SqX3n+XsO/3Dav2v3UtJTHnqrlg4pXBGNgYSesge4Y9KJEHkkve/Yx/jdmlfQ== tarball: 'file:projects/core-http.tgz' version: 0.0.0 'file:projects/core-paging.tgz': @@ -10135,11 +10113,11 @@ packages: tslib: 1.10.0 typescript: 3.5.3 uuid: 3.3.2 - ws: 6.2.1 + ws: 7.1.1 dev: false name: '@rush-temp/event-hubs' resolution: - integrity: sha512-senhWyZk3l8A041gtjoRjoLcikYZKIcCZRZjtuMVaVjDc+P9fttnMfAE+Bc7BThmRYYYURn/2WocPAKtKjNLBQ== + integrity: sha512-LVH3ua5nCFL+caEgJzom1j4BKBuyGyJ08FQYVwmCR2oe9uVsKgOqHgOrRvuv/6L7V7h6iDNUjQgJsnmfQ/ndLQ== tarball: 'file:projects/event-hubs.tgz' version: 0.0.0 'file:projects/event-processor-host.tgz': @@ -10193,15 +10171,16 @@ packages: tslib: 1.10.0 typescript: 3.5.3 uuid: 3.3.2 - ws: 6.2.1 + ws: 7.1.1 dev: false name: '@rush-temp/event-processor-host' resolution: - integrity: sha512-8cK8BQGt608wzcnNTZBssdPfgdyX7xQbvTA8Q8U0Hqe5XKbykhzHpx/Y32+CE6bOW17QDbKmIgxPYywIRRBFag== + integrity: sha512-lAC/BYJvdttZfq60Bkqow8NQIAWpYA2ByPGBaue+SS2myGSQTX7LVnS4xwEy+CTtVG76d7oRK+CKbslx/hBMPw== tarball: 'file:projects/event-processor-host.tgz' version: 0.0.0 'file:projects/identity.tgz': dependencies: + '@azure/abort-controller': 1.0.0-preview.1 '@types/jws': 3.2.0 '@types/mocha': 5.2.7 '@types/node': 8.10.51 @@ -10248,7 +10227,7 @@ packages: dev: false name: '@rush-temp/identity' resolution: - integrity: sha512-rF7sKJQVnOCy3Tnu/sMdcwk8DAN7IAqJV2fo9wtrtJ2yOqMwqwxeNGYteel2EPnOqH0D6p3qdB1hCuwAsyXF0Q== + integrity: sha512-JChnsLgbSP6jz9PepCG2gwy+9hc4TsDItlZa19dV29bgFBPNLJSCeHtvF7S0GqQl3oz+RxvR4kdY885ZPX0D4A== tarball: 'file:projects/identity.tgz' version: 0.0.0 'file:projects/keyvault-certificates.tgz': @@ -10490,11 +10469,11 @@ packages: ts-node: 8.3.0_typescript@3.5.3 tslib: 1.10.0 typescript: 3.5.3 - ws: 6.2.1 + ws: 7.1.1 dev: false name: '@rush-temp/service-bus' resolution: - integrity: sha512-93tbhWPPZ04ozrpvFWfn2wOaLRvnilD6vxPq7xMAnyvi52T7HjHo+NyY1S8bojg4xciYHiDrByvNGxVlgPxVIQ== + integrity: sha512-l17qeUYPz5PaK4XO3Ko93pWhWnoMdU1IcBzz6tdmvS9dzBi/Qbi1H4VOuA7vfPDTs/AVdyNIOY1c8MhcN5U91w== tarball: 'file:projects/service-bus.tgz' version: 0.0.0 'file:projects/storage-blob.tgz': @@ -10782,7 +10761,7 @@ packages: dev: false name: '@rush-temp/testhub' resolution: - integrity: sha512-qcngMCJsJmX+G0stXZchWUI/WxyiMNfPI6MBDVbg/YMXc/lqEmttj/MghcZQiS+FMR859XarQzv5mfGa1q5DZQ== + integrity: sha512-5P+X3IwgFa9rlq+jbtHxWVZWF1kDmRZwV8jQfHMYV5CLsJjXKw1yISIRSFmCmuXDdHYEnxO1bnRGi34QeZ+63g== tarball: 'file:projects/testhub.tgz' version: 0.0.0 registry: '' @@ -10912,13 +10891,11 @@ specifiers: karma-webpack: ^4.0.0-rc.6 long: ^4.0.0 mocha: ^5.2.0 - mocha-chrome: ^1.1.0 + mocha-chrome: ^2.0.0 mocha-junit-reporter: ^1.18.0 mocha-multi: ^1.0.1 mocha-multi-reporters: ^1.1.7 moment: ^2.24.0 - ms-rest: ^2.3.3 - ms-rest-azure: ^2.5.9 nise: ^1.4.10 nock: ^10.0.6 npm-run-all: ^4.1.5 @@ -10972,7 +10949,7 @@ specifiers: webpack: ^4.16.3 webpack-cli: ^3.2.3 webpack-dev-middleware: ^3.1.2 - ws: ^6.2.1 + ws: ^7.1.1 xhr-mock: ^2.4.1 xml2js: ^0.4.19 yargs: ^13.0.0 From d2958b7e9ecf5fbc5171e3cdc24f9588ab622ad3 Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Fri, 2 Aug 2019 16:09:31 -0700 Subject: [PATCH 3/8] Updated README --- sdk/core/core-tracing/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/core/core-tracing/README.md b/sdk/core/core-tracing/README.md index e3e2ed80aa73..930ee8d74da7 100644 --- a/sdk/core/core-tracing/README.md +++ b/sdk/core/core-tracing/README.md @@ -1,6 +1,6 @@ -# Azure Core HTTP client library for JS +# Azure Core tracing library for JS -This is the core HTTP pipeline for Azure SDK JavaScript libraries which work in the browser and Node.js. This library is primarily intended to be used in code generated by [AutoRest](https://github.com/Azure/Autorest). +This is the core tracing library that provides low-level interfaces and helper methods for tracing in Azure SDK JavaScript libraries which work in the browser and Node.js. ## Getting started From f786124d10b7338bcc292dc5d46875642075c92f Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Fri, 2 Aug 2019 16:15:32 -0700 Subject: [PATCH 4/8] Removed unused export --- sdk/core/core-tracing/rollup.base.config.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sdk/core/core-tracing/rollup.base.config.js b/sdk/core/core-tracing/rollup.base.config.js index 4697560724a9..e5af2fcc90c6 100644 --- a/sdk/core/core-tracing/rollup.base.config.js +++ b/sdk/core/core-tracing/rollup.base.config.js @@ -77,12 +77,10 @@ export function browserConfig(test = false, production = false) { } }), nodeResolve({ - mainFields: ['module', 'browser'], + mainFields: ["module", "browser"], preferBuiltins: false }), - cjs({ - namedExports: { events: ["EventEmitter"] } - }), + cjs(), viz({ filename: "browser/browser-stats.html", sourcemap: false }) ] }; From 0db69fa51a058cfad8a81a5e49f2d5c73432df9c Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Fri, 2 Aug 2019 16:31:45 -0700 Subject: [PATCH 5/8] readme exception --- .docsettings.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.docsettings.yml b/.docsettings.yml index 196128c2e5f2..568133b8f02b 100644 --- a/.docsettings.yml +++ b/.docsettings.yml @@ -105,6 +105,7 @@ known_content_issues: - ["sdk/storage/storage-queue/samples/README.md", "#1583"] - ["sdk/storage/storage-queue/test/README.md", "#1583"] - ["sdk/storage/storage-datalake/README.md", "#1583"] + - ["sdk/core/core-tracing/README.md", "#1583"] package_indexing_exclusion_list: - "@azure/template" From 3bab05313269179ce2f2f014dfd71678a6ee4457 Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Fri, 2 Aug 2019 16:42:43 -0700 Subject: [PATCH 6/8] update lint --- sdk/core/core-tracing/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/core-tracing/package.json b/sdk/core/core-tracing/package.json index ae0de01db51e..948ade3ce0c4 100644 --- a/sdk/core/core-tracing/package.json +++ b/sdk/core/core-tracing/package.json @@ -24,7 +24,7 @@ "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint \"src/**/*.ts\" \"test/**/*.ts\" -c ../../.eslintrc.json --fix --fix-type [problem,suggestion]", - "lint": "eslint -c ../../.eslintrc.json src test --ext .ts -f node_modules/eslint-detailed-reporter/lib/detailed.js -o template-lintReport.html || exit 0", + "lint": "eslint -c ../../.eslintrc.json lib test --ext .ts -f node_modules/eslint-detailed-reporter/lib/detailed.js -o template-lintReport.html || exit 0", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", From 3a385213b77817c12783264ab9de4a0e47f54282 Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Fri, 2 Aug 2019 16:49:12 -0700 Subject: [PATCH 7/8] Remove test from linting --- sdk/core/core-tracing/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/core-tracing/package.json b/sdk/core/core-tracing/package.json index 948ade3ce0c4..3cdddf713228 100644 --- a/sdk/core/core-tracing/package.json +++ b/sdk/core/core-tracing/package.json @@ -24,7 +24,7 @@ "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint \"src/**/*.ts\" \"test/**/*.ts\" -c ../../.eslintrc.json --fix --fix-type [problem,suggestion]", - "lint": "eslint -c ../../.eslintrc.json lib test --ext .ts -f node_modules/eslint-detailed-reporter/lib/detailed.js -o template-lintReport.html || exit 0", + "lint": "eslint -c ../../.eslintrc.json lib --ext .ts -f node_modules/eslint-detailed-reporter/lib/detailed.js -o template-lintReport.html || exit 0", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", From c2175314a8b8e22db275cd4c5add8d74eee69f0b Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Fri, 2 Aug 2019 19:44:31 -0700 Subject: [PATCH 8/8] Update prettier dep --- common/config/rush/pnpm-lock.yaml | 84 +++++++++++++++--------------- sdk/core/core-tracing/package.json | 2 +- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 13dc49680fdf..f3d52db3d746 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -86,7 +86,7 @@ dependencies: dotenv: 8.0.0 es6-promise: 4.2.8 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -3448,7 +3448,7 @@ packages: source-map: 0.2.0 resolution: integrity: sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= - /eslint-config-prettier/4.3.0_eslint@5.16.0: + /eslint-config-prettier/6.0.0_eslint@5.16.0: dependencies: eslint: 5.16.0 get-stdin: 6.0.0 @@ -3457,7 +3457,7 @@ packages: peerDependencies: eslint: '>=3.14.1' resolution: - integrity: sha512-sZwhSTHVVz78+kYD3t5pCWSYEdVSBR0PXnwjDRsUs8ytIrK8PLXw+6FKp8r3Z7rx4ZszdetWlXYKOHoUrrwPlA== + integrity: sha512-vDrcCFE3+2ixNT5H83g28bO/uYAwibJxerXPj+E7op4qzBCsAV36QfvdAyVOoNxKAH2Os/e01T/2x++V0LPukA== /eslint-detailed-reporter/0.8.0_eslint@5.16.0: dependencies: eslint: 5.16.0 @@ -9657,7 +9657,7 @@ packages: cross-env: 5.2.0 delay: 4.3.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -9692,7 +9692,7 @@ packages: dev: false name: '@rush-temp/abort-controller' resolution: - integrity: sha512-RuhnSQySoyCi5RWYPvJ0/Lkcae++dII8y5MmaB2lyctYmgZSNGZQiHC8ynz1Ff+nx1aSrFm+OTR5fN6OM86nZA== + integrity: sha512-x+voDt8XdyBFL303wBUx2CnOIreIhRBNCVEcntOkojpHHsIrRh6hxnD0PYPivBI1cxkF5pyyuHxAxQphFHO16g== tarball: 'file:projects/abort-controller.tgz' version: 0.0.0 'file:projects/core-amqp.tgz': @@ -9720,7 +9720,7 @@ packages: debug: 3.2.6 dotenv: 8.0.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -9763,7 +9763,7 @@ packages: dev: false name: '@rush-temp/core-amqp' resolution: - integrity: sha512-ZyTOcKkPXTGZSy4u5Qlo23m3kxbAhENzHCL1dI9lZawvkcFQ4IXVimLaTbPu0we6Af536q7SqSihDBPU5wy44w== + integrity: sha512-GBAs4S1QMhTUgK2mhulJ0LeJkzszExfhvETqLgzX07jGO/qi9h22ithc/IUkBm72yqDphLTxbGdk64tIS7ibow== tarball: 'file:projects/core-amqp.tgz' version: 0.0.0 'file:projects/core-arm.tgz': @@ -9775,7 +9775,7 @@ packages: '@typescript-eslint/parser': 1.13.0_eslint@5.16.0 chai: 4.2.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -9799,7 +9799,7 @@ packages: dev: false name: '@rush-temp/core-arm' resolution: - integrity: sha512-6qM3GwDqOSp1yOIQKFqERC8tTW+BIR+9tgvlm/Ohje5N1Nj6Cspy/YVtVO/efHYP9LMJ9hi2rjCXU6Plp4An9w== + integrity: sha512-phve3vyLkRngCpPo1VIMZi4mYuJ1ZQLVwtfTwJlGb17t7U9w73ZY1G/XcwlV+z1eNYz+16VXPbXE/al/Ds1aTA== tarball: 'file:projects/core-arm.tgz' version: 0.0.0 'file:projects/core-asynciterator-polyfill.tgz': @@ -9808,7 +9808,7 @@ packages: '@typescript-eslint/eslint-plugin': 1.13.0_0b5e999c52a893676e7127c05369c7b6 '@typescript-eslint/parser': 1.13.0_eslint@5.16.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -9818,7 +9818,7 @@ packages: dev: false name: '@rush-temp/core-asynciterator-polyfill' resolution: - integrity: sha512-v2OkkGp4BscubKnr7qikdSqLJttDTy5skuwpX+KeQv9H5aMDtfGU4CKUmqdwGsI/+vnXlPU57ZBVJ0BtucQBng== + integrity: sha512-IRwa1BGwvWFf9WcCzNcKr6sJA9gx8uJNIMG1h401qieXmpIZ0AgKwPzIAW+FDXNCvTsyJ7yWXkIbMrHuEU3m6Q== tarball: 'file:projects/core-asynciterator-polyfill.tgz' version: 0.0.0 'file:projects/core-auth.tgz': @@ -9832,7 +9832,7 @@ packages: assert: 1.5.0 cross-env: 5.2.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -9858,7 +9858,7 @@ packages: dev: false name: '@rush-temp/core-auth' resolution: - integrity: sha512-AVe2WfWPpab/mPESHoXACFqnYn8KyHT12AxqypS0RVPo/yQllkiRSaBaY+Qv//K25+jJKOHgyrHqhjLJRzvczQ== + integrity: sha512-4xIrZFzmo83/fk7YHuIPLXT/+55bgOk0REf598D5uJxaWAfDvoaBNJNyxsuQt6O2P195OePubUF6DR0O7BlMMA== tarball: 'file:projects/core-auth.tgz' version: 0.0.0 'file:projects/core-http.tgz': @@ -9886,7 +9886,7 @@ packages: axios-mock-adapter: 1.17.0_axios@0.19.0 chai: 4.2.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -9940,7 +9940,7 @@ packages: dev: false name: '@rush-temp/core-http' resolution: - integrity: sha512-81nCKIpQV87NKB9yhYwvC/lI8SqX3n+XsO/3Dav2v3UtJTHnqrlg4pXBGNgYSesge4Y9KJEHkkve/Yx/jdmlfQ== + integrity: sha512-0JnlqqQCp+WYqDGY+KyqlZFl4pzauS0E8gySGwpChzZslbZi5vvA1tG7Cl2NhEq7wr0CXXrSW2s01DnQs5Z+jA== tarball: 'file:projects/core-http.tgz' version: 0.0.0 'file:projects/core-paging.tgz': @@ -9950,7 +9950,7 @@ packages: '@typescript-eslint/eslint-plugin': 1.13.0_0b5e999c52a893676e7127c05369c7b6 '@typescript-eslint/parser': 1.13.0_eslint@5.16.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -9960,7 +9960,7 @@ packages: dev: false name: '@rush-temp/core-paging' resolution: - integrity: sha512-2u4fno6260w1XLYISrBU+SlPSNrMlY9/Au3oQxjk4EzkWkZXOuDrC9WKNu5w0EHEktYtOi8eX9lAU9+JtZR3Hg== + integrity: sha512-QkET39Qzizy7zyVKVDimbXrWvs9M2g5X4TWfbHiv9fCMkUx6VRVDchAsseuCDU1ONejKuKVFbN0nxrkFnH60sQ== tarball: 'file:projects/core-paging.tgz' version: 0.0.0 'file:projects/core-tracing.tgz': @@ -9973,7 +9973,7 @@ packages: assert: 1.5.0 cross-env: 5.2.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -9999,7 +9999,7 @@ packages: dev: false name: '@rush-temp/core-tracing' resolution: - integrity: sha512-QLUT0kQIoWe4V02xaBiWpWATkW5Gqi0y39uYpu0qXbpogrTouiI/WVu/qQFqvrksojBFBJajCQQM6DOgbqBtcw== + integrity: sha512-RUmLY9Vr2IXSMyL9dss7tAPwnVVAeOB27G+3QMPZlVWiarKq0zSACDeTpyHUVH2H53pusnPpyXbmx3m5Mim9dQ== tarball: 'file:projects/core-tracing.tgz' version: 0.0.0 'file:projects/cosmos.tgz': @@ -10016,7 +10016,7 @@ packages: binary-search-bounds: 2.0.3 create-hmac: 1.1.7 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -10041,7 +10041,7 @@ packages: dev: false name: '@rush-temp/cosmos' resolution: - integrity: sha512-QdnsCtEZYRaiLoFGvg8zhJFo6FdtllFmm5mJaVrGP54JtFcGxgKXtE21v7LuuBoe/+jo/pROjMv59yvrxw/qsw== + integrity: sha512-aFhnE62pcG/lqb6qnfae7EfgNN7L+gH3VfxpxOnMtJzvMmpb8U2unGFPk2AIS0/0FRGiM0iGkttQPGXjiR50GA== tarball: 'file:projects/cosmos.tgz' version: 0.0.0 'file:projects/event-hubs.tgz': @@ -10071,7 +10071,7 @@ packages: debug: 3.2.6 dotenv: 8.0.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -10117,7 +10117,7 @@ packages: dev: false name: '@rush-temp/event-hubs' resolution: - integrity: sha512-LVH3ua5nCFL+caEgJzom1j4BKBuyGyJ08FQYVwmCR2oe9uVsKgOqHgOrRvuv/6L7V7h6iDNUjQgJsnmfQ/ndLQ== + integrity: sha512-M170MYQHFPF7aGXaeMPHviAsyCoPROOJEDuM7cGEqBJcFwXpYrpz7ROCIWwuqIn9q4lXsJf6PkYsmw3VHduZhQ== tarball: 'file:projects/event-hubs.tgz' version: 0.0.0 'file:projects/event-processor-host.tgz': @@ -10146,7 +10146,7 @@ packages: debug: 3.2.6 dotenv: 8.0.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -10175,7 +10175,7 @@ packages: dev: false name: '@rush-temp/event-processor-host' resolution: - integrity: sha512-lAC/BYJvdttZfq60Bkqow8NQIAWpYA2ByPGBaue+SS2myGSQTX7LVnS4xwEy+CTtVG76d7oRK+CKbslx/hBMPw== + integrity: sha512-Jsy8RILh68Pv8Qu0es2EIqPqh09U8QXcwQJXtIK+gcSq2zMe71ooOIkBz7xjJuZ2p1PsiTX0noP1apInO9jZoQ== tarball: 'file:projects/event-processor-host.tgz' version: 0.0.0 'file:projects/identity.tgz': @@ -10239,7 +10239,7 @@ packages: '@typescript-eslint/parser': 1.13.0_eslint@5.16.0 chai: 4.2.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -10256,7 +10256,7 @@ packages: dev: false name: '@rush-temp/keyvault-certificates' resolution: - integrity: sha512-0Rr3TCScxlCMTaQ42DE3wAzan3NPSnborTqYIH8v/tJnxaFbjfD15Z0x2qGdmpn6Rs+45kG26uwKeG14AxtNPA== + integrity: sha512-0nhGLrUGObgsdzppH5fMfvAXZv2xxL0hzs232xwe8jqbcln8ZkWIoSRH/dAb9RAHuVl4WtMWDBROAJ9yik+kCw== tarball: 'file:projects/keyvault-certificates.tgz' version: 0.0.0 'file:projects/keyvault-keys.tgz': @@ -10280,7 +10280,7 @@ packages: cross-env: 5.2.0 dotenv: 8.0.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -10326,7 +10326,7 @@ packages: dev: false name: '@rush-temp/keyvault-keys' resolution: - integrity: sha512-xPulaHwiYJ1qe1lgx2f3YIJgn/n5RnpIzf1EJppRq0lu/Oq6spX1ZYzXUmK1hWv98KGit7ryt8kw9/ffzN8BaQ== + integrity: sha512-RWtkjDWWH4do62AtNfdtjLKNxDrnDnL40VkhuBIHbQA+AxcN9Iic3OAGiE0lEIp8+Udvi1KPf4fSTXG3QJHvpA== tarball: 'file:projects/keyvault-keys.tgz' version: 0.0.0 'file:projects/keyvault-secrets.tgz': @@ -10349,7 +10349,7 @@ packages: cross-env: 5.2.0 dotenv: 8.0.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -10395,7 +10395,7 @@ packages: dev: false name: '@rush-temp/keyvault-secrets' resolution: - integrity: sha512-I2NMoFjZFDUEowFdFO7/T1kbyOW/qfBaE4FcjEPrmTTQe7w+nisRgSz1OK/VZXtckgS7lJCX1AjbMqG6e+XixA== + integrity: sha512-ea24a6FgGValOdZJuFLqPHAXVrzRxerMZwGi0TqfVfwAcSn6lHuMCIt3so7LBBJsuT6d2k1Gf4Ow7XdQUhSMbg== tarball: 'file:projects/keyvault-secrets.tgz' version: 0.0.0 'file:projects/service-bus.tgz': @@ -10425,7 +10425,7 @@ packages: delay: 4.3.0 dotenv: 8.0.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -10473,7 +10473,7 @@ packages: dev: false name: '@rush-temp/service-bus' resolution: - integrity: sha512-l17qeUYPz5PaK4XO3Ko93pWhWnoMdU1IcBzz6tdmvS9dzBi/Qbi1H4VOuA7vfPDTs/AVdyNIOY1c8MhcN5U91w== + integrity: sha512-OyEIa/CmTPd+qEMKtDJP6ZFb3WdD7otXtpfRTlAPeWSV2ukcTu2YqH91J+xV2Ub4mHgVTZbeeWQkn6sfTP6qXg== tarball: 'file:projects/service-bus.tgz' version: 0.0.0 'file:projects/storage-blob.tgz': @@ -10494,7 +10494,7 @@ packages: dotenv: 8.0.0 es6-promise: 4.2.8 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -10544,7 +10544,7 @@ packages: dev: false name: '@rush-temp/storage-blob' resolution: - integrity: sha512-O9urZlGKQ1g4q8rHMVMRZx+yIpQKI9aZDIZ6VkYXfxjbsi6KSCHjW7k1FQBxoPZv9hk3bGcTBh2DfFfVSa9gDA== + integrity: sha512-Pzm4zPOtJSgd6OPABfADKXZQ5lpHzWqjkOmYQ8vknLZgKakReSuJrV7mB7/OFu9qxm8Q+FetBjPVWiUpTT1qgA== tarball: 'file:projects/storage-blob.tgz' version: 0.0.0 'file:projects/storage-file.tgz': @@ -10565,7 +10565,7 @@ packages: dotenv: 8.0.0 es6-promise: 4.2.8 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -10615,7 +10615,7 @@ packages: dev: false name: '@rush-temp/storage-file' resolution: - integrity: sha512-T8/LjmL+LzpeHkEZYIngTSdHgtLopUvlbUHSkzCCkxeVyXi8rUVIwf+P+OcNZ8DNKPH/27xc/zf5zVunVuwSJg== + integrity: sha512-vt91V3Kipjm60Q/mqSDRH3TMnNv3uYOmgMidlO3GH2s2WTaYJQ0fJlt8eZaEMbHcGOgG3R8p3WohMqvzoljDmg== tarball: 'file:projects/storage-file.tgz' version: 0.0.0 'file:projects/storage-queue.tgz': @@ -10636,7 +10636,7 @@ packages: dotenv: 8.0.0 es6-promise: 4.2.8 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -10685,7 +10685,7 @@ packages: dev: false name: '@rush-temp/storage-queue' resolution: - integrity: sha512-FrYcWgIUWbnLdsgPTJqK0xP9kS1ElkifwhzRZ7bC1w4T3wgGwbEleN+1weyt+79EatjIVSelsZTzX6tUuIwBEw== + integrity: sha512-5hD25rOXwAgsiOG3BE+wrApP78SJqNiJNSIgSNUf7O8kNM0quQa7kTrIWDZer1nHt2YXQ4Ipg/4FCSHFXFaw5A== tarball: 'file:projects/storage-queue.tgz' version: 0.0.0 'file:projects/template.tgz': @@ -10698,7 +10698,7 @@ packages: assert: 1.5.0 cross-env: 5.2.0 eslint: 5.16.0 - eslint-config-prettier: 4.3.0_eslint@5.16.0 + eslint-config-prettier: 6.0.0_eslint@5.16.0 eslint-detailed-reporter: 0.8.0_eslint@5.16.0 eslint-plugin-no-null: 1.0.2_eslint@5.16.0 eslint-plugin-no-only-tests: 2.3.1 @@ -10736,7 +10736,7 @@ packages: dev: false name: '@rush-temp/template' resolution: - integrity: sha512-Ke/uOOWmrBKdkteo3wsma9x9Dda9mgqZLsDQTxXOG/YS2tBdKzf7kcQxZqjUBNnKCQXerpbu0/3YghicCc7NNA== + integrity: sha512-X0FdGAh2AwdFvbcwZ3we/W3XrUfo7+GogkdHB9n7fdoS4rudlHoIDVNMTbEfTEEsD1wNYLwlHX0gAH6NZRbxVQ== tarball: 'file:projects/template.tgz' version: 0.0.0 'file:projects/testhub.tgz': @@ -10853,7 +10853,7 @@ specifiers: dotenv: ^8.0.0 es6-promise: ^4.2.5 eslint: ^5.16.0 - eslint-config-prettier: ^4.2.0 + eslint-config-prettier: ^6.0.0 eslint-detailed-reporter: ^0.8.0 eslint-plugin-no-null: ^1.0.2 eslint-plugin-no-only-tests: ^2.3.0 diff --git a/sdk/core/core-tracing/package.json b/sdk/core/core-tracing/package.json index 3cdddf713228..0d13b4c8a1cc 100644 --- a/sdk/core/core-tracing/package.json +++ b/sdk/core/core-tracing/package.json @@ -69,7 +69,7 @@ "assert": "^1.4.1", "cross-env": "^5.2.0", "eslint": "^5.16.0", - "eslint-config-prettier": "^4.2.0", + "eslint-config-prettier": "^6.0.0", "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0",