Skip to content

Commit 1e4989c

Browse files
committed
fix: use semconv name for error message
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
1 parent 7b9ea6e commit 1e4989c

3 files changed

Lines changed: 2 additions & 4 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ class Attributes:
88
OTEL_PROVIDER_NAME = "feature_flag.provider.name"
99
OTEL_RESULT_VALUE = "feature_flag.result.value"
1010
OTEL_RESULT_REASON = "feature_flag.result.reason"
11-
OTEL_SET_ID = "feature_flag.set.id"
12-
OTEL_VERSION = "feature_flag.version"
1311

1412

1513
class Metrics:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def error(
6969
) -> None:
7070
attributes: dict[str, AttributeValue] = {
7171
Attributes.OTEL_FLAG_KEY: hook_context.flag_key,
72-
"exception": str(exception).lower(),
72+
Attributes.OTEL_ERROR_MESSAGE: str(exception).lower(),
7373
}
7474
if hook_context.provider_metadata:
7575
attributes[Attributes.OTEL_PROVIDER_NAME] = (

hooks/openfeature-hooks-opentelemetry/tests/test_metric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def test_metric_error(mock_get_meter):
177177
{
178178
"feature_flag.key": "flag_key",
179179
"feature_flag.provider.name": "test-provider",
180-
"exception": "flag not found: flag_key",
180+
"error.message": "flag not found: flag_key",
181181
},
182182
)
183183
mock_counters["feature_flag.evaluation.success_total"].add.assert_not_called()

0 commit comments

Comments
 (0)