opentelemetry_honeycomb v0.5.0-rc.1 OpenTelemetry.Honeycomb.Json behaviour View Source
JSON back end.
The OpenTelemetry Honeycomb Exporter uses a Jason
-style JSON encoder via a behaviour so you
can adapt it to your preferred JSON encoder or decode/encode options.
To use Poison
, install it. The exporter defaults json_backend
to
OpenTelemetry.Honeycomb.Json.PoisonBackend
, which adapts Poison
to the subset of the
Jason
API we document with this behaviour.
To use Jason
, install it and configure it as the json_backend
:
config :opentelemetry,
processors: [
otel_batch_processor: %{
exporter: OpenTelemetry.Honeycomb.Exporter,
json_backend: Jason
}
]
Link to this section Summary
Types
Configuration for decode!/2
and encode_to_iodata!/2
A term that we can encode to JSON, or decode from JSON.
Functions
Decode a term from JSON using the configured back end.
Return the default configuration for decode!/2
and encode_to_iodata!/2
.
Encode a term to JSON using the configured back end.
Link to this section Types
Configuration for decode!/2
and encode_to_iodata!/2
:
json_module
: the JSON back end module
encodable_term()
View Sourceencodable_term() :: nil | boolean() | float() | integer() | String.t() | [encodable_term()] | %{optional(String.t()) => encodable_term()}
A term that we can encode to JSON, or decode from JSON.
Link to this section Functions
decode!(config, data)
View Sourcedecode!(config :: [config_opt()], data :: iodata()) :: encodable_term() | no_return()
Decode a term from JSON using the configured back end.
Return the default configuration for decode!/2
and encode_to_iodata!/2
.
encode_to_iodata!(config, term)
View Sourceencode_to_iodata!(config :: [config_opt()], term :: encodable_term()) :: iodata() | no_return()
Encode a term to JSON using the configured back end.
Link to this section Callbacks
decode!(iodata)
View Sourcedecode!(iodata()) :: encodable_term() | no_return()
Decode a term from JSON.
encode_to_iodata!(encodable_term)
View Sourceencode_to_iodata!(encodable_term()) :: iodata() | no_return()
Encode a term to JSON.