package opentelemetry

  1. Overview
  2. Docs

Logs.

See the spec

A set of callbacks that produce metrics when called. The metrics are automatically called regularly.

This allows applications to register metrics callbacks from various points in the program (or even in libraries), and not worry about setting alarms/intervals to emit them.

type t
type severity =
  1. | Severity_number_unspecified
  2. | Severity_number_trace
  3. | Severity_number_trace2
  4. | Severity_number_trace3
  5. | Severity_number_trace4
  6. | Severity_number_debug
  7. | Severity_number_debug2
  8. | Severity_number_debug3
  9. | Severity_number_debug4
  10. | Severity_number_info
  11. | Severity_number_info2
  12. | Severity_number_info3
  13. | Severity_number_info4
  14. | Severity_number_warn
  15. | Severity_number_warn2
  16. | Severity_number_warn3
  17. | Severity_number_warn4
  18. | Severity_number_error
  19. | Severity_number_error2
  20. | Severity_number_error3
  21. | Severity_number_error4
  22. | Severity_number_fatal
  23. | Severity_number_fatal2
  24. | Severity_number_fatal3
  25. | Severity_number_fatal4

Severity level of a log event

val pp_severity : Stdlib.Format.formatter -> Opentelemetry__.Logs_types.severity_number -> unit
type flags =
  1. | Log_record_flag_unspecified
  2. | Log_record_flag_trace_flags_mask
val pp_flags : Stdlib.Format.formatter -> Opentelemetry__.Logs_types.log_record_flags -> unit
val make : ?time:Timestamp_ns.t -> ?observed_time_unix_nano:Timestamp_ns.t -> ?severity:Opentelemetry__.Logs_types.severity_number -> ?log_level:string -> ?flags:int32 -> ?trace_id:Trace_id.t -> ?span_id:Span_id.t -> value -> t

Make a single log entry

val make_str : ?time:Timestamp_ns.t -> ?observed_time_unix_nano:Timestamp_ns.t -> ?severity:Opentelemetry__.Logs_types.severity_number -> ?log_level:string -> ?flags:int32 -> ?trace_id:Trace_id.t -> ?span_id:Span_id.t -> string -> t

Make a log entry whose body is a string

val make_strf : ?time:Timestamp_ns.t -> ?observed_time_unix_nano:Timestamp_ns.t -> ?severity:Opentelemetry__.Logs_types.severity_number -> ?log_level:string -> ?flags:int32 -> ?trace_id:Trace_id.t -> ?span_id:Span_id.t -> ('a, Stdlib.Format.formatter, unit, t) Stdlib.format4 -> 'a

Make a log entry with format

val emit : ?service_name:string -> ?attrs: (string * [< `Bool of bool | `Int of int | `None | `String of string ]) list -> t list -> unit

Emit logs.

This instructs the collector to send the logs to some backend at a later date. NOTE be careful not to call this inside a Gc alarm, as it can cause deadlocks.

OCaml

Innovation. Community. Security.