{"record":{"id":"fb140e8bc8902656","repo":"microsoft/semantic-kernel","slug":"unknown-destination-type-type-destination","errorCode":null,"errorMessage":"Unknown destination type: {type(destination)}","messagePattern":"Unknown destination type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/agents/runtime/core/telemetry/tracing_config.py","lineNumber":190,"sourceCode":"            SpanKind: The span kind based on the messaging operation.\n        \"\"\"\n        if operation in [\"create\", \"send\", \"publish\"]:\n            return SpanKind.PRODUCER\n        if operation in [\"receive\", \"intercept\", \"process\", \"ack\"]:\n            return SpanKind.CONSUMER\n        return SpanKind.CLIENT\n\n    # TODO(evmattso): Use stringified convention\n    def _get_destination_str(self, destination: MessagingDestination) -> str:\n        if isinstance(destination, AgentId):\n            return f\"{destination.type}.({destination.key})-A\"\n        if isinstance(destination, TopicId):\n            return f\"{destination.type}.({destination.source})-T\"\n        if isinstance(destination, str):\n            return destination\n        if destination is None:\n            return \"\"\n        raise ValueError(f\"Unknown destination type: {type(destination)}\")\n\n    def _get_operation_type(self, operation: MessagingOperation) -> str:\n        if operation in [\"send\", \"publish\"]:\n            return \"publish\"\n        if operation in [\"create\"]:\n            return \"create\"\n        if operation in [\"receive\", \"intercept\", \"ack\"]:\n            return \"receive\"\n        if operation in [\"process\"]:\n            return \"process\"\n        return \"Unknown\"\n","sourceCodeStart":172,"sourceCodeEnd":202,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/agents/runtime/core/telemetry/tracing_config.py#L172-L202","documentation":"Raised by the tracer's _get_destination_str when the destination is not one of the four supported types: AgentId, TopicId, str, or None. The method maps a messaging destination to a string for the span name; any other type raises ValueError.","triggerScenarios":"Passing a destination object that is not AgentId, TopicId, str, or None: a custom destination class, a dict, an int, or a tuple.","commonSituations":"Custom runtime integrations that introduce new destination types without extending the tracer; passing a raw dict or primitive as a destination.","solutions":["Pass an AgentId, TopicId, str, or None as the destination.","Convert custom destinations to a string before tracing.","Extend the tracer configuration if a new destination type is genuinely needed."],"exampleFix":"// before\nspan = tracer.start_span(destination={'type': 'x', 'key': 'y'})  # dict -> ValueError\n\n// after\nspan = tracer.start_span(destination=AgentId(type='x', key='y'))","handlingStrategy":"type-guard","validationCode":"def is_supported_destination(d) -> bool:\n    from semantic_kernel.agents.runtime.core import AgentId, TopicId\n    return d is None or isinstance(d, (AgentId, TopicId, str))","typeGuard":"from semantic_kernel.agents.runtime.core import AgentId, TopicId\n\ndef is_messaging_destination(d) -> bool:\n    return d is None or isinstance(d, (AgentId, TopicId, str))","tryCatchPattern":null,"preventionTips":["Only pass AgentId, TopicId, str, or None as a destination.","Convert custom destinations to str before they reach the tracer.","Extend the tracer if a new destination type is required."],"tags":["telemetry","tracing","destination"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}