Machine readable representation with the possibility to represent with varying serialisations based on the detail level.
This will result in JSON formatted log output.
A forMachine implementation is required for any instance definition.
Human-readable representation.
The empty text indicates there's no specific human-readable formatting for that type - this is the default implementation.
If however human-readble output is explicitly requested, e.g. by logs, the system will fall back to a JSON object
conforming to the forMachine definition, and rendering it as a value in {"data": value}`
Leaving out forHuman in some instance definition will not lead to loss of log information that way.
This type defines metrics, and how to update them.
The Text field always contains the metric name.
Metric names are recommended to conform to the Prometheus data model.
If you want to structure your metrics in namespaces, please use a dot separator, such as "name.space.metricName".
Example, defining three metrics based on the occurrence of a single trace event:
data Trace = BatchProcessed { batchSize :: Int }
instance LogFormatting Trace where
asMetrics (BatchProcessed size) =
[ IntM "batch.current" (fromIntegral size) -- element count of the most recent batch
, CounterM "batchesTotal" Nothing -- total batches processed (increment by 1)
, CounterM "batch.total" (Just $ fromIntegral size) -- total elements processed
]
A label set containing the specified key-value pairs.
The OpenMetrics standard permits empty label sets; the value of this labeled metric will always be "1".
For instance, a PrometheusM "foo" [("key1", "value1"), ("key2", "value2")]
will be exposed as "foo{key1="value1",key2="value2"} 1"
Instances5Eq, Show, Generic, NFData, Rep
EqMetricDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
ShowMetricDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
GenericMetricDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
NFDataMetricDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
A unique identifier for every message, composed of text
A namespace can as well appear with the tracer name (e.g. ChainDB.OpenEvent.OpenedDB),
or more prefixes, in this moment it is a NamespaceOuter is used
When configuring a net of tracers, it should be run with Config on all
entry points first, and then with TCOptimize. When reconfiguring it needs to
run TCReset followed by Config followed by TCOptimize