Skip to content

Commit

Permalink
Fix: use appropriate binary conversion for service.instance.id
Browse files Browse the repository at this point in the history
  • Loading branch information
Annosha committed Oct 26, 2024
1 parent a28238d commit c4b26ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/opentelemetry/src/otel_resource_detector.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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.

Expand Down

0 comments on commit c4b26ce

Please sign in to comment.