diff --git a/apps/opentelemetry/rebar.config b/apps/opentelemetry/rebar.config index 0fdbb61e..b1dcbeef 100644 --- a/apps/opentelemetry/rebar.config +++ b/apps/opentelemetry/rebar.config @@ -1,6 +1,5 @@ {erl_opts, [debug_info]}. -{deps, [{opentelemetry_api, "~> 1.3.0"}, - {opentelemetry_semantic_conventions, "~> 0.2"}]}. +{deps, [{opentelemetry_api, "~> 1.3.0"}]}. {profiles, [{docs, [{edoc_opts, diff --git a/apps/opentelemetry/src/opentelemetry.app.src b/apps/opentelemetry/src/opentelemetry.app.src index 0f423d95..73a54aa9 100644 --- a/apps/opentelemetry/src/opentelemetry.app.src +++ b/apps/opentelemetry/src/opentelemetry.app.src @@ -11,6 +11,7 @@ stdlib, opentelemetry_api ]}, + {exclude_paths, ["rebar.lock"]}, {env, []}, {modules, []}, diff --git a/apps/opentelemetry/src/otel_resource_detector.erl b/apps/opentelemetry/src/otel_resource_detector.erl index b9498b87..24681e15 100644 --- a/apps/opentelemetry/src/otel_resource_detector.erl +++ b/apps/opentelemetry/src/otel_resource_detector.erl @@ -46,7 +46,6 @@ -type detector() :: module() | {module(), term()}. -include_lib("kernel/include/logger.hrl"). --include_lib("opentelemetry_semantic_conventions/include/resource.hrl"). -record(data, {resource :: otel_resource:t(), detectors :: [detector()], @@ -175,7 +174,7 @@ spawn_detector(Module, Ref) -> default_resource_attributes(Resource) -> ProgName = prog_name(), - ProcessResource = otel_resource:create([{?PROCESS_EXECUTABLE_NAME, ProgName} | process_attributes()]), + ProcessResource = otel_resource:create([{'process.executable.name', ProgName} | process_attributes()]), Resource1 = otel_resource:merge(ProcessResource, Resource), Resource2 = add_service_name(Resource1, ProgName), Resource3 = add_service_instance(Resource2), @@ -184,9 +183,9 @@ default_resource_attributes(Resource) -> process_attributes() -> OtpVsn = otp_vsn(), ErtsVsn = erts_vsn(), - [{?PROCESS_RUNTIME_NAME, unicode:characters_to_binary(emulator())}, - {?PROCESS_RUNTIME_VERSION, unicode:characters_to_binary(ErtsVsn)}, - {?PROCESS_RUNTIME_DESCRIPTION, unicode:characters_to_binary(runtime_description(OtpVsn, ErtsVsn))}]. + [{'process.runtime.name', unicode:characters_to_binary(emulator())}, + {'process.runtime.version', unicode:characters_to_binary(ErtsVsn)}, + {'process.runtime.description', unicode:characters_to_binary(runtime_description(OtpVsn, ErtsVsn))}]. runtime_description(OtpVsn, ErtsVsn) -> io_lib:format("Erlang/OTP ~s erts-~s", [OtpVsn, ErtsVsn]). @@ -240,7 +239,7 @@ release_name() -> add_service_name(Resource, ProgName) -> case os:getenv("OTEL_SERVICE_NAME") of false -> - case otel_resource:is_key(?SERVICE_NAME, Resource) of + case otel_resource:is_key('service.name', Resource) of false -> ServiceResource = service_release_name(ProgName), otel_resource:merge(ServiceResource, Resource); @@ -256,7 +255,7 @@ add_service_name(Resource, ProgName) -> ServiceResource = service_release_name(ProgName), otel_resource:merge(ServiceResource, Resource); BinaryString -> - ServiceNameResource = otel_resource:create([{?SERVICE_NAME, BinaryString}]), + ServiceNameResource = otel_resource:create([{'service.name', BinaryString}]), otel_resource:merge(ServiceNameResource, Resource) end end. @@ -267,22 +266,22 @@ add_service_name(Resource, ProgName) -> add_service_instance(Resource) -> case os:getenv("OTEL_SERVICE_INSTANCE") of false -> - case otel_resource:is_key(?SERVICE_INSTANCE_ID, Resource) of + case otel_resource:is_key('service.instance.id', Resource) of false -> case erlang:node() of nonode@nohost -> ServiceInstanceId = otel_id_generator:generate_trace_id(), - ServiceInstanceResource = otel_resource:create([{?SERVICE_INSTANCE_ID, ServiceInstanceId}]), + ServiceInstanceResource = otel_resource:create([{'service.instance.id', ServiceInstanceId}]), otel_resource:merge(ServiceInstanceResource, Resource); ServiceInstance -> ServiceInstance1 = erlang:atom_to_binary(ServiceInstance, utf8), case binary:match(ServiceInstance1, <<"@localhost">>) of nomatch -> - ServiceInstanceResource = otel_resource:create([{?SERVICE_INSTANCE_ID, ServiceInstance1}]), + ServiceInstanceResource = otel_resource:create([{'service.instance.id', ServiceInstance1}]), otel_resource:merge(ServiceInstanceResource, Resource); _Match -> ServiceInstanceId = otel_id_generator:generate_trace_id(), - ServiceInstanceResource = otel_resource:create([{?SERVICE_INSTANCE_ID, ServiceInstanceId}]), + ServiceInstanceResource = otel_resource:create([{'service.instance.id', ServiceInstanceId}]), otel_resource:merge(ServiceInstanceResource, Resource) end end; @@ -290,7 +289,7 @@ add_service_instance(Resource) -> Resource end; ServiceInstance -> - ServiceInstanceResource = otel_resource:create([{?SERVICE_INSTANCE_ID, + ServiceInstanceResource = otel_resource:create([{'service.instance.id', otel_utils:assert_to_binary(ServiceInstance)}]), otel_resource:merge(ServiceInstanceResource, Resource) end. @@ -298,21 +297,21 @@ add_service_instance(Resource) -> service_release_name(ProgName) -> case find_release() of {RelName, RelVsn} when RelName =/= false -> - otel_resource:create([{?SERVICE_NAME, RelName} | + otel_resource:create([{'service.name', RelName} | case RelVsn of false -> []; - _ -> [{?SERVICE_VERSION, RelVsn}] + _ -> [{'service.version', RelVsn}] end]); _ -> - otel_resource:create([{?SERVICE_NAME, <<"unknown_service:", ProgName/binary>>}]) + otel_resource:create([{'service.name', <<"unknown_service:", ProgName/binary>>}]) end. add_telemetry_info(Resource) -> {ok, LibraryVsn} = application:get_key(opentelemetry, vsn), LibraryName = <<"opentelemetry">>, LibraryLanguage = <<"erlang">>, - ResourceAttributes = [{?TELEMETRY_SDK_NAME, LibraryName}, - {?TELEMETRY_SDK_LANGUAGE, LibraryLanguage}, - {?TELEMETRY_SDK_VERSION, LibraryVsn}], + ResourceAttributes = [{'telemetry.sdk.name', LibraryName}, + {'telemetry.sdk.language', LibraryLanguage}, + {'telemetry.sdk.version', LibraryVsn}], TelemetryInfoResource = otel_resource:create(ResourceAttributes), otel_resource:merge(TelemetryInfoResource, Resource). diff --git a/apps/opentelemetry/test/otel_resource_SUITE.erl b/apps/opentelemetry/test/otel_resource_SUITE.erl index fd44bfaf..9bfd4243 100644 --- a/apps/opentelemetry/test/otel_resource_SUITE.erl +++ b/apps/opentelemetry/test/otel_resource_SUITE.erl @@ -6,7 +6,6 @@ -include_lib("common_test/include/ct.hrl"). -include_lib("opentelemetry_api/include/opentelemetry.hrl"). --include_lib("opentelemetry_semantic_conventions/include/resource.hrl"). -include("otel_span.hrl"). -include("otel_test_utils.hrl"). -include("otel_tracer.hrl"). @@ -67,8 +66,8 @@ startup(_Config) -> Resource = otel_tracer_provider:resource(), _ = application:stop(opentelemetry), - ?assertMatch(#{?SERVICE_NAME := <<"cttest">>, - ?SERVICE_VERSION := <<"1.1.1">>}, otel_attributes:map(otel_resource:attributes(Resource))), + ?assertMatch(#{'service.name' := <<"cttest">>, + 'service.version' := <<"1.1.1">>}, otel_attributes:map(otel_resource:attributes(Resource))), ok after os:unsetenv("OTEL_RESOURCE_ATTRIBUTES"), @@ -85,8 +84,8 @@ startup_env_service_name(_Config) -> Resource = otel_tracer_provider:resource(), _ = application:stop(opentelemetry), - ?assertMatch(#{?SERVICE_NAME := <<"env-service-name">>, - ?SERVICE_VERSION := <<"1.1.1">>}, otel_attributes:map(otel_resource:attributes(Resource))), + ?assertMatch(#{'service.name' := <<"env-service-name">>, + 'service.version' := <<"1.1.1">>}, otel_attributes:map(otel_resource:attributes(Resource))), ok after os:unsetenv("OTEL_SERVICE_NAME"), @@ -110,8 +109,8 @@ crash_detector(_Config) -> Resource = otel_resource_detector:get_resource(), - ?assertMatch(#{?SERVICE_NAME := <<"cttest">>, - ?SERVICE_VERSION := <<"2.1.1">>, + ?assertMatch(#{'service.name' := <<"cttest">>, + 'service.version' := <<"2.1.1">>, c := <<"d">>, sk := <<"sv">>}, otel_attributes:map(otel_resource:attributes(Resource))), @@ -134,8 +133,8 @@ timeout_detector(_Config) -> Resource = otel_resource_detector:get_resource(), - ?assertMatch(#{?SERVICE_NAME := <<"cttest">>, - ?SERVICE_VERSION := <<"3.1.1">>, + ?assertMatch(#{'service.name' := <<"cttest">>, + 'service.version' := <<"3.1.1">>, e := <<"f">>}, otel_attributes:map(otel_resource:attributes(Resource))), ?assertEqual(otel_resource:create([]), otel_resource_detector:get_resource(0)), @@ -170,8 +169,8 @@ combining(_Config) -> Merged = otel_resource:merge(Resource1, Resource2), - Expected = otel_attributes:new([{?SERVICE_NAME, <<"other-name">>}, - {?SERVICE_VERSION, <<"1.1.1">>}], 128, 255), + Expected = otel_attributes:new([{'service.name', <<"other-name">>}, + {'service.version', <<"1.1.1">>}], 128, 255), ?assertEqual(Expected, otel_resource:attributes(Merged)), ?assertEqual(<<"https://opentelemetry.io/schemas/1.8.0">>, otel_resource:schema_url(Merged)), ok. @@ -184,8 +183,8 @@ combining_conflicting_schemas(_Config) -> Merged = otel_resource:merge(Resource1, Resource2), - Expected = otel_attributes:new([{?SERVICE_NAME, <<"other-name">>}, - {?SERVICE_VERSION, <<"1.1.1">>}], 128, 255), + Expected = otel_attributes:new([{'service.name', <<"other-name">>}, + {'service.version', <<"1.1.1">>}], 128, 255), ?assertEqual(Expected, otel_resource:attributes(Merged)), ?assertEqual(undefined, otel_resource:schema_url(Merged)), ok. @@ -203,9 +202,9 @@ unknown_service_name(_Config) -> resource_detector_timeout => 100}), Resource = otel_resource_detector:get_resource(), - ?assertMatch(#{?SERVICE_NAME := <<"unknown_service:erl">>, - ?PROCESS_RUNTIME_NAME := <<"BEAM">>, - ?PROCESS_EXECUTABLE_NAME := <<"erl">>, + ?assertMatch(#{'service.name' := <<"unknown_service:erl">>, + 'process.runtime.name' := <<"BEAM">>, + 'process.executable.name' := <<"erl">>, e := <<"f">>}, otel_attributes:map(otel_resource:attributes(Resource))), ok @@ -226,8 +225,8 @@ release_service_name(_Config) -> resource_detector_timeout => 100}), Resource = otel_resource_detector:get_resource(), - ?assertMatch(#{?SERVICE_NAME := <<"rel-cttest">>, - ?SERVICE_VERSION := <<"0.1.0">>, + ?assertMatch(#{'service.name' := <<"rel-cttest">>, + 'service.version' := <<"0.1.0">>, e := <<"f">>}, otel_attributes:map(otel_resource:attributes(Resource))), ok @@ -248,7 +247,7 @@ service_instance_id_env(_Config) -> resource_detector_timeout => 100}), Resource = otel_resource_detector:get_resource(), - ?assertMatch(#{?SERVICE_INSTANCE_ID := <<"test@instance">>, + ?assertMatch(#{'service.instance.id' := <<"test@instance">>, e := <<"f">>}, otel_attributes:map(otel_resource:attributes(Resource))), ok @@ -268,7 +267,7 @@ service_instance_id_env_attributes(_Config) -> resource_detector_timeout => 100}), Resource = otel_resource_detector:get_resource(), - ?assertMatch(#{?SERVICE_INSTANCE_ID := <<"test@instance">>, + ?assertMatch(#{'service.instance.id' := <<"test@instance">>, e := <<"f">>}, otel_attributes:map(otel_resource:attributes(Resource))), ok @@ -278,7 +277,7 @@ service_instance_id_env_attributes(_Config) -> service_instance_id_node_name(_Config) -> Resource = otel_resource_detector:get_resource(), - ?assertMatch(#{?SERVICE_INSTANCE_ID := <<"test@instance">>, + ?assertMatch(#{'service.instance.id' := <<"test@instance">>, e := <<"f">>}, otel_attributes:map(otel_resource:attributes(Resource))), ok. @@ -286,8 +285,8 @@ service_instance_id_node_name(_Config) -> service_instance_id_node_id1(_Config) -> Resource = otel_resource_detector:get_resource(), ResourceMap = otel_attributes:map(otel_resource:attributes(Resource)), - ?assertNotMatch(#{?SERVICE_INSTANCE_ID := <<"test@localhost">>}, ResourceMap), - ?assert(maps:is_key(?SERVICE_INSTANCE_ID, ResourceMap)), + ?assertNotMatch(#{'service.instance.id' := <<"test@localhost">>}, ResourceMap), + ?assert(maps:is_key('service.instance.id', ResourceMap)), ok. @@ -302,8 +301,8 @@ service_instance_id_node_id2(_Config) -> Resource = otel_resource_detector:get_resource(), ResourceMap = otel_attributes:map(otel_resource:attributes(Resource)), - ?assertNotMatch(#{?SERVICE_INSTANCE_ID := <<"nonode@nohost">>}, ResourceMap), - ?assert(maps:is_key(?SERVICE_INSTANCE_ID, ResourceMap)), + ?assertNotMatch(#{'service.instance.id' := <<"nonode@nohost">>}, ResourceMap), + ?assert(maps:is_key('service.instance.id', ResourceMap)), ok. release_service_name_no_version(_Config) -> @@ -318,9 +317,9 @@ release_service_name_no_version(_Config) -> resource_detector_timeout => 100}), Resource = otel_resource_detector:get_resource(), - ?assertMatch(#{?SERVICE_NAME := <<"rel-cttest">>, + ?assertMatch(#{'service.name' := <<"rel-cttest">>, e := <<"f">>}, otel_attributes:map(otel_resource:attributes(Resource))), - ?assertNot(maps:is_key(?SERVICE_VERSION, otel_attributes:map(otel_resource:attributes(Resource)))), + ?assertNot(maps:is_key('service.version', otel_attributes:map(otel_resource:attributes(Resource)))), ok after @@ -346,7 +345,7 @@ validate_keys(_Config) -> Resource = otel_resource_detector:get_resource(), ?assert(otel_resource:is_key(e, Resource)), - ?assert(otel_resource:is_key(?SERVICE_NAME, Resource)), + ?assert(otel_resource:is_key('service.name', Resource)), ?assert(otel_resource:is_key(<<"service.alias">>, Resource)), ?assert(otel_resource:is_key("service.alias", Resource)), ?assert(otel_resource:is_key('service.alias', Resource)), diff --git a/apps/opentelemetry_api/lib/open_telemetry/span.ex b/apps/opentelemetry_api/lib/open_telemetry/span.ex index 15d4abec..59bce947 100644 --- a/apps/opentelemetry_api/lib/open_telemetry/span.ex +++ b/apps/opentelemetry_api/lib/open_telemetry/span.ex @@ -29,8 +29,6 @@ defmodule OpenTelemetry.Span do - A Status (`t:OpenTelemetry.status/0`) """ - require OpenTelemetry.SemanticConventions.Trace - @type start_opts() :: :otel_span.start_opts() @type start_config() :: :otel_span.start_config() @@ -140,10 +138,9 @@ defmodule OpenTelemetry.Span do exception_type = to_string(exception.__struct__) exception_attributes = [ - {OpenTelemetry.SemanticConventions.Trace.exception_type(), exception_type}, - {OpenTelemetry.SemanticConventions.Trace.exception_message(), Exception.message(exception)}, - {OpenTelemetry.SemanticConventions.Trace.exception_stacktrace(), - Exception.format_stacktrace(trace)} + {:"exception.type", exception_type}, + {:"exception.message", Exception.message(exception)}, + {:"exception.stacktrace", Exception.format_stacktrace(trace)} ] add_event(span_ctx, :exception, exception_attributes ++ attributes) diff --git a/apps/opentelemetry_api/mix.exs b/apps/opentelemetry_api/mix.exs index fe282710..52f4e8f8 100644 --- a/apps/opentelemetry_api/mix.exs +++ b/apps/opentelemetry_api/mix.exs @@ -11,7 +11,6 @@ defmodule OpenTelemetry.MixProject do elixir: "~> 1.8", start_permanent: Mix.env() == :prod, deps: [ - {:opentelemetry_semantic_conventions, "~> 0.2"}, {:eqwalizer_support, git: "https://github.com/whatsapp/eqwalizer.git", branch: "main", diff --git a/apps/opentelemetry_api/mix.lock b/apps/opentelemetry_api/mix.lock index 34024f8e..39b0a707 100644 --- a/apps/opentelemetry_api/mix.lock +++ b/apps/opentelemetry_api/mix.lock @@ -1,16 +1,6 @@ %{ - "cmark": {:hex, :cmark, "0.10.0", "51217dc90fec459f34a30ea73345e6a7c1d2f3d618cb4a1738a2ebd0697a57a0", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "00abeadc6f3176e3941853122413082de95d57787777dd0400d64e568acf7c32"}, "covertool": {:hex, :covertool, "2.0.6", "4a291b4e3449025b0595d8f44c8d7635d4f48f033be2ce88d22a329f36f94a91", [:rebar3], [], "hexpm", "5db3fcd82180d8ea4ad857d4d1ab21a8d31b5aee0d60d2f6c0f9e25a411d1e21"}, "dialyxir": {:hex, :dialyxir, "1.4.2", "764a6e8e7a354f0ba95d58418178d486065ead1f69ad89782817c296d0d746a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "516603d8067b2fd585319e4b13d3674ad4f314a5902ba8130cd97dc902ce6bbd"}, - "earmark": {:hex, :earmark, "1.4.14", "d04572cef64dd92726a97d92d714e38d6e130b024ea1b3f8a56e7de66ec04e50", [:mix], [{:earmark_parser, ">= 1.4.12", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "df338b8b1852ee425180b276c56c6941cb12220e04fe8718fe4acbdd35fd699f"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.19", "de0d033d5ff9fc396a24eadc2fcf2afa3d120841eb3f1004d138cbf9273210e8", [:mix], [], "hexpm", "527ab6630b5c75c3a3960b75844c314ec305c76d9899bb30f71cb85952a9dc45"}, - "elixir_make": {:hex, :elixir_make, "0.6.2", "7dffacd77dec4c37b39af867cedaabb0b59f6a871f89722c25b28fcd4bd70530", [:mix], [], "hexpm", "03e49eadda22526a7e5279d53321d1cced6552f344ba4e03e619063de75348d9"}, "eqwalizer_support": {:git, "https://github.com/whatsapp/eqwalizer.git", "1a787cb604f6083ebe8763e358ea362e4677e500", [branch: "main", sparse: "eqwalizer_support"]}, - "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, - "ex_doc": {:hex, :ex_doc, "0.28.0", "7eaf526dd8c80ae8c04d52ac8801594426ae322b52a6156cd038f30bafa8226f", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "e55cdadf69a5d1f4cfd8477122ebac5e1fadd433a8c1022dafc5025e48db0131"}, - "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"}, - "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, - "nimble_parsec": {:hex, :nimble_parsec, "1.2.2", "b99ca56bbce410e9d5ee4f9155a212e942e224e259c7ebbf8f2c86ac21d4fa3c", [:mix], [], "hexpm", "98d51bd64d5f6a2a9c6bb7586ee8129e27dfaab1140b5a4753f24dac0ba27d2f"}, - "opentelemetry_semantic_conventions": {:hex, :opentelemetry_semantic_conventions, "0.2.0", "b67fe459c2938fcab341cb0951c44860c62347c005ace1b50f8402576f241435", [:mix, :rebar3], [], "hexpm", "d61fa1f5639ee8668d74b527e6806e0503efc55a42db7b5f39939d84c07d6895"}, + "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, } diff --git a/apps/opentelemetry_api/rebar.config b/apps/opentelemetry_api/rebar.config index 80183d2d..79231bbb 100644 --- a/apps/opentelemetry_api/rebar.config +++ b/apps/opentelemetry_api/rebar.config @@ -1,5 +1,5 @@ {erl_opts, [debug_info]}. -{deps, [{opentelemetry_semantic_conventions, "~> 0.2"}]}. +{deps, []}. {profiles, [{docs, [{edoc_opts, diff --git a/apps/opentelemetry_api/src/opentelemetry_api.app.src b/apps/opentelemetry_api/src/opentelemetry_api.app.src index 87855a6a..969e2490 100644 --- a/apps/opentelemetry_api/src/opentelemetry_api.app.src +++ b/apps/opentelemetry_api/src/opentelemetry_api.app.src @@ -6,6 +6,7 @@ [kernel, stdlib ]}, + {exclude_paths, ["rebar.lock"]}, {env,[]}, {modules, []}, diff --git a/apps/opentelemetry_api/src/otel_span.erl b/apps/opentelemetry_api/src/otel_span.erl index 6d5b674f..805887af 100644 --- a/apps/opentelemetry_api/src/otel_span.erl +++ b/apps/opentelemetry_api/src/otel_span.erl @@ -41,7 +41,6 @@ end_span/2]). -include("opentelemetry.hrl"). --include_lib("opentelemetry_semantic_conventions/include/trace.hrl"). -define(is_recording(SpanCtx), SpanCtx =/= undefined andalso SpanCtx#span_ctx.is_recording =:= true). @@ -222,8 +221,8 @@ record_exception(SpanCtx, Class, Term, Stacktrace, Attributes) when is_list(Attr record_exception(SpanCtx, Class, Term, Stacktrace, Attributes) when is_map(Attributes) -> {ok, ExceptionType} = otel_utils:format_binary_string("~0tP:~0tP", [Class, 10, Term, 10], [{chars_limit, 50}]), {ok, StacktraceString} = otel_utils:format_binary_string("~0tP", [Stacktrace, 10], [{chars_limit, 50}]), - ExceptionAttributes = #{?EXCEPTION_TYPE => ExceptionType, - ?EXCEPTION_STACKTRACE => StacktraceString}, + ExceptionAttributes = #{'exception.type' => ExceptionType, + 'exception.stacktrace' => StacktraceString}, add_event(SpanCtx, 'exception', maps:merge(ExceptionAttributes, Attributes)); record_exception(_, _, _, _, _) -> false. @@ -240,9 +239,9 @@ record_exception(SpanCtx, Class, Term, Message, Stacktrace, Attributes) when is_ record_exception(SpanCtx, Class, Term, Message, Stacktrace, Attributes) when is_map(Attributes) -> {ok, ExceptionType} = otel_utils:format_binary_string("~0tP:~0tP", [Class, 10, Term, 10], [{chars_limit, 50}]), {ok, StacktraceString} = otel_utils:format_binary_string("~0tP", [Stacktrace, 10], [{chars_limit, 50}]), - ExceptionAttributes = #{?EXCEPTION_TYPE => ExceptionType, - ?EXCEPTION_STACKTRACE => StacktraceString, - ?EXCEPTION_MESSAGE => Message}, + ExceptionAttributes = #{'exception.type' => ExceptionType, + 'exception.stacktrace' => StacktraceString, + 'exception.message' => Message}, add_event(SpanCtx, 'exception', maps:merge(ExceptionAttributes, Attributes)); record_exception(_, _, _, _, _, _) -> false. diff --git a/apps/opentelemetry_api_experimental/src/opentelemetry_api_experimental.app.src b/apps/opentelemetry_api_experimental/src/opentelemetry_api_experimental.app.src index bf350412..3bc55694 100644 --- a/apps/opentelemetry_api_experimental/src/opentelemetry_api_experimental.app.src +++ b/apps/opentelemetry_api_experimental/src/opentelemetry_api_experimental.app.src @@ -7,6 +7,7 @@ stdlib, opentelemetry_api ]}, + {exclude_paths, ["rebar.lock"]}, {env,[]}, {modules, []}, diff --git a/apps/opentelemetry_experimental/src/opentelemetry_experimental.app.src b/apps/opentelemetry_experimental/src/opentelemetry_experimental.app.src index 51be694d..8a7886a5 100644 --- a/apps/opentelemetry_experimental/src/opentelemetry_experimental.app.src +++ b/apps/opentelemetry_experimental/src/opentelemetry_experimental.app.src @@ -10,6 +10,7 @@ opentelemetry_api_experimental, opentelemetry ]}, + {exclude_paths, ["rebar.lock"]}, {env,[]}, {modules, []}, diff --git a/apps/opentelemetry_exporter/src/opentelemetry_exporter.app.src b/apps/opentelemetry_exporter/src/opentelemetry_exporter.app.src index a190794a..898eac63 100644 --- a/apps/opentelemetry_exporter/src/opentelemetry_exporter.app.src +++ b/apps/opentelemetry_exporter/src/opentelemetry_exporter.app.src @@ -11,6 +11,7 @@ tls_certificate_check, opentelemetry_api ]}, + {exclude_paths, ["rebar.lock"]}, {env,[]}, {modules, []}, diff --git a/apps/opentelemetry_zipkin/src/opentelemetry_zipkin.app.src b/apps/opentelemetry_zipkin/src/opentelemetry_zipkin.app.src index e91f6c63..3191b997 100644 --- a/apps/opentelemetry_zipkin/src/opentelemetry_zipkin.app.src +++ b/apps/opentelemetry_zipkin/src/opentelemetry_zipkin.app.src @@ -8,6 +8,7 @@ inets, opentelemetry_api ]}, + {exclude_paths, ["rebar.lock"]}, {env,[]}, {modules, []},