Skip to content

Commit 24260fb

Browse files
authored
fix: fix types for hints in OTel TracingHook (#73)
Signed-off-by: Federico Bond <[email protected]>
1 parent b405925 commit 24260fb

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

hooks/openfeature-hooks-opentelemetry/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ classifiers = [
1717
]
1818
keywords = []
1919
dependencies = [
20-
"openfeature-sdk>=0.4.0",
20+
"openfeature-sdk>=0.6.0",
2121
"opentelemetry-api",
2222
]
2323
requires-python = ">=3.8"

hooks/openfeature-hooks-opentelemetry/src/openfeature/contrib/hook/opentelemetry/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22

33
from openfeature.flag_evaluation import FlagEvaluationDetails
4-
from openfeature.hook import Hook, HookContext
4+
from openfeature.hook import Hook, HookContext, HookHints
55
from opentelemetry import trace
66

77
OTEL_EVENT_NAME = "feature_flag"
@@ -15,7 +15,10 @@ class EventAttributes:
1515

1616
class TracingHook(Hook):
1717
def after(
18-
self, hook_context: HookContext, details: FlagEvaluationDetails, hints: dict
18+
self,
19+
hook_context: HookContext,
20+
details: FlagEvaluationDetails,
21+
hints: HookHints,
1922
) -> None:
2023
current_span = trace.get_current_span()
2124

@@ -39,7 +42,7 @@ def after(
3942
current_span.add_event(OTEL_EVENT_NAME, event_attributes)
4043

4144
def error(
42-
self, hook_context: HookContext, exception: Exception, hints: dict
45+
self, hook_context: HookContext, exception: Exception, hints: HookHints
4346
) -> None:
4447
current_span = trace.get_current_span()
4548
current_span.record_exception(exception)

0 commit comments

Comments
 (0)