Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def _get_attributes(self) -> AttributeMap:
attributes.ACTIVITY_TYPE: self._turn_context.activity.type,
attributes.ACTIVITY_ID: self._turn_context.activity.id
or attributes.UNKNOWN,
attributes.ACTIVITY_NAME: self._turn_context.activity.name
or attributes.UNKNOWN,
}

def share(self, route_authorized: bool, route_matched: bool) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
ACTIVITY_CHANNEL_ID = "activity.channel_id"
ACTIVITY_ID = "activity.id"
ACTIVITY_COUNT = "activities.count"
ACTIVITY_NAME = "activity.name"
ACTIVITY_TYPE = "activity.type"

AGENTIC_USER_ID = "agentic.user_id"
Expand Down
4 changes: 3 additions & 1 deletion tests/hosting_core/telemetry/test_app_spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ def test_app_on_turn_creates_span(test_exporter):


def test_app_on_turn_span_attributes(test_exporter):
ctx = _make_context(id="act-1")
ctx = _make_context(id="act-1", name="message-received")

with AppOnTurn(ctx):
pass

span = test_exporter.get_finished_spans()[0]
assert span.attributes[attributes.ACTIVITY_TYPE] == "message"
assert span.attributes[attributes.ACTIVITY_ID] == "act-1"
assert span.attributes[attributes.ACTIVITY_NAME] == "message-received"


def test_app_on_turn_span_attributes_missing_id(test_exporter):
Expand All @@ -67,6 +68,7 @@ def test_app_on_turn_span_attributes_missing_id(test_exporter):
span = test_exporter.get_finished_spans()[0]
assert span.attributes[attributes.ACTIVITY_TYPE] == "message"
assert span.attributes[attributes.ACTIVITY_ID] == attributes.UNKNOWN
assert span.attributes[attributes.ACTIVITY_NAME] == attributes.UNKNOWN


def test_app_on_turn_records_turn_metrics(test_exporter, test_metric_reader):
Expand Down
Loading