Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libs/executors/garf_executors/api_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import logging

from garf_core import report_fetcher
from opentelemetry import trace

from garf_executors import exceptions, execution_context, executor, fetchers
from garf_executors.telemetry import tracer
Expand Down Expand Up @@ -98,7 +99,12 @@ def execute(
Raises:
GarfExecutorError: When failed to execute query.
"""
span = trace.get_current_span()
span.set_attribute('fetcher', self.fetcher.__class__.__name__)
span.set_attribute('api_client', self.fetcher.api_client.__class__.__name__)
try:
span.set_attribute('query_title', title)
span.set_attribute('query_text', query)
logger.debug('starting query %s', query)
results = self.fetcher.fetch(
query_specification=query,
Expand Down
7 changes: 5 additions & 2 deletions libs/executors/garf_executors/entrypoints/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@

import garf_executors
from garf_executors import config, exceptions
from garf_executors.entrypoints import tracer, utils
from garf_executors.entrypoints import utils
from garf_executors.entrypoints.tracer import initialize_tracer
from garf_executors.telemetry import tracer

tracer.initialize_tracer()
initialize_tracer()


@tracer.start_as_current_span('garf.entrypoints.cli')
def main():
parser = argparse.ArgumentParser()
parser.add_argument('query', nargs='*')
Expand Down
2 changes: 2 additions & 0 deletions libs/executors/garf_executors/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
from concurrent import futures

from garf_executors import execution_context
from garf_executors.telemetry import tracer


class Executor:
"""Defines common functionality between executors."""

@tracer.start_as_current_span('api.execute_batch')
def execute_batch(
self,
batch: dict[str, str],
Expand Down