azure-sdk-for-js/sdk/core/core-tracing
Jeremy Meng cf8d25ff5e
Fix compiler errors in tests and samples (#31649)
After moving to ESM/tshy, we no longer build tests/samples. This PR
enables running "typecheck" as an optional rush bulk command, and fixes
some of the errors found.

The known errors reported on files from vite/vitest/chai are ignored.

The update-snippets dev-tool command throws error of reading undefined
in some cases, adding a null check fixes it.

Snippets are updated as well after snippets.spec.ts files are fixed.
2024-11-06 13:31:08 -08:00
..
config [EngSys] Enable Rush build cache for for common packages (#27409) 2023-10-19 14:22:44 -07:00
review [tracing] Add support for addEvent (#31162) 2024-09-20 08:54:24 -07:00
samples/v1 [EngSys] move to vendored version of cross-env via dev-tool 2024-11-02 00:48:06 +00:00
samples-dev [EngSys] standardize OSS copyright header 2024-08-27 13:01:38 -07:00
src [eslint-plugin] add rule "@typescript-eslint/consistent-type-imports": "warn" 2024-10-30 15:48:52 +00:00
test Fix compiler errors in tests and samples (#31649) 2024-11-06 13:31:08 -08:00
CHANGELOG.md Post release automated changes for core releases (#31303) 2024-10-04 07:59:26 -07:00
LICENSE Use inlineSources to bundle source file contents inside map files (#7615) 2020-03-11 10:34:37 -07:00
README.md [core-tracing] - Update README (#21023) 2022-03-30 13:05:01 -07:00
api-extractor.json [core] Upgrade to ES-Modules for core (#26238) 2024-02-20 17:42:23 +00:00
package.json [EngSys] use vendored version of `mkdirp` and `rimraf` from dev-tool 2024-10-23 17:53:07 +00:00
sample.env [core] - Add tracing sample (#19911) 2022-01-19 15:12:19 -08:00
tsconfig.browser.config.json [core] Add README snippets for core (#31204) 2024-09-25 09:35:12 -04:00
tsconfig.json [EngSys] remove tsconfig.package.json 2024-07-16 13:27:25 +00:00
tsdoc.json Standardization of our documentation comments (#12912) 2020-12-17 02:01:34 +00:00
vitest.browser.config.ts [core] Add README snippets for core (#31204) 2024-09-25 09:35:12 -04:00
vitest.config.ts [core] Add README snippets for core (#31204) 2024-09-25 09:35:12 -04:00

README.md

Azure Core tracing library for JavaScript

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

Installation

This package is primarily used in Azure client libraries and not meant to be used directly by consumers of Azure SDKs.

Key Concepts

  • TracingClient is the primary interface providing tracing functionality to client libraries. Client libraries should only be aware of and interact with a TracingClient instance.
    • A TracingClient implementation can be created using the createTracingClient factory function.
  • Instrumenter provides an abstraction over an instrumentation and acts as the interop point for using third party libraries like OpenTelemetry. By default, a no-op Instrumenter is used. Customers who wish to enable OpenTelemetry based tracing will do so by installing and registering the @azure/opentelemetry-instrumentation-azure-sdk package.
  • TracingContext is an immutable data container, used to pass operation-specific information around (such as span parenting information).
  • TracingSpan is an abstraction of a Span which can be used to record events, attributes, and exceptions.

Examples

Examples can be found in the samples folder.

Next steps

You can build and run the tests locally by executing rushx test. Explore the test folder to see advanced usage and behavior of the public classes.

Troubleshooting

If you run into issues while using this library, please feel free to file an issue.

Contributing

If you'd like to contribute to this library, please read the contributing guide to learn more about how to build and test the code.

Impressions