instana-haskell-trace-sdk-0.9.0.0: SDK for adding custom Instana tracing support to Haskell applications.
Safe HaskellNone
LanguageHaskell2010

Instana.SDK.Span.SpanData

Description

 
Synopsis

Documentation

data SpanData Source #

Represents span.data, that is, the tree of free-form annotatiations for a span.

Constructors

SpanData [Annotation] 

Instances

Instances details
Eq SpanData Source # 
Instance details

Defined in Instana.SDK.Span.SpanData

Show SpanData Source # 
Instance details

Defined in Instana.SDK.Span.SpanData

Generic SpanData Source # 
Instance details

Defined in Instana.SDK.Span.SpanData

Associated Types

type Rep SpanData :: Type -> Type #

Methods

from :: SpanData -> Rep SpanData x #

to :: Rep SpanData x -> SpanData #

ToJSON SpanData Source # 
Instance details

Defined in Instana.SDK.Span.SpanData

type Rep SpanData Source # 
Instance details

Defined in Instana.SDK.Span.SpanData

type Rep SpanData = D1 ('MetaData "SpanData" "Instana.SDK.Span.SpanData" "instana-haskell-trace-sdk-0.9.0.0-inplace" 'False) (C1 ('MetaCons "SpanData" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Annotation])))

data Annotation Source #

Represents a single item in span.data, either an object with child annotations or a single annotation (String, Int, Boolean, List, Maybe etc.)

Constructors

Object Text [Annotation]

Similar to the type Data.Aeson.Types.Object, an object annotation can hold multiple child annotations. In { "http": { "url": "http://localhost:8080" , "method": GET , "headers": [("X-Header-1", "value 1), ("X-Header-2", "value 2)] } } the "http" key would be an Object annotation.

Single Text AnnotationValue

Somewhat similar to Data.Aeson.Types.Pair, a single annotation holds one single value (String, Number, Boolean, List, Maybe etc.). In the example above, "url", "method" and headers would be Single annotations.

data AnnotationValue Source #

Represents the value of a span.data item.

Constructors

Simple Value 
List [Value]

For list annotations consecutive merges with the same key will add to the list instead of overwriting previous values.

Optional (Maybe Value)

If an annotation is marked as optional, it will be ommitted from the encoded JSON if it is Nothing.

Instances

Instances details
Eq AnnotationValue Source # 
Instance details

Defined in Instana.SDK.Span.SpanData

Show AnnotationValue Source # 
Instance details

Defined in Instana.SDK.Span.SpanData

Generic AnnotationValue Source # 
Instance details

Defined in Instana.SDK.Span.SpanData

Associated Types

type Rep AnnotationValue :: Type -> Type #

ToJSON AnnotationValue Source # 
Instance details

Defined in Instana.SDK.Span.SpanData

type Rep AnnotationValue Source # 
Instance details

Defined in Instana.SDK.Span.SpanData

type Rep AnnotationValue = D1 ('MetaData "AnnotationValue" "Instana.SDK.Span.SpanData" "instana-haskell-trace-sdk-0.9.0.0-inplace" 'False) (C1 ('MetaCons "Simple" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)) :+: (C1 ('MetaCons "List" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Value])) :+: C1 ('MetaCons "Optional" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Value)))))

empty :: SpanData Source #

Creates empty span data.

listAnnotation :: ToJSON a => Text -> [a] -> Annotation Source #

Creates a list annotation, which holds a list of items. For list annotations, consecutive merges with the same key will add to the list instead of overwriting previous values.

listValue :: ToJSON a => [a] -> AnnotationValue Source #

Creates the value part of a list annotation. You might want to use listAnnotation directly instead of creating the list value beforehand.

merge :: Annotation -> SpanData -> SpanData Source #

Merges the given annotation into the given span data. If there is a conflict between existing annotations and a new annotation (that is, both are at the same path of keys), this will be resolved as follows: - If both the existing and the new annotation are list annotations, they will be merged. Duplicates are allowed (that is, duplicate values will not be removed). - Otherwise, if the existing annotation or the new annotation is a single annotation, the new annotation will overwrite the existing one. - If both the existing and the new annotation are object annotations, they will be merged by applying these rules recursively.

nullAnnotation :: Text -> Annotation Source #

A convenience function to create an optional annotation that holds a Nothing.

objectAnnotation :: Text -> [Annotation] -> Annotation Source #

Creates a new object annotation. Similar to the type Data.Aeson.Types.Object, an object annotation can hold multiple child annotations. In { "http": { "url": "http://localhost:8080" , "method": GET } } the "http" key would be an Object annotation.

optionalAnnotation :: ToJSON a => Text -> Maybe a -> Annotation Source #

Creates an optional annotation, which holds a Maybe. If an optional annotation holds a Nothing value, it will be ommitted when SpanData is encoded to JSON.

optionalValue :: ToJSON a => Maybe a -> AnnotationValue Source #

Creates the value part of an optional annotation. You might want to use optionalAnnotation directly instead of creating the optional value beforehand.

simpleAnnotation :: ToJSON a => Text -> a -> Annotation Source #

Creates a simple annotation, which holds one primitive value (String, Number, Boolean, etc.).

simpleValue :: ToJSON a => a -> AnnotationValue Source #

Creates the value part of a simple annotation, that is, a primitive value (String, Number, Boolean, etc.). You might want to use simpleAnnotation directly instead of creating the simple value beforehand.

singleAnnotation :: Text -> AnnotationValue -> Annotation Source #

Creates a single annotation. Somewhat similar to Data.Aeson.Types.Pair, a single annotation holds one value (String, Number, Boolean, List, Maybe etc.).

The convenience functions simpleAnnotation, listAnnotation, and optionalAnnotation allow creating a single annotation without creating the AnnotationValue explicitly.