JaegerAnalyzer

JaegerAnalyzer

class duetector.analyzer.jaeger.analyzer.JaegerAnalyzer(config: dict[str, Any] | None = None, *args, **kwargs)[source]

Bases: Analyzer

async analyze()[source]
async brief(tracers: list[str] | None = None, collector_ids: list[str] | None = None, start_datetime: datetime | None = None, end_datetime: datetime | None = None, with_details: bool = False, distinct: bool = False, inspect_type: bool = True) AnalyzerBrief[source]

Get a brief of this analyzer.

Parameters:
  • tracers (Optional[List[str]], optional) – Tracers. Defaults to None, all tracers will be queried. If a specific tracer is not found, it will be ignored.

  • collector_ids (Optional[List[str]], optional) – Collector ids. Defaults to None, all collector ids will be queried. If a specific collector id is not found, it will be ignored.

  • start_datetime (Optional[datetime], optional) – Start time. Defaults to None.

  • end_datetime (Optional[datetime], optional) – End time. Defaults to None.

  • with_details (bool, optional) – With details. Defaults to True.

  • distinct (bool, optional) – Distinct. Defaults to False.

  • inspect_type (bool, optional) – Weather fileds’s value is type or type name. Defaults to False, type name.

Returns:

A brief of this analyzer.

Return type:

AnalyzerBrief

property channel_initializer: Callable[[], Channel]

Example: async with self.channel as channel:

stub = QueryServiceStub(channel) response = await stub.GetServices(GetServicesRequest()) print(response)

property connector
default_config = {'certificate_chain_path': '', 'disabled': True, 'host': 'localhost', 'port': 16685, 'private_key_path': '', 'root_certificates_path': '', 'secure': False}

Default config for Analyzer.

async get_all_collector_ids() list[str][source]

Get all collector id from storage.

Returns:

List of collector id.

Return type:

List[str]

async get_all_tracers() list[str][source]

Get all tracers from storage.

Returns:

List of tracer’s name.

Return type:

List[str]

async query(tracers: list[str] | None = None, collector_ids: list[str] | None = None, start_datetime: datetime | None = None, end_datetime: list[datetime] | None = None, start: int = 0, limit: int = 20, columns: list[str] | None = None, where: dict[str, Any] | None = None, distinct: bool = False, order_by_asc: list[str] | None = None, order_by_desc: list[str] | None = None) list[Tracking][source]

Query all tracking records from jaeger connector.

Parameters:
  • tracers (Optional[List[str]], optional) – Tracer’s name. Defaults to None, all tracers will be queried.

  • collector_ids (Optional[List[str]], optional) – Collector id. Defaults to None, all collector id will be queried.

  • start_datetime (Optional[datetime], optional) – Start time. Defaults to None.

  • end_datetime (Optional[datetime], optional) – End time. Defaults to None.

  • start (int, optional) – Not support.

  • limit (int, optional) – Limit for each tracer of each collector id. Defaults to 20.

  • columns (Optional[List[str]], optional) – Not support, all tags will be returned.

  • where (Optional[Dict[str, Any]], optional) – Tags filter. Defaults to None.

  • distinct (bool, optional) – Not support.

  • order_by_asc (Optional[List[str]], optional) – Not support.

  • order_by_desc (Optional[List[str]], optional) – Not support.

Returns:

List of tracking records.

Return type:

List[duetector.analyzer.models.Tracking]

class duetector.analyzer.jaeger.analyzer.JaegerConnector(channel_initializer: Callable[[], Channel])[source]

Bases: OTelInspector

Providing query method for jaeger backend

_datetime_to_protobuf_timestamp(dt: datetime) Timestamp[source]
_protobuf_timestamp_to_datetime(ts: Timestamp) datetime[source]
async brief(collector_id: str, tracer_name: str, start_time_min: datetime | None = None, start_time_max: datetime | None = None, inspect_type=True) Brief | None[source]
get_find_tracers_request(collector_id: str, tracer_name: str, tags: dict[str, Any] | None = None, start_time_min: datetime | None = None, start_time_max: datetime | None = None, duration_min: int | None = None, duration_max: int | None = None, search_depth: int = 20) FindTracesRequest[source]
async get_operation(service: str, span_kind: str | None = None) list[str][source]
async inspect_all_collector_ids() list[str][source]
async inspect_all_tracers() list[str][source]
inspect_span(span: Span) dict[str, Any][source]
async query_trace(collector_id: str, tracer_name: str, tags: dict[str, Any] | None = None, start_time_min: datetime | None = None, start_time_max: datetime | None = None, duration_min: int | None = None, duration_max: int | None = None, search_depth: int = 20) list[Tracking][source]
duetector.analyzer.jaeger.analyzer.init_analyzer(config)[source]