Skip to content
Adrian Cole edited this page Jun 24, 2019 · 2 revisions

Background

Currently Zipkin supports users to search for traces using different parameters including special tags such as a services names and the corresponding spans and annotation query. Even though site specific tags can be filtered via free text annotation query, this approach has some disadvantages such as:

  • Users has to remember all the combinations
  • Users possibly enter wrong query

References

Goal

  • Zipkin should allow users to filter traces by tags dynamically.
  • The UI should have an option to select the tag key and their corresponding values.
  • The tag {key,value} pair should be applied to filter traces

Design

One option is to return the list of key pairs broken down by service.

    GET /api/v2/tags
    ["service": { "environment": "beta"}, "service2"  { "environment": "omicron"}]

As Adrian noted

Note that breaking down by service has pros and cons. Pro is that a very chatty service who abuses service names can be disabled (though that could also be done on the back end). Con is that there will be a lot of repetition, also a con is that pre-defined tag name/values will be a little more work to break down by service. Ex some sites may choose to limit the predefined key/value obviating a special api for it.

Another option is to design like our existing {service, span_name} pair. Maintaining a separate {k,v} pair which is relatively simpler and can be maintained in a separate table or index depending on the storage.

    GET /api/v2/tagKeys

    {"environment": "Environment", "threat.level": "Maturity"}

    GET /api/v2/tagValues?key=environment
    ["alpha", "beta", "omnicron"]

In order to avoid duplicate documents in Elasticsearch, the document id will be a combination of tag id: key+value.  In Cassandra it will be PRIMARY KEY (key, value).

Cardinality

One of the repeated thought that arose during the discussions was about Cardinality of tags. For some sites, the tags cardinality will be high unlike the fixed tags or environment tags. Example: Antenna-Id. But it is a known thing and we want to keep the design simple to understand and get feedback from the actual site users. 

Whitelisting

Storage should provide a way to whitelist known static tags from indexing potentially through environment variable zipkin.storage.tags. For example {environment: production} is a redundant information which will be costlier to process for every span. 

UI should provide a way to configure these static tags to appear in the filter preferably in config.json so that there is no need to make a network request for these known tags. 

Caching

The service will provide a mechanism to cache the tag keys similar to service names which will prevent frequent requests to tags API.

Clone this wiki locally