Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 957 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 957 Bytes

How to run

  • npm ci
  • npm run start
  • open http://127.0.0.1:3000
  • http.route is not available on metrics when the trace SDK is not registered, this is because no ContextManager is registered when no trace SDK is set up.

A workaround

A workaround exists for this: manually setting up a ContextManager - to do so, simply do this before setting up your SDK

import {context} from "@opentelemetry/api";
import {AsyncLocalStorageContextManager} from "@opentelemetry/context-async-hooks";

// manually setting a context manager to replace the no-op context manager
context.setGlobalContextManager(new AsyncLocalStorageContextManager())

(see otel-workaround.ts)

In this repo you can run this workaround like so