Trouble with querying spans

How can I query custom tags in spans? I have tried .foo = “bar”, and that give a syntax error. I have tried span.foo = “bar”, and that returns nothing, though there are spans that match. I have tried span.tags[“foo”] = “bar”, but again returns nothing.

Here is part of a json version of a trace. How can I query IsCompleted, for example.

Thank you.

"scopeSpans": [
{
  "scope": {
    "name": "MCosmos"
  },
  "spans": [
    {
      "traceId": "r2TGkURCEh6FBAIK4d0aGw==",
      "spanId": "S9nx8m9CRk0=",
      "name": "WaitForUpdateTasks=12000049",
      "kind": "SPAN_KIND_INTERNAL",
      "startTimeUnixNano": "1694202508467015000",
      "endTimeUnixNano": "1694202509205924000",
      "attributes": [
	{
	  "key": "IsCompleted",
	  "value": {
	    "boolValue": true
	  }
	},
	{
	  "key": "IsFaulted",
	  "value": {
	    "boolValue": false
	  }
	}
      ],
      "status": {}
    },

Hi, the syntax for a traceql query must include braces { } around the conditions. In this case you could do { span.IsCompleted = true }. Here is some documentation on TraceQL

If I misunderstood or this isn’t helping, please include a screenshot from the Grafana UI viewing one of these traces and the IsCompleted attribute, and a screenshot of the query tab. We will definitely get it worked out.