Skip to content

Commit

Permalink
wIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Jun 13, 2024
1 parent b4aa232 commit 8395c48
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def custom_event_context_extractor(lambda_event):
import logging
import os
import time
from ipdb import set_trace
from importlib import import_module
from typing import Any, Callable, Collection
from urllib.parse import urlencode
Expand All @@ -94,6 +95,7 @@ def custom_event_context_extractor(lambda_event):
)
from opentelemetry.trace.propagation import get_current_span
from opentelemetry.trace.status import Status, StatusCode
from opentelemetry.propagate import extract

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -126,6 +128,7 @@ def _default_event_context_extractor(lambda_event: Any) -> Context:
Returns:
A Context with configuration found in the event.
"""
set_trace()
headers = None
try:
headers = lambda_event["headers"]
Expand Down Expand Up @@ -161,7 +164,9 @@ def _determine_parent_context(
Returns:
A Context with configuration found in the carrier.
"""
set_trace()
parent_context = None
extract

if (
parent_context
Expand All @@ -171,7 +176,7 @@ def _determine_parent_context(
):
return parent_context

if event_context_extractor:
if event_context_extractor is not None:
parent_context = event_context_extractor(lambda_event)
else:
parent_context = _default_event_context_extractor(lambda_event)
Expand Down Expand Up @@ -277,11 +282,15 @@ def _instrument(
disable_aws_context_propagation: bool = False,
meter_provider: MeterProvider = None,
):

set_trace()

# pylint: disable=too-many-locals
# pylint: disable=too-many-statements
def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches
call_wrapped, instance, args, kwargs
):
set_trace()
orig_handler_name = ".".join(
[wrapped_module_name, wrapped_function_name]
)
Expand Down

0 comments on commit 8395c48

Please sign in to comment.