Skip to content

context not propagated from kagent -> kagent-tools #24

@peterj

Description

@peterj

Notice the parentSpanId of the spans with the "kagent-tools" service name doesn't match any of the execute_tool spans:

[

    {
        "traceId": "a018c8f8b5321be6e92fa7b2577d625a",
        "spanId": "680c9e0d2afce47d",
        "parentSpanId": "13a166e55d04d943",
        "serviceName": "kagent",
        "operationName": "execute_tool k8s_get_resources",
        "startTime": {
            "seconds": 1757086452,
            "nanos": 268017589
        },
        "duration": {
            "seconds": 0,
            "nanos": 365
        }
    },
    {
        "traceId": "a018c8f8b5321be6e92fa7b2577d625a",
        "spanId": "3d73b1b80ed13686",
        "parentSpanId": "13a166e55d04d943",
        "serviceName": "kagent",
        "operationName": "execute_tool k8s_get_resources",
        "startTime": {
            "seconds": 1757086452,
            "nanos": 270561422
        },
        "duration": {
            "seconds": 0,
            "nanos": 361
        }
    },

    {
        "traceId": "a018c8f8b5321be6e92fa7b2577d625a",
        "spanId": "e0e4dc496e64afbb",
        "parentSpanId": "bd36e757ec38d1b8",
        "serviceName": "kagent-tools",
        "operationName": "commands.execute",
        "spanAttributes": [
            {
                "key": "args",
                "value": "[\"get\",\"deployment\",\"-o\",\"wide\"]"
            },
            {
                "key": "built_args",
                "value": "[\"get\",\"deployment\",\"-o\",\"wide\"]"
            },
            {
                "key": "built_command",
                "value": "\"kubectl\""
            },
            {
                "key": "cached",
                "value": "false"
            },
            {
                "key": "command",
                "value": "\"kubectl\""
            },
            {
                "key": "result_length",
                "value": "\"10538\""
            }
        ],
        "startTime": {
            "seconds": 1757086452,
            "nanos": 277799922
        },
        "duration": {
            "seconds": 0,
            "nanos": 352
        }
    },
    {
        "traceId": "a018c8f8b5321be6e92fa7b2577d625a",
        "spanId": "a843d1cc5f6ff4bd",
        "parentSpanId": "2f672f2e70ec5615",
        "serviceName": "kagent-tools",
        "operationName": "commands.execute",
        "spanAttributes": [
            {
                "key": "args",
                "value": "[\"get\",\"pod\",\"-o\",\"wide\"]"
            },
            {
                "key": "built_args",
                "value": "[\"get\",\"pod\",\"-o\",\"wide\"]"
            },
            {
                "key": "built_command",
                "value": "\"kubectl\""
            },
            {
                "key": "cached",
                "value": "false"
            },
            {
                "key": "command",
                "value": "\"kubectl\""
            },
            {
                "key": "result_length",
                "value": "\"3129\""
            }
        ],
        "startTime": {
            "seconds": 1757086452,
            "nanos": 277838380
        },
        "duration": {
            "seconds": 0,
            "nanos": 354
        }
    },
    {
        "traceId": "a018c8f8b5321be6e92fa7b2577d625a",
        "spanId": "2f672f2e70ec5615",
        "parentSpanId": "099bafa83362c5ff",
        "serviceName": "kagent-tools",
        "operationName": "mcp.tool.k8s_get_resources",
        "spanAttributes": [
            {
                "key": "http",
                "value": "{\"header\":{\"User-Agent\":\"python-httpx/0.28.1\"},\"parent_span_id\":\"099bafa83362c5ff\",\"parent_trace_id\":\"a018c8f8b5321be6e92fa7b2577d625a\"}"
            },
            {
                "key": "mcp",
                "value": "{\"request\":{\"arguments\":\"{\\\"output\\\":\\\"wide\\\",\\\"resource_type\\\":\\\"pod\\\"}\",\"id\":\"k8s_get_resources\"},\"result\":{\"content_count\":\"1\",\"is_error\":false},\"tool\":{\"duration_seconds\":0.356380375,\"name\":\"k8s_get_resources\"}}"
            }
        ],
        "startTime": {
            "seconds": 1757086452,
            "nanos": 275590964
        },
        "duration": {
            "seconds": 0,
            "nanos": 356
        }
    },
    {
        "traceId": "a018c8f8b5321be6e92fa7b2577d625a",
        "spanId": "bd36e757ec38d1b8",
        "parentSpanId": "c79764444c62a556",
        "serviceName": "kagent-tools",
        "operationName": "mcp.tool.k8s_get_resources",
        "spanAttributes": [
            {
                "key": "http",
                "value": "{\"header\":{\"User-Agent\":\"python-httpx/0.28.1\"},\"parent_span_id\":\"c79764444c62a556\",\"parent_trace_id\":\"a018c8f8b5321be6e92fa7b2577d625a\"}"
            },
            {
                "key": "mcp",
                "value": "{\"request\":{\"arguments\":\"{\\\"output\\\":\\\"wide\\\",\\\"resource_type\\\":\\\"deployment\\\"}\",\"id\":\"k8s_get_resources\"},\"result\":{\"content_count\":\"1\",\"is_error\":false},\"tool\":{\"duration_seconds\":0.353295,\"name\":\"k8s_get_resources\"}}"
            }
        ],
        "startTime": {
            "seconds": 1757086452,
            "nanos": 276565214
        },
        "duration": {
            "seconds": 0,
            "nanos": 353
        }
    }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions