Package

kamon

tag

Permalink

package tag

Visibility
  1. Public
  2. All

Type Members

  1. sealed trait Tag extends AnyRef

    Permalink

    Marker trait for allowed Tag implementations.

    Marker trait for allowed Tag implementations. Users are not meant to create implementations of this trait outside of Kamon. Furthermore, users of TagSet might never need to interact with these classes but rather perform lookups using the lookup DSL.

  2. class TagSet extends AnyRef

    Permalink

    A immutable collection of key/value pairs with specialized support for storing String keys pointing to String, Long and/or Boolean values.

    A immutable collection of key/value pairs with specialized support for storing String keys pointing to String, Long and/or Boolean values.

    Instances of Tags store all pairs in the same data structure, but preserving type information for the stored pairs and providing a simple DSL for accessing those values and expressing type expectations. It is also possible to lookup pairs without prescribing a mechanism for handling missing values. I.e. users of this class can decide whether to receive a null, java.util.Optional, scala.Option or any other value when looking up a pair.

    TagSet instances can only be created from the builder functions on the TagSet companion object. There are two different options to read the contained pairs from a Tags instance:

    1. Using the lookup DSL. You can use the Lookup DSL when you know exactly that you are trying to get out of the tags instance. The lookup DSL is biased towards String keys since they are by far the most common case. For example, to get a given tag as an Option[String] and another as an Option[Boolean] the following code should suffice:

    import kamon.tag.Tags.Lookup._ val tags = Tags.from(tagMap) val name = tags.get(option("name")) val isSignedIn = tags.get(booleanOption("isSignedIn"))

    2. Using the .all() and .iterator variants. This option requires you to test the returned instances to verify whether they are a Tag.String, Tag.Long or Tag.Boolean instance and act accordingly. Fortunately this cumbersome operation is rarely necessary on user-facing code.

Value Members

  1. object Lookups

    Permalink
  2. object Tag

    Permalink
  3. object TagSet

    Permalink

Ungrouped