hs-opentelemetry-api-0.3.0.0: OpenTelemetry API for use by libraries for direct instrumentation or wrapper packages.
Copyright(c) Ian Duncan 2021
LicenseBSD-3
MaintainerIan Duncan
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

OpenTelemetry.Attributes

Description

An Attribute is a key-value pair, which MUST have the following properties:

  • The attribute key MUST be a non-null and non-empty string.
  • The attribute value is either:
  • A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer.
  • An array of primitive type values. The array MUST be homogeneous, i.e., it MUST NOT contain values of different types. For protocols that do not natively support array values such values SHOULD be represented as JSON strings.
  • Attribute values expressing a numerical value of zero, an empty string, or an empty array are considered meaningful and MUST be stored and passed on to processors / exporters.
Synopsis

Documentation

data Attributes Source #

Instances

Instances details
Generic Attributes Source # 
Instance details

Defined in OpenTelemetry.Attributes

Associated Types

type Rep Attributes 
Instance details

Defined in OpenTelemetry.Attributes

type Rep Attributes = D1 ('MetaData "Attributes" "OpenTelemetry.Attributes" "hs-opentelemetry-api-0.3.0.0-6VLKmhDACLT6bB8qCOmjAb" 'False) (C1 ('MetaCons "Attributes" 'PrefixI 'True) (S1 ('MetaSel ('Just "attributeMap") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AttributeMap) :*: (S1 ('MetaSel ('Just "attributesCount") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "attributesDropped") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int))))
Show Attributes Source # 
Instance details

Defined in OpenTelemetry.Attributes

Eq Attributes Source # 
Instance details

Defined in OpenTelemetry.Attributes

Ord Attributes Source # 
Instance details

Defined in OpenTelemetry.Attributes

Hashable Attributes Source # 
Instance details

Defined in OpenTelemetry.Attributes

Lift Attributes Source # 
Instance details

Defined in OpenTelemetry.Attributes

Methods

lift :: Quote m => Attributes -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Attributes -> Code m Attributes #

type Rep Attributes Source # 
Instance details

Defined in OpenTelemetry.Attributes

type Rep Attributes = D1 ('MetaData "Attributes" "OpenTelemetry.Attributes" "hs-opentelemetry-api-0.3.0.0-6VLKmhDACLT6bB8qCOmjAb" 'False) (C1 ('MetaCons "Attributes" 'PrefixI 'True) (S1 ('MetaSel ('Just "attributeMap") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AttributeMap) :*: (S1 ('MetaSel ('Just "attributesCount") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "attributesDropped") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int))))

data Attribute Source #

An attribute represents user-provided metadata about a span, link, or event.

Telemetry tools may use this data to support high-cardinality querying, visualization in waterfall diagrams, trace sampling decisions, and more.

Constructors

AttributeValue PrimitiveAttribute

An attribute representing a single primitive value

AttributeArray [PrimitiveAttribute]

An attribute representing an array of primitive values.

All values in the array MUST be of the same primitive attribute type.

Instances

Instances details
Data Attribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Attribute -> c Attribute #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Attribute #

toConstr :: Attribute -> Constr #

dataTypeOf :: Attribute -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Attribute) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Attribute) #

gmapT :: (forall b. Data b => b -> b) -> Attribute -> Attribute #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Attribute -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Attribute -> r #

gmapQ :: (forall d. Data d => d -> u) -> Attribute -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Attribute -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Attribute -> m Attribute #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Attribute -> m Attribute #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Attribute -> m Attribute #

IsString Attribute Source #

Create a TextAttribute from the string value.

Since: 0.0.2.1

Instance details

Defined in OpenTelemetry.Attributes.Attribute

Generic Attribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Associated Types

type Rep Attribute 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

type Rep Attribute = D1 ('MetaData "Attribute" "OpenTelemetry.Attributes.Attribute" "hs-opentelemetry-api-0.3.0.0-6VLKmhDACLT6bB8qCOmjAb" 'False) (C1 ('MetaCons "AttributeValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PrimitiveAttribute)) :+: C1 ('MetaCons "AttributeArray" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [PrimitiveAttribute])))
Read Attribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Show Attribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Eq Attribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Ord Attribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Hashable Attribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

FromAttribute Attribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

ToAttribute Attribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Lift Attribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Methods

lift :: Quote m => Attribute -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Attribute -> Code m Attribute #

type Rep Attribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

type Rep Attribute = D1 ('MetaData "Attribute" "OpenTelemetry.Attributes.Attribute" "hs-opentelemetry-api-0.3.0.0-6VLKmhDACLT6bB8qCOmjAb" 'False) (C1 ('MetaCons "AttributeValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PrimitiveAttribute)) :+: C1 ('MetaCons "AttributeArray" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [PrimitiveAttribute])))

class ToAttribute a where Source #

Convert a Haskell value to an Attribute value.

For most values, you can define an instance of ToPrimitiveAttribute and use the default toAttribute implementation:

data Foo = Foo

instance ToPrimitiveAttribute Foo where
  toPrimitiveAttribute Foo = TextAttribute Foo
instance ToAttribute foo

Minimal complete definition

Nothing

data PrimitiveAttribute Source #

Instances

Instances details
Data PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PrimitiveAttribute -> c PrimitiveAttribute #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PrimitiveAttribute #

toConstr :: PrimitiveAttribute -> Constr #

dataTypeOf :: PrimitiveAttribute -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PrimitiveAttribute) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PrimitiveAttribute) #

gmapT :: (forall b. Data b => b -> b) -> PrimitiveAttribute -> PrimitiveAttribute #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PrimitiveAttribute -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PrimitiveAttribute -> r #

gmapQ :: (forall d. Data d => d -> u) -> PrimitiveAttribute -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PrimitiveAttribute -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PrimitiveAttribute -> m PrimitiveAttribute #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PrimitiveAttribute -> m PrimitiveAttribute #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PrimitiveAttribute -> m PrimitiveAttribute #

IsString PrimitiveAttribute Source #

Create a TextAttribute from the string value.

Since: 0.0.2.1

Instance details

Defined in OpenTelemetry.Attributes.Attribute

Generic PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Associated Types

type Rep PrimitiveAttribute 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

type Rep PrimitiveAttribute = D1 ('MetaData "PrimitiveAttribute" "OpenTelemetry.Attributes.Attribute" "hs-opentelemetry-api-0.3.0.0-6VLKmhDACLT6bB8qCOmjAb" 'False) ((C1 ('MetaCons "TextAttribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "BoolAttribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))) :+: (C1 ('MetaCons "DoubleAttribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double)) :+: C1 ('MetaCons "IntAttribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int64))))
Read PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Show PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Eq PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Ord PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Hashable PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

FromAttribute PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

FromPrimitiveAttribute PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

ToAttribute PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

ToPrimitiveAttribute PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

Lift PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

type Rep PrimitiveAttribute Source # 
Instance details

Defined in OpenTelemetry.Attributes.Attribute

type Rep PrimitiveAttribute = D1 ('MetaData "PrimitiveAttribute" "OpenTelemetry.Attributes.Attribute" "hs-opentelemetry-api-0.3.0.0-6VLKmhDACLT6bB8qCOmjAb" 'False) ((C1 ('MetaCons "TextAttribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "BoolAttribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))) :+: (C1 ('MetaCons "DoubleAttribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double)) :+: C1 ('MetaCons "IntAttribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int64))))

newtype AttributeKey a Source #

A AttributeKey is a name for an attribute. The type parameter sets the type of the attribute the key should be associated with. This is useful for standardising attribute keys, since we can define both the key and the type of value it is intended to record.

For example, we might define:

-- See https://opentelemetry.io/docs/specs/semconv/attributes-registry/server/
serverPortKey :: AttributeKey Int
serverPortKey = "server.port"

Constructors

AttributeKey 

Fields

Instances

Instances details
IsString (AttributeKey a) Source #

Raise an error if the string is empty.

Instance details

Defined in OpenTelemetry.Attributes.Key

Generic (AttributeKey a) Source # 
Instance details

Defined in OpenTelemetry.Attributes.Key

Associated Types

type Rep (AttributeKey a) 
Instance details

Defined in OpenTelemetry.Attributes.Key

type Rep (AttributeKey a) = D1 ('MetaData "AttributeKey" "OpenTelemetry.Attributes.Key" "hs-opentelemetry-api-0.3.0.0-6VLKmhDACLT6bB8qCOmjAb" 'True) (C1 ('MetaCons "AttributeKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unkey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Methods

from :: AttributeKey a -> Rep (AttributeKey a) x #

to :: Rep (AttributeKey a) x -> AttributeKey a #

Show (AttributeKey a) Source # 
Instance details

Defined in OpenTelemetry.Attributes.Key

Eq (AttributeKey a) Source # 
Instance details

Defined in OpenTelemetry.Attributes.Key

Ord (AttributeKey a) Source # 
Instance details

Defined in OpenTelemetry.Attributes.Key

type Rep (AttributeKey a) Source # 
Instance details

Defined in OpenTelemetry.Attributes.Key

type Rep (AttributeKey a) = D1 ('MetaData "AttributeKey" "OpenTelemetry.Attributes.Key" "hs-opentelemetry-api-0.3.0.0-6VLKmhDACLT6bB8qCOmjAb" 'True) (C1 ('MetaCons "AttributeKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unkey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Attribute limits

data AttributeLimits Source #

It is possible when adding attributes that a programming error might cause too many attributes to be added to an event. Thus, Attributes use the limits set here as a safeguard against excessive memory consumption.

Constructors

AttributeLimits 

Fields

Instances

Instances details
Data AttributeLimits Source # 
Instance details

Defined in OpenTelemetry.Attributes

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AttributeLimits -> c AttributeLimits #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AttributeLimits #

toConstr :: AttributeLimits -> Constr #

dataTypeOf :: AttributeLimits -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AttributeLimits) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AttributeLimits) #

gmapT :: (forall b. Data b => b -> b) -> AttributeLimits -> AttributeLimits #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AttributeLimits -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AttributeLimits -> r #

gmapQ :: (forall d. Data d => d -> u) -> AttributeLimits -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> AttributeLimits -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> AttributeLimits -> m AttributeLimits #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AttributeLimits -> m AttributeLimits #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AttributeLimits -> m AttributeLimits #

Generic AttributeLimits Source # 
Instance details

Defined in OpenTelemetry.Attributes

Associated Types

type Rep AttributeLimits 
Instance details

Defined in OpenTelemetry.Attributes

type Rep AttributeLimits = D1 ('MetaData "AttributeLimits" "OpenTelemetry.Attributes" "hs-opentelemetry-api-0.3.0.0-6VLKmhDACLT6bB8qCOmjAb" 'False) (C1 ('MetaCons "AttributeLimits" 'PrefixI 'True) (S1 ('MetaSel ('Just "attributeCountLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "attributeLengthLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int))))
Read AttributeLimits Source # 
Instance details

Defined in OpenTelemetry.Attributes

Show AttributeLimits Source # 
Instance details

Defined in OpenTelemetry.Attributes

Eq AttributeLimits Source # 
Instance details

Defined in OpenTelemetry.Attributes

Ord AttributeLimits Source # 
Instance details

Defined in OpenTelemetry.Attributes

Hashable AttributeLimits Source # 
Instance details

Defined in OpenTelemetry.Attributes

type Rep AttributeLimits Source # 
Instance details

Defined in OpenTelemetry.Attributes

type Rep AttributeLimits = D1 ('MetaData "AttributeLimits" "OpenTelemetry.Attributes" "hs-opentelemetry-api-0.3.0.0-6VLKmhDACLT6bB8qCOmjAb" 'False) (C1 ('MetaCons "AttributeLimits" 'PrefixI 'True) (S1 ('MetaSel ('Just "attributeCountLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "attributeLengthLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int))))

defaultAttributeLimits :: AttributeLimits Source #

Default attribute limits used in the global attribute limit configuration if no environment variables are set.

Values:

Unsafe utilities