> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Runtime and Observability

> Boot and shut down the Rust runtime behind @cognee/cognee-ts, and wire up logging, tracing, and analytics.

The native addon runs on a Rust tokio runtime. Boot it once at process start
with `init()` before any async operation, and optionally attach logging and
telemetry.

## Initialisation and observability

```ts theme={null}
import {
  init,
  initWithThreads,
  shutdown,
  setupLogging,
  setupTelemetry,
  setupTelemetryAnalytics,
} from '@cognee/cognee-ts';

// Boot the Rust tokio runtime (required before any async op).
init();

// Alternatively boot with a fixed worker-thread count.
initWithThreads(4);

// Optional: add file logging (reads COGNEE_LOG_*, LOG_FILE_NAME, LOG_LEVEL).
setupLogging();

// Optional: enable OTLP trace export (reads OTEL_* env vars).
setupTelemetry();

// Optional: enable product-analytics emission (returns true if armed).
const armed = setupTelemetryAnalytics();

// Tear the runtime down (e.g. before process exit).
shutdown();
```

Each handle also exposes `await c.ownerId()`, returning the owner UUID used for
deterministic, per-tenant ID generation.

Set `COGNEE_BINDING_SUPPRESS_LOGS=1` before `require`ing the module to skip the
auto-installed stderr subscriber if your host manages the logging pipeline.

The environment variables these functions read are listed in
[Configuration](/typescript/configuration#environment-variables).
