TraceConnection Class

Connection object for starting, viewing, and removing Traces.

Python wrapper around Microsoft Analysis Services Tabular Server.

Inheritance
TraceConnection

Constructor

TraceConnection(dataset_client: DatasetXmlaClient)

Parameters

Name Description
dataset_client
Required
<xref:sempy.fabric.DatasetXmlaClient>

Client for a specific dataset.

Methods

create_trace

Create a blank Trace object on this connection.

disconnect_and_dispose

Clear all traces on a server.

discover_event_schema

Discover all event categories, events, and corresponding columns available to use for Tracing.

drop_trace

Drop the trace with the specified name from the server.

drop_traces

Remove all traces on a server.

list_traces

List all stored (active or inactive) traces on a this connection.

create_trace

Create a blank Trace object on this connection.

create_trace(event_schema: Dict[str, List[str]], name: str | None = None, filter_predicate: Callable[[...], bool] | None = None, stop_event: str | None = None) -> Trace

Parameters

Name Description
event_schema
Required

Dictionary containing event types as keys and list of column names for that event as values. Both event and column names must be specified as strings, either in Space Delimited Case or PascalCase.

name
str

Name identifying trace. If None, the trace name will be "SemanticLinkTrace_".

default value: None
filter_predicate

Function that takes in TraceEventArgs, and returns a boolean based on whether or not the trace with those args should be recorded.

default value: None
stop_event
str

Event class that signals the end of the trace. trace.stop() will wait for this event (with specified timeout) before returning logs.

default value: None

Returns

Type Description

Trace object to be customized and started.

disconnect_and_dispose

Clear all traces on a server.

disconnect_and_dispose() -> None

discover_event_schema

Discover all event categories, events, and corresponding columns available to use for Tracing.

discover_event_schema() -> DataFrame

Returns

Type Description

DataFrame containing the schema information.

drop_trace

Drop the trace with the specified name from the server.

drop_trace(trace_name: str) -> None

Parameters

Name Description
trace_name
Required
str

Name of trace to drop.

drop_traces

Remove all traces on a server.

drop_traces() -> None

list_traces

List all stored (active or inactive) traces on a this connection.

list_traces() -> DataFrame

Returns

Type Description

DataFrame containing the ID, name, timestamp, and state of each trace.