Skip to content
Open
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
2 changes: 1 addition & 1 deletion libs/executors/garf_executors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ def setup_executor(
'ApiExecutionContext',
]

__version__ = '0.1.4'
__version__ = '0.1.5'
14 changes: 14 additions & 0 deletions libs/executors/garf_executors/entrypoints/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,18 @@ def initialize_tracer():
OTLPSpanExporter(endpoint=otel_endpoint, insecure=True)
)
tracer_provider.add_span_processor(otlp_processor)
tracer_provider.add_span_processor(otlp_processor)
if gcp_project_id := os.getenv('OTEL_EXPORTER_GCP_TRACE_PROJECT_ID'):
try:
from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter
except ImportError as e:
raise ImportError(
'Please install garf_executors with GCP support '
'- `pip install garf_executors[gcp]`'
) from e

cloud_span_processor = BatchSpanProcessor(
CloudTraceSpanExporter(project_id=gcp_project_id)
)
tracer_provider.add_span_processor(cloud_span_processor)
trace.set_tracer_provider(tracer_provider)
7 changes: 5 additions & 2 deletions libs/executors/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies = [
"pydantic",
"opentelemetry-api",
"opentelemetry-sdk",
"opentelemetry-exporter-otlp",
]
authors = [
{name = "Google Inc. (gTech gPS CSE team)", email = "[email protected]"},
Expand Down Expand Up @@ -48,13 +49,15 @@ sql=[
"garf-io[sqlalchemy]",
"pandas",
]
gcp= [
"opentelemetry-exporter-gcp-trace",
]
server=[
"fastapi[standard]",
"opentelemetry-instrumentation-fastapi",
"opentelemetry-exporter-otlp",
]
all = [
"garf-executors[bq,sql,server]"
"garf-executors[bq,sql,server,gcp]"
]
[project.scripts]
garf="garf_executors.entrypoints.cli:main"