test: change port for test_logs_e2e

otherwise sometimes it clashes with the ocurl client test
This commit is contained in:
Simon Cruanes 2025-12-27 21:33:52 -05:00
parent d9362ae788
commit 5622d81ae7
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
4 changed files with 6 additions and 17 deletions

View file

@ -7,8 +7,7 @@ let make_resource_logs ?service_name ?attrs (logs : Proto.Logs.log_record list)
let attributes = OTEL.Globals.mk_attributes ?service_name ?attrs () in
let resource = Proto.Resource.make_resource ~attributes () in
let ll =
Proto.Logs.make_scope_logs
~scope:(OTEL.Globals.instrumentation_library ())
Proto.Logs.make_scope_logs ~scope:OTEL.Globals.instrumentation_library
~log_records:logs ()
in
Proto.Logs.make_resource_logs ~resource ~scope_logs:[ ll ] ()
@ -16,8 +15,7 @@ let make_resource_logs ?service_name ?attrs (logs : Proto.Logs.log_record list)
let make_resource_spans ?service_name ?attrs spans : Proto.Trace.resource_spans
=
let ils =
Proto.Trace.make_scope_spans
~scope:(OTEL.Globals.instrumentation_library ())
Proto.Trace.make_scope_spans ~scope:OTEL.Globals.instrumentation_library
~spans ()
in
let attributes = OTEL.Globals.mk_attributes ?service_name ?attrs () in
@ -29,9 +27,7 @@ let make_resource_metrics ?service_name ?attrs (l : OTEL.Metrics.t list) :
Proto.Metrics.resource_metrics =
let open Proto.Metrics in
let lm =
make_scope_metrics
~scope:(OTEL.Globals.instrumentation_library ())
~metrics:l ()
make_scope_metrics ~scope:OTEL.Globals.instrumentation_library ~metrics:l ()
in
let attributes = OTEL.Globals.mk_attributes ?service_name ?attrs () in
let resource = Proto.Resource.make_resource ~attributes () in

View file

@ -16,14 +16,8 @@ let service_instance_id = ref None
@since 0.12 *)
let service_version = ref None
let instrumentation_name = ref "ocaml-otel"
let instrumentation_runtime_version = ref "%%VERSION_NUM%%"
let instrumentation_library () =
make_instrumentation_scope
~version:!instrumentation_runtime_version
~name:!instrumentation_name ()
let instrumentation_library =
make_instrumentation_scope ~version:"%%VERSION_NUM%%" ~name:"ocaml-otel" ()
(** Global attributes, initially set via OTEL_RESOURCE_ATTRIBUTES and modifiable
by the user code. They will be attached to each outgoing metrics/traces. *)

View file

@ -69,7 +69,6 @@ let () =
Sys.catch_break true;
T.Globals.service_name := "t1";
T.Globals.service_namespace := Some "ocaml-otel.test";
T.Globals.instrumentation_runtime_version := "<fixed>";
let debug = ref false in
let batch_traces = ref 400 in

View file

@ -3,7 +3,7 @@ module L = Opentelemetry_proto.Logs
(* NOTE: This port must be different from that used by other integration tests,
to prevent socket binding clashes. *)
let port = 4359
let port = 4399
let url = Printf.sprintf "http://localhost:%d" port