Defining custom conventions
There are multiple ways to express even the most basic things. If we take our meme application example from Chapter 5, Configuration and Control Plane, we enriched all spans with the meme name attribute so that we can find when the meme was uploaded or how frequently it’s accessed.
We chose that approach, but we could instead write a log with the meme name once, and then use slightly more complicated queries to find all traces related to that meme. We could come up with something else, but what’s important is to keep the approach consistent across the system.
Even with a custom attribute added to each span, there are still plenty of things to consider when recording such an attribute:
- Attribute name:
meme_name
,meme.name
, andmemeName
are different attributes. Unless we document the exact name and define it as a constant somewhere, someone will eventually use the wrong variation of it. - Type: The meme name is just a string...