wolfpld / tracy

Frame profiler

Home Page:https://tracy.nereid.pl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Searchable Metadata

0xcaff opened this issue · comments

Hey, I'm a fan of the tracy profiler. At my last job, I worked on performance sensitive backend systems and came to rely heavily on DataDog's extensive distributed tracing, metrics and logging to crush tail latencies and increase throughput of the entire system. Today, I work on complex client software and I yearn for the same tools. While Tracy gives me a high level picture of my code and where cycles are being spent I wish there were some tools to slice and dice traces to get deeper insights into patterns in my code. I'll outline a feature here which datadog has in its traces and logs product. I hope to start a discussion on whether this is something other folks might find useful in tracy and whether it makes sense to add to the tool.

The Feature

In DataDog, client applications emit traces and logs. Logs and traces are objects with a bunch of fields on them (timestamp, message, etc.). The fields can be strings, numbers or objects (which in turn contain strings and numbers).

image

Applications determine the structure of the logs/traces. There are a few special fields: for example traces have fields indicating span id and parent span id. At inspection time (view the logs/traces), for a given log, I can see all its fields.

If I want to filter by a field's value, I create a facet over a field. This tells datadog how to index the field to enable filtering. There are two types of facets, discrete and continuous. Discrete facets allow for finding all logs which match a specific value (for example a specific string value) quickly and continous facets allow for finding all logs with values within a range (for example find all instances of logs where a value is between x and y or above z). Facets apply immediately to new logs/traces and I believe there's a button somewhere you can press to force it to go back and index past emissions.

I'd like the following in tracy

  1. A way for applications to emit arbitrarily structured data into tracy zones and logs. A list of fields with string names and numeric or string values.
  2. A way for quickly searching for zones/logs with a specific key and value. (Find all logs where try_lock logged its return value it was busy). At scale, indexing every field for every log is wasteful but maybe its not a big deal for the average tracy workload.

While it is possible to achieve this by jamming every key value pair into the ZoneName. I wish the ergonomics where a bit nicer.

What does tracy have today for this?

It seems like tracy has first part (for zones at least) through ZoneText. ZoneText allows for adding one or more strings of text to a zone.

What does tracy not have?

A way to search (with or without indexes) for Zones by a ZoneText value.

End

Let me know if this is this is useful information and whether it makes sense. I can try to explain it again with more examples if that's helpful. Thanks, and keep building awesome stuff!

This is something I'd really like to have too. I use Tracy as a frontend for the tracing-tracy Rust crate which is based on tracing. This turned out to work really well, but with searchable metadata (searchable by key and value independently) it would be perfect.

It appears this is implemented through user text and this filter user text (last text box, the one near the bottom).

image