Transform operators :: Kloudfuse Docs
Transform operators
by
Groups the matching spans by the value of an attribute, returning one span set per distinct value — a quick way to see which services or operations contribute matches.
Syntax
{ <conditions> } | by(<field>)
Parameters
| Parameter |
Required |
Description |
<field> |
Required |
The attribute or intrinsic to group by. |
Example
Group the demo spans by their service name — one group per demo service.
{.service_name =~ "demo.*"} | by(.service_name)
| Root service |
Root span |
Duration |
| demo-java-service |
database |
50 ms |
| demo-go-service |
database |
50 ms |
| demo-python-service |
database |
50 ms |
select
Requests additional attributes or intrinsics in the returned span sets, so the values appear in the search results without opening each trace.
Syntax
{ <conditions> } | select(<field>, <field>, ...)
Parameters
| Parameter |
Required |
Description |
<field> |
Required |
One or more attributes (.service_name) or intrinsics (name) to include in the results. |
Example
Return the demo spans together with their operation name and service attribute.
{.service_name = "demo-python-service"} | select(name, .service_name)
| Root service |
Root span |
Duration |
| demo-python-service |
database |
50 ms |
| demo-python-service |
database |
50 ms |
| demo-python-service |
database |
50 ms |
|
|
|
select changes what is returned, not what matches. |