You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 10, 2022. It is now read-only.
This package provides everything needed to interact with the OpenTelemetry API, including all TypeScript interfaces, enums, and no-op implementations. It is intended for use both on the server and in the browser.
39
37
@@ -136,10 +134,6 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
In OpenTelemetry, all _traces_ are composed of [`Spans`](https://open-telemetry.github.io/opentelemetry-js/interfaces/span.html). A span describes a single operation with a start time and and end time like a database request, outgoing remote request, or a function invocation. These spans are linked together by parent-child relationships to form a tree. The resultant tree is your trace, and the root of the tree is commonly called the _root span_.
36
+
In OpenTelemetry, all _traces_ are composed of [`Spans`](https://open-telemetry.github.io/opentelemetry-js-api/interfaces/span.html). A span describes a single operation with a start time and and end time like a database request, outgoing remote request, or a function invocation. These spans are linked together by parent-child relationships to form a tree. The resultant tree is your trace, and the root of the tree is commonly called the _root span_.
37
37
38
-
You can create a span by calling [`Tracer#startSpan`](https://open-telemetry.github.io/opentelemetry-js/interfaces/tracer.html#startspan). The only required argument to `startSpan` is the _span name_, which should describe the operation being performed with low cardinality.
38
+
You can create a span by calling [`Tracer#startSpan`](https://open-telemetry.github.io/opentelemetry-js-api/interfaces/tracer.html#startspan). The only required argument to `startSpan` is the _span name_, which should describe the operation being performed with low cardinality.
39
39
40
40
```typescript
41
41
const span =tracer.startSpan("my-span-name");
@@ -102,18 +102,18 @@ async function onGet(request, response) {
102
102
103
103
// Create a new context from the current context which has the span "active"
104
104
const ctx =trace.setSpan(context.active(), span);
105
-
105
+
106
106
// Call getUser with the newly created context
107
-
//
107
+
//
108
108
// context.with calls a function with an associated "active" context. Within
109
109
// the function, calling context.active() returns the currently active context.
110
110
// If there is no active context, the ROOT_CONTEXT will be returned, which
111
111
// has no key-value pairs.
112
-
//
112
+
//
113
113
// context.with requires at least 2 arguments: a context and a function to be called.
114
114
// If a third argument is provided, it will be bound to `this` `this` inside the function.
115
115
// Any additional parameters are used as arguments when calling the function.
116
-
//
116
+
//
117
117
// Return value is the value returned from getUser
0 commit comments