Skip to main content
Session tracking in Netra provides powerful capabilities for monitoring user interactions and application behavior. This section covers how to track sessions, add custom context, and record events within your application.

Setting Up Session Tracking

Before you can start tracking sessions, initialize the Netra SDK: Set your Netra endpoint and API key before you call Netra.init(). Without NETRA_OTLP_ENDPOINT, the SDK prints spans to the console instead of sending them to Netra, and your dashboard stays empty.
Set these wherever your app runs, including Docker containers and CI jobs.

Session Identification

Set unique identifiers for your sessions:

Custom Context Attributes

Add custom attributes to enrich your session data:

Custom Events

Record important events in your application:
Last modified on November 5, 2026