Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasecchig committed Sep 18, 2024
1 parent 02e0e11 commit 7c9cf2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from app.utils.tracing import CloudTraceLoggingSpanExporter
from fastapi import FastAPI
from fastapi.responses import RedirectResponse, StreamingResponse
from google.cloud import logging as gcp_logging
from google.cloud import logging as google_cloud_logging
from traceloop.sdk import Instruments, Traceloop

# Or choose one of the following pattern chains to test by uncommenting it:
Expand All @@ -48,7 +48,7 @@

# Initialize FastAPI app and logging
app = FastAPI()
logging_client = gcp_logging.Client()
logging_client = google_cloud_logging.Client()
logger = logging_client.logger(__name__)

# Initialize Traceloop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import logging
from typing import Any, Optional, Sequence

from google.cloud import logging as gcp_logging
from google.cloud import logging as google_cloud_logging
from google.cloud import storage
from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter
from opentelemetry.sdk.trace import ReadableSpan
Expand All @@ -34,7 +34,7 @@ class CloudTraceLoggingSpanExporter(CloudTraceSpanExporter):

def __init__(
self,
logging_client: Optional[gcp_logging.Client] = None,
logging_client: Optional[google_cloud_logging.Client] = None,
storage_client: Optional[storage.Client] = None,
bucket_name: Optional[str] = None,
debug: bool = False,
Expand All @@ -51,7 +51,7 @@ def __init__(
"""
super().__init__(**kwargs)
self.debug = debug
self.logging_client = logging_client or gcp_logging.Client(
self.logging_client = logging_client or google_cloud_logging.Client(
project=self.project_id
)
self.logger = self.logging_client.logger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from unittest.mock import Mock, patch

import pytest
from google.cloud import logging as gcp_logging
from google.cloud import logging as google_cloud_logging
from google.cloud import storage
from opentelemetry.sdk.trace import ReadableSpan

Expand All @@ -25,7 +25,7 @@

@pytest.fixture
def mock_logging_client() -> Mock:
return Mock(spec=gcp_logging.Client)
return Mock(spec=google_cloud_logging.Client)


@pytest.fixture
Expand Down

0 comments on commit 7c9cf2d

Please sign in to comment.