package opentelemetry

  1. Overview
  2. Docs

Logs.

See the spec

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 : Format.formatter -> Opentelemetry__.Logs_types.severity_number -> unit
type flags =
  1. | Log_record_flags_do_not_use
  2. | Log_record_flags_trace_flags_mask
val pp_flags : 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, Format.formatter, unit, t) format4 -> 'a

Make a log entry with format

val emit : ?service_name:string -> ?attrs: (string * [< `Bool of bool | `Float of float | `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.