This allows clien implementors to micromanage the state of the protobuf
`encoder` if they want, or to just let the library handle allocation and
garbage collection of encoder states when that level of resource
managment is not required.
The `tick_common` function is only used once.
Removing the indirection also lets us see that we were calling
`sample_gc_metrics_if_needed` twice in a row on each tick.
Matches the convention in /src/trace/dune and prevents dependency on
the library from polluting the global namespace of a component with the
generic `Client` module.
As discussed in https://github.com/ocaml/ocaml/issues/14078,
alerts (with deprecation alerts as a special case) are not currently
supported as item-attributes on let-bindings. This usage produces
`misplaced-attribute` warnings, such as
```
Warning 53 [misplaced-attribute]: the "deprecated" attribute cannot appear in this context
File "src/core/opentelemetry.ml", line 1229, characters 37-47:
1229 | let add_event = Scope.add_event [@@deprecated "use Scope.add_event"]
^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "deprecated" attribute cannot appear in this context
File "src/core/opentelemetry.ml", line 1231, characters 37-47:
1231 | let add_attrs = Scope.add_attrs [@@deprecated "use Scope.add_attrs"]
^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "deprecated" attribute cannot appear in this context
```
Fortunately, we can still add deprecation alerts to these value by
moving the alert to the pattern, as done here.
As of OCaml 5.3, the OCaml runtime doesn't support signals on
Windows. Trying to block them with Thread.sigmask will raise:
Thread 5 killed on uncaught exception Invalid_argument("Thread.sigmask not implemented")
Raised by primitive operation at Opentelemetry_client_ocurl.start_bg_thread.run in file "src/client-ocurl/opentelemetry_client_ocurl.ml", line 106, characters 12-49