From c4b26ce8cde8a9cc977ab371e4f1df3966c45115 Mon Sep 17 00:00:00 2001 From: Annosha Date: Sat, 26 Oct 2024 13:13:21 +0500 Subject: [PATCH] Fix: use appropriate binary conversion for service.instance.id --- apps/opentelemetry/src/otel_resource_detector.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/opentelemetry/src/otel_resource_detector.erl b/apps/opentelemetry/src/otel_resource_detector.erl index 53197e10..6f5b21db 100644 --- a/apps/opentelemetry/src/otel_resource_detector.erl +++ b/apps/opentelemetry/src/otel_resource_detector.erl @@ -271,7 +271,7 @@ add_service_instance(Resource) -> case erlang:node() of nonode@nohost -> ServiceInstanceId = otel_id_generator:generate_trace_id(), - ServiceInstanceResource = otel_resource:create([{'service.instance.id', unicode:characters_to_binary(ServiceInstanceId)}]), + ServiceInstanceResource = otel_resource:create([{'service.instance.id', integer_to_binary(ServiceInstanceId)}]), otel_resource:merge(ServiceInstanceResource, Resource); ServiceInstance -> ServiceInstance1 = erlang:atom_to_binary(ServiceInstance, utf8), @@ -290,7 +290,7 @@ add_service_instance(Resource) -> end; ServiceInstance -> ServiceInstanceResource = otel_resource:create([{'service.instance.id', - unicode:characters_to_binary(ServiceInstance)}]), + otel_utils:assert_to_binary(ServiceInstance)}]), otel_resource:merge(ServiceInstanceResource, Resource) end.