| Stability | experimental |
|---|---|
| Safe Haskell | None |
| Language | Haskell2010 |
OpenTelemetry.Internal.Common.Types
Description
Synopsis
- data InstrumentationLibrary = InstrumentationLibrary {}
- type InstrumentationScope = InstrumentationLibrary
- instrumentationLibrary :: Text -> Text -> InstrumentationLibrary
- instrumentationScope :: Text -> Text -> InstrumentationScope
- withSchemaUrl :: Text -> InstrumentationLibrary -> InstrumentationLibrary
- withLibraryAttributes :: Attributes -> InstrumentationLibrary -> InstrumentationLibrary
- data AnyValue
- class ToValue a where
- data ShutdownResult
- worstShutdown :: ShutdownResult -> ShutdownResult -> ShutdownResult
- data FlushResult
- worstFlush :: FlushResult -> FlushResult -> FlushResult
- data ExportResult
- = Success
- | Failure (Maybe SomeException)
- parseInstrumentationLibrary :: MonadFail m => String -> m InstrumentationLibrary
- detectInstrumentationLibrary :: (Quasi m, Quote m) => m Exp
Documentation
data InstrumentationLibrary Source #
An instrumentation scope identifies the library or component providing
instrumentation. The OpenTelemetry specification renamed this concept from
"Instrumentation Library" to "Instrumentation Scope"; this type retains
the old constructor name for backwards compatibility but InstrumentationScope
is the preferred type alias.
Spec: https://opentelemetry.io/docs/specs/otel/common/instrumentation-scope/
Since: 0.0.1.0
Constructors
| InstrumentationLibrary | |
Fields
| |
Instances
type InstrumentationScope = InstrumentationLibrary Source #
Preferred alias matching the current OpenTelemetry specification terminology
("Instrumentation Scope"). Identical to InstrumentationLibrary.
Spec: https://opentelemetry.io/docs/specs/otel/common/instrumentation-scope/
Since: 0.4.0.0
instrumentationLibrary :: Text -> Text -> InstrumentationLibrary Source #
Create an InstrumentationLibrary with a name and version.
Schema URL and attributes default to empty.
Prefer instrumentationScope for new code.
Since: 0.4.0.0
instrumentationScope :: Text -> Text -> InstrumentationScope Source #
Create an InstrumentationScope with a name and version.
Schema URL and attributes default to empty.
let scope = instrumentationScope "my-service" "1.2.0"
For more fields, chain with withSchemaUrl or withLibraryAttributes:
let scope = instrumentationScope "my-service" "1.2.0"
& withSchemaUrl "https://opentelemetry.io/schemas/1.25.0"
Since: 0.4.0.0
withSchemaUrl :: Text -> InstrumentationLibrary -> InstrumentationLibrary Source #
Set the schema URL on an InstrumentationLibrary.
Since: 0.4.0.0
withLibraryAttributes :: Attributes -> InstrumentationLibrary -> InstrumentationLibrary Source #
Set attributes on an InstrumentationLibrary.
Since: 0.4.0.0
An attribute represents user-provided metadata about a span, link, or event.
Any values are used in place of 'Standard Attributes' in logs because third-party
logs may not conform to the 'Standard Attribute' format.
Telemetry tools may use this data to support high-cardinality querying, visualization in waterfall diagrams, trace sampling decisions, and more.
Since: 0.0.1.0
Constructors
| TextValue Text | |
| BoolValue Bool | |
| DoubleValue Double | |
| IntValue Int64 | |
| ByteStringValue ByteString | |
| ArrayValue [AnyValue] | |
| HashMapValue (HashMap Text AnyValue) | |
| NullValue |
Instances
| Data AnyValue Source # | |||||
Defined in OpenTelemetry.Internal.Common.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AnyValue -> c AnyValue # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AnyValue # toConstr :: AnyValue -> Constr # dataTypeOf :: AnyValue -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AnyValue) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnyValue) # gmapT :: (forall b. Data b => b -> b) -> AnyValue -> AnyValue # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AnyValue -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AnyValue -> r # gmapQ :: (forall d. Data d => d -> u) -> AnyValue -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AnyValue -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AnyValue -> m AnyValue # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AnyValue -> m AnyValue # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AnyValue -> m AnyValue # | |||||
| IsString AnyValue Source # | Create a | ||||
Defined in OpenTelemetry.Internal.Common.Types Methods fromString :: String -> AnyValue # | |||||
| Generic AnyValue Source # | |||||
Defined in OpenTelemetry.Internal.Common.Types Associated Types
| |||||
| Read AnyValue Source # | |||||
| Show AnyValue Source # | |||||
| Eq AnyValue Source # | |||||
| Ord AnyValue Source # | |||||
Defined in OpenTelemetry.Internal.Common.Types | |||||
| Hashable AnyValue Source # | |||||
Defined in OpenTelemetry.Internal.Common.Types | |||||
| ToValue AnyValue Source # | |||||
| type Rep AnyValue Source # | |||||
Defined in OpenTelemetry.Internal.Common.Types type Rep AnyValue = D1 ('MetaData "AnyValue" "OpenTelemetry.Internal.Common.Types" "hs-opentelemetry-api-1.0.0.0-inplace" 'False) (((C1 ('MetaCons "TextValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "BoolValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) :+: (C1 ('MetaCons "DoubleValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :+: C1 ('MetaCons "IntValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))) :+: ((C1 ('MetaCons "ByteStringValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :+: C1 ('MetaCons "ArrayValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AnyValue]))) :+: (C1 ('MetaCons "HashMapValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text AnyValue))) :+: C1 ('MetaCons "NullValue" 'PrefixI 'False) (U1 :: Type -> Type)))) | |||||
class ToValue a where Source #
Convert a Haskell value to an Any value.
data Foo = Foo instance ToValue Foo where toValue Foo = TextValue Foo
Since: 0.0.1.0
Instances
| ToValue ByteString Source # | |
Defined in OpenTelemetry.Internal.Common.Types Methods toValue :: ByteString -> AnyValue Source # | |
| ToValue Int64 Source # | |
| ToValue AnyValue Source # | |
| ToValue Text Source # | |
| ToValue Bool Source # | |
| ToValue Double Source # | |
| ToValue a => ToValue [a] Source # | |
Defined in OpenTelemetry.Internal.Common.Types | |
| ToValue a => ToValue (HashMap Text a) Source # | |
data ShutdownResult Source #
Since: 0.0.1.0
Constructors
| ShutdownSuccess | |
| ShutdownFailure | |
| ShutdownTimeout |
Instances
| Show ShutdownResult Source # | |
Defined in OpenTelemetry.Internal.Common.Types Methods showsPrec :: Int -> ShutdownResult -> ShowS # show :: ShutdownResult -> String # showList :: [ShutdownResult] -> ShowS # | |
| Eq ShutdownResult Source # | |
Defined in OpenTelemetry.Internal.Common.Types Methods (==) :: ShutdownResult -> ShutdownResult -> Bool # (/=) :: ShutdownResult -> ShutdownResult -> Bool # | |
worstShutdown :: ShutdownResult -> ShutdownResult -> ShutdownResult Source #
Combine two shutdown results, preferring the "worst" outcome. Failure > Timeout > Success.
Since: 0.4.0.0
data FlushResult Source #
The outcome of a call to OpenTelemetry.Trace.forceFlush or OpenTelemetry.Log.forceFlush
Since: 0.0.1.0
Constructors
| FlushTimeout | One or more spans or |
| FlushSuccess | Flushing spans or |
| FlushError | One or more exporters failed to successfully export one or more
unexported spans or |
Instances
| Show FlushResult Source # | |
Defined in OpenTelemetry.Internal.Common.Types Methods showsPrec :: Int -> FlushResult -> ShowS # show :: FlushResult -> String # showList :: [FlushResult] -> ShowS # | |
| Eq FlushResult Source # | |
Defined in OpenTelemetry.Internal.Common.Types | |
worstFlush :: FlushResult -> FlushResult -> FlushResult Source #
Combine two flush results, preferring the "worst" outcome. Error > Timeout > Success.
Since: 0.0.1.0
parseInstrumentationLibrary :: MonadFail m => String -> m InstrumentationLibrary Source #
Parses a package-version string like "my-lib-1.2.3" into an
InstrumentationLibrary. Tries to split off a trailing version (digits and
dots after the rightmost -). Falls back to treating the whole string as a
package name with no version.
Since: 0.0.1.0