unomiq-sdk Python package to query the Unomiq Economic Engine API — the API that lets you search traces, retrieve aggregated metrics, list traces, and inspect individual spans.
Prerequisites
API Credentials
Create API credentials from the Unomiq Dashboard. The credentials must have theread:traces permission.
This will give you an API key (Client ID) and secret (Client Secret).
Application ID
You need the Application ID (app_id) for the application whose traces you want to query. You can find this in the Unomiq Dashboard under your application settings.
Install the SDK
Configuration
Set the following environment variables for your application:
The SDK uses these credentials internally to acquire and refresh OAuth2 tokens when making requests to the Engine API.
Alternatively, you can pass credentials directly to the constructor:
Constructor Parameters
Initializing the Client
Using environment variables (recommended):Remember to call
engine.close() when you are done to release resources.Querying Spans
Theengine/query endpoint lets you search for individual spans across traces using filter expressions.
Filter Expressions
The SDK provides composable filter primitives —Condition, AndGroup, and OrGroup — that map directly to the Engine API filter schema. These can be used with engine.query(), engine.get_traces(), and engine.get_metrics().
Simple Condition
ACondition matches a single field against a value using a comparison operator:
Supported Operators
Filterable Fields
Combining Conditions with AND / OR
UseAndGroup and OrGroup to build complex filter expressions:
Listing Traces
The/traces endpoint returns a paginated list of traces with aggregated information (duration, span count, total cost).
search_child_spans=True to apply filters across all spans in the trace:
Retrieving a Single Trace
The/traces/{trace_id} endpoint returns all spans for a specific trace:
Getting Metrics
The/engine/metrics endpoint returns aggregated statistical distributions for trace duration, cost, and spans per trace.
Live Traces
The/traces/live endpoint returns the most recent spans from the live data stream: