mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
feat: add Globals.service_version
This commit is contained in:
parent
f8d4ac7c3c
commit
4ee29d8504
1 changed files with 12 additions and 0 deletions
|
|
@ -687,6 +687,10 @@ module Globals = struct
|
|||
(** Unique identifier for the service *)
|
||||
let service_instance_id = ref None
|
||||
|
||||
(** Version for the service
|
||||
@since NEXT_RELEASE *)
|
||||
let service_version = ref None
|
||||
|
||||
let instrumentation_library =
|
||||
default_instrumentation_scope ~version:"%%VERSION_NUM%%" ~name:"ocaml-otel"
|
||||
()
|
||||
|
|
@ -746,6 +750,14 @@ module Globals = struct
|
|||
~value:(Some (String_value v)) ()
|
||||
:: l
|
||||
in
|
||||
let l =
|
||||
match !service_version with
|
||||
| None -> l
|
||||
| Some v ->
|
||||
default_key_value ~key:Conventions.Attributes.Service.version
|
||||
~value:(Some (String_value v)) ()
|
||||
:: l
|
||||
in
|
||||
l |> merge_global_attributes_
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue