diff --git a/.credo.exs b/.credo.exs index 78319a4..522ed67 100644 --- a/.credo.exs +++ b/.credo.exs @@ -12,6 +12,7 @@ # # Run any config using `mix credo -C `. If no config name is given # "default" is used. + # name: "default", # # These are the files included in the analysis: @@ -19,24 +20,41 @@ # # You can give explicit globs or simply directories. # In the latter case `**/*.{ex,exs}` will be used. - included: ["lib/", "test/"], - excluded: [~r"/_build/", ~r"/deps/"] + # + included: [ + "lib/", + "src/", + "test/", + "web/", + "apps/*/lib/", + "apps/*/src/", + "apps/*/test/", + "apps/*/web/" + ], + excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] }, # + # Load and configure plugins here: + # + plugins: [], + # # If you create your own checks, you must specify the source files for # them here, so they can be loaded by Credo before running the analysis. - requires: [], # - # Credo automatically checks for updates, like e.g. Hex does. - # You can disable this behaviour below: - check_for_updates: true, + requires: [], # # If you want to enforce a style guide and need a more traditional linting # experience, you can change `strict` to `true` below: + # strict: true, # + # To modify the timeout for parsing files, change this value: + # + parse_timeout: 5000, + # # If you want to use uncolored output by default, you can change `color` # to `false` below: + # color: true, # # You can customize the parameters of any check by adding a second element @@ -47,88 +65,122 @@ # {Credo.Check.Design.DuplicatedCode, false} # checks: [ - {Credo.Check.Consistency.ExceptionNames}, - {Credo.Check.Consistency.LineEndings}, - {Credo.Check.Consistency.MultiAliasImportRequireUse, false}, - {Credo.Check.Consistency.ParameterPatternMatching}, - {Credo.Check.Consistency.SpaceAroundOperators}, - {Credo.Check.Consistency.SpaceInParentheses}, - {Credo.Check.Consistency.TabsOrSpaces}, - {Credo.Check.Refactor.MapInto, false}, + # + ## Consistency Checks + # + {Credo.Check.Consistency.ExceptionNames, []}, + {Credo.Check.Consistency.LineEndings, []}, + {Credo.Check.Consistency.ParameterPatternMatching, []}, + {Credo.Check.Consistency.SpaceAroundOperators, []}, + {Credo.Check.Consistency.SpaceInParentheses, []}, + {Credo.Check.Consistency.TabsOrSpaces, []}, - # For some checks, like AliasUsage, you can only customize the priority + # + ## Design Checks + # + # You can customize the priority of any check # Priority values are: `low, normal, high, higher` - {Credo.Check.Design.AliasUsage, priority: :low, if_nested_deeper_than: 10}, - - # For others you can set parameters - - # If you don't want the `setup` and `test` macro calls in ExUnit tests - # or the `schema` macro in Ecto schemas to trigger DuplicatedCode, just - # set the `excluded_macros` parameter to `[:schema, :setup, :test]`. - {Credo.Check.Design.DuplicatedCode, mass_threshold: 60}, - + # + {Credo.Check.Design.AliasUsage, + [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]}, # You can also customize the exit_status of each check. # If you don't want TODO comments to cause `mix credo` to fail, just # set this value to 0 (zero). - {Credo.Check.Design.TagTODO, exit_status: 0}, - {Credo.Check.Design.TagFIXME}, - {Credo.Check.Readability.AliasOrder, false}, - {Credo.Check.Readability.FunctionNames}, - {Credo.Check.Readability.LargeNumbers}, - {Credo.Check.Readability.MaxLineLength, false}, - {Credo.Check.Readability.ModuleAttributeNames}, - {Credo.Check.Readability.ModuleDoc}, - {Credo.Check.Readability.ModuleNames}, - # https://github.com/rrrene/credo/issues/308 - {Credo.Check.Readability.ParenthesesOnZeroArityDefs, false}, - {Credo.Check.Readability.ParenthesesInCondition}, - {Credo.Check.Readability.PredicateFunctionNames}, - {Credo.Check.Readability.PreferImplicitTry, false}, - {Credo.Check.Readability.RedundantBlankLines}, - {Credo.Check.Readability.SinglePipe}, - {Credo.Check.Readability.StringSigils}, - {Credo.Check.Readability.TrailingBlankLine}, - {Credo.Check.Readability.TrailingWhiteSpace}, - {Credo.Check.Readability.VariableNames}, - {Credo.Check.Readability.Semicolons}, - {Credo.Check.Readability.SpaceAfterCommas}, - {Credo.Check.Refactor.DoubleBooleanNegation}, - {Credo.Check.Refactor.CondStatements}, - {Credo.Check.Refactor.MatchInCondition}, - {Credo.Check.Refactor.PipeChainStart}, - {Credo.Check.Refactor.CyclomaticComplexity}, - {Credo.Check.Refactor.FunctionArity, max_arity: 7, ignore_defp: true}, - {Credo.Check.Refactor.LongQuoteBlocks}, - {Credo.Check.Refactor.MatchInCondition}, - {Credo.Check.Refactor.NegatedConditionsInUnless}, - {Credo.Check.Refactor.NegatedConditionsWithElse}, - {Credo.Check.Refactor.Nesting}, - {Credo.Check.Refactor.UnlessWithElse}, - {Credo.Check.Warning.BoolOperationOnSameValues}, - {Credo.Check.Warning.IExPry}, - {Credo.Check.Warning.IoInspect}, - {Credo.Check.Warning.OperationOnSameValues}, - {Credo.Check.Warning.OperationWithConstantResult}, - {Credo.Check.Warning.UnusedEnumOperation}, - {Credo.Check.Warning.UnusedFileOperation}, - {Credo.Check.Warning.UnusedKeywordOperation}, - {Credo.Check.Warning.UnusedListOperation}, - {Credo.Check.Warning.UnusedPathOperation}, - {Credo.Check.Warning.UnusedRegexOperation}, - {Credo.Check.Warning.UnusedStringOperation}, - {Credo.Check.Warning.UnusedTupleOperation}, - {Credo.Check.Warning.RaiseInsideRescue}, + # + {Credo.Check.Design.TagTODO, [exit_status: 2]}, + {Credo.Check.Design.TagFIXME, []}, + + # + ## Readability Checks + # + {Credo.Check.Readability.AliasOrder, []}, + {Credo.Check.Readability.FunctionNames, []}, + {Credo.Check.Readability.LargeNumbers, []}, + {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, + {Credo.Check.Readability.ModuleAttributeNames, []}, + {Credo.Check.Readability.ModuleDoc, []}, + {Credo.Check.Readability.ModuleNames, []}, + {Credo.Check.Readability.ParenthesesInCondition, []}, + {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, + {Credo.Check.Readability.PredicateFunctionNames, []}, + {Credo.Check.Readability.PreferImplicitTry, []}, + {Credo.Check.Readability.RedundantBlankLines, []}, + {Credo.Check.Readability.Semicolons, []}, + {Credo.Check.Readability.SpaceAfterCommas, []}, + {Credo.Check.Readability.StringSigils, []}, + {Credo.Check.Readability.TrailingBlankLine, []}, + {Credo.Check.Readability.TrailingWhiteSpace, []}, + {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, + {Credo.Check.Readability.VariableNames, []}, - # Controversial and experimental checks (opt-in, just remove `, false`) - {Credo.Check.Warning.LazyLogging, false}, + # + ## Refactoring Opportunities + # + {Credo.Check.Refactor.CondStatements, []}, + {Credo.Check.Refactor.CyclomaticComplexity, []}, + {Credo.Check.Refactor.FunctionArity, []}, + {Credo.Check.Refactor.LongQuoteBlocks, []}, + # {Credo.Check.Refactor.MapInto, []}, + {Credo.Check.Refactor.MatchInCondition, []}, + {Credo.Check.Refactor.NegatedConditionsInUnless, []}, + {Credo.Check.Refactor.NegatedConditionsWithElse, []}, + {Credo.Check.Refactor.Nesting, []}, + {Credo.Check.Refactor.UnlessWithElse, []}, + {Credo.Check.Refactor.WithClauses, []}, + + # + ## Warnings + # + {Credo.Check.Warning.ApplicationConfigInModuleAttribute, []}, + {Credo.Check.Warning.BoolOperationOnSameValues, []}, + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, + {Credo.Check.Warning.IExPry, []}, + {Credo.Check.Warning.IoInspect, []}, + # {Credo.Check.Warning.LazyLogging, []}, + {Credo.Check.Warning.MixEnv, []}, + {Credo.Check.Warning.OperationOnSameValues, []}, + {Credo.Check.Warning.OperationWithConstantResult, []}, + {Credo.Check.Warning.RaiseInsideRescue, []}, + {Credo.Check.Warning.UnusedEnumOperation, []}, + {Credo.Check.Warning.UnusedFileOperation, []}, + {Credo.Check.Warning.UnusedKeywordOperation, []}, + {Credo.Check.Warning.UnusedListOperation, []}, + {Credo.Check.Warning.UnusedPathOperation, []}, + {Credo.Check.Warning.UnusedRegexOperation, []}, + {Credo.Check.Warning.UnusedStringOperation, []}, + {Credo.Check.Warning.UnusedTupleOperation, []}, + {Credo.Check.Warning.UnsafeExec, []}, + + # + # Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`) + + # + # Controversial and experimental checks (opt-in, just replace `false` with `[]`) + # + {Credo.Check.Consistency.MultiAliasImportRequireUse, []}, + {Credo.Check.Consistency.UnusedVariableNames, false}, + {Credo.Check.Design.DuplicatedCode, []}, + {Credo.Check.Readability.AliasAs, []}, + {Credo.Check.Readability.BlockPipe, []}, + {Credo.Check.Readability.ImplTrue, []}, + {Credo.Check.Readability.MultiAlias, []}, + {Credo.Check.Readability.SeparateAliasRequire, []}, + {Credo.Check.Readability.SinglePipe, []}, + {Credo.Check.Readability.Specs, false}, + {Credo.Check.Readability.StrictModuleLayout, []}, + {Credo.Check.Readability.WithCustomTaggedTuple, false}, {Credo.Check.Refactor.ABCSize, false}, {Credo.Check.Refactor.AppendSingleItem, false}, - {Credo.Check.Refactor.VariableRebinding, false}, - {Credo.Check.Warning.MapGetUnsafePass, false}, - - # Deprecated checks (these will be deleted after a grace period) - {Credo.Check.Readability.Specs, false} + {Credo.Check.Refactor.DoubleBooleanNegation, []}, + {Credo.Check.Refactor.ModuleDependencies, false}, + {Credo.Check.Refactor.NegatedIsNil, false}, + {Credo.Check.Refactor.PipeChainStart, []}, + {Credo.Check.Refactor.VariableRebinding, []}, + {Credo.Check.Warning.LeakyEnvironment, []}, + {Credo.Check.Warning.MapGetUnsafePass, []}, + {Credo.Check.Warning.UnsafeToAtom, false} + # # Custom checks can be created using `mix credo.gen.check`. # ] diff --git a/config/test.exs b/config/test.exs index fc11e98..1346196 100644 --- a/config/test.exs +++ b/config/test.exs @@ -2,5 +2,5 @@ import Config config :opentelemetry, sampler: {:always_on, %{}}, - tracer: :ot_tracer_default, - processors: [{:ot_batch_processor, %{scheduled_delay_ms: 1}}] + tracer: :otel_tracer_default, + processors: [{:otel_batch_processor, %{scheduled_delay_ms: 1}}] diff --git a/lib/helpers.ex b/lib/helpers.ex index 9b711b3..cd3ebde 100644 --- a/lib/helpers.ex +++ b/lib/helpers.ex @@ -10,8 +10,8 @@ defmodule OpentelemetryAbsinthe.Helpers do but don't lose the trace information. """ - require OpenTelemetry.Tracer alias Absinthe.Middleware.Batch + require OpenTelemetry.Tracer @doc """ Works like Absinthe.Resolution.Helpers.batch, but preserves the active span. @@ -55,7 +55,7 @@ defmodule OpentelemetryAbsinthe.Helpers do batch function with the original parameter. """ def batch_fun_wrapper({{module, func, param}, span}, aggregate) do - OpenTelemetry.Tracer.set_span(span) + OpenTelemetry.Tracer.set_current_span(span) apply(module, func, [param, aggregate]) end end diff --git a/lib/instrumentation.ex b/lib/instrumentation.ex index c64293c..8bb15c0 100644 --- a/lib/instrumentation.ex +++ b/lib/instrumentation.ex @@ -9,8 +9,14 @@ defmodule OpentelemetryAbsinthe.Instrumentation do code, it just won't do anything.) """ - require OpenTelemetry.Tracer - require OpenTelemetry.Span + require OpenTelemetry.Tracer, as: Tracer + require Record + + @span_ctx_fields Record.extract(:span_ctx, + from_lib: "opentelemetry_api/include/opentelemetry.hrl" + ) + + Record.defrecord(:span_ctx, @span_ctx_fields) @default_config [ span_name: "absinthe graphql resolution", @@ -44,7 +50,7 @@ defmodule OpentelemetryAbsinthe.Instrumentation do ) end - def teardown() do + def teardown do :telemetry.detach({__MODULE__, :operation_start}) :telemetry.detach({__MODULE__, :operation_stop}) end @@ -60,8 +66,11 @@ defmodule OpentelemetryAbsinthe.Instrumentation do ) |> put_if(config.trace_request_query, {"graphql.request.query", params["query"]}) - OpenTelemetry.Tracer.start_span(config.span_name, %{attributes: attributes}) - :ok + new_ctx = Tracer.start_span(config.span_name, %{attributes: attributes}) + + Tracer.set_current_span(new_ctx) + + Logger.metadata(trace_id: span_ctx(new_ctx, :trace_id), span_id: span_ctx(new_ctx, :span_id)) end def handle_operation_stop(_event_name, _measurements, data, config) do @@ -76,8 +85,8 @@ defmodule OpentelemetryAbsinthe.Instrumentation do {"graphql.response.errors", Jason.encode!(data.blueprint.result[:errors])} ) - OpenTelemetry.Span.set_attributes(result_attributes) - OpenTelemetry.Tracer.end_span() + Tracer.set_attributes(result_attributes) + Tracer.end_span() :ok end diff --git a/mix.exs b/mix.exs index 3abebcf..03549eb 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule OpentelemetryAbsinthe.MixProject do def project do [ app: :opentelemetry_absinthe, - version: "0.2.1", + version: "0.3.0", elixir: "~> 1.10", start_permanent: Mix.env() == :prod, deps: deps(), @@ -24,9 +24,9 @@ defmodule OpentelemetryAbsinthe.MixProject do [ {:absinthe, ">= 1.4.0"}, {:jason, "~> 1.2"}, - {:opentelemetry_api, "~> 0.3.1"}, + {:opentelemetry_api, "~> 0.6.0"}, {:absinthe_plug, "~> 1.5", only: :test}, - {:opentelemetry, "~> 0.4.0", only: :test}, + {:opentelemetry, "~> 0.6.0", only: :test}, {:plug_cowboy, "~> 2.2", only: :test}, {:credo, "~> 1.4", only: [:dev, :test]}, {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false}, diff --git a/mix.lock b/mix.lock index b31a0a3..6c6574c 100644 --- a/mix.lock +++ b/mix.lock @@ -4,19 +4,20 @@ "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, "cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"}, "cowlib": {:hex, :cowlib, "2.9.1", "61a6c7c50cf07fdd24b2f45b89500bb93b6686579b069a89f88cb211e1125c78", [:rebar3], [], "hexpm", "e4175dc240a70d996156160891e1c62238ede1729e45740bdd38064dad476170"}, - "credo": {:hex, :credo, "1.4.0", "92339d4cbadd1e88b5ee43d427b639b68a11071b6f73854e33638e30a0ea11f5", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1fd3b70dce216574ce3c18bdf510b57e7c4c85c2ec9cad4bff854abaf7e58658"}, - "dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"}, + "credo": {:hex, :credo, "1.5.5", "e8f422026f553bc3bebb81c8e8bf1932f498ca03339856c7fec63d3faac8424b", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "dd8623ab7091956a855dc9f3062486add9c52d310dfd62748779c4315d8247de"}, + "dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"}, "earmark": {:hex, :earmark, "1.4.9", "837e4c1c5302b3135e9955f2bbf52c6c52e950c383983942b68b03909356c0d9", [:mix], [{:earmark_parser, ">= 1.4.9", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "0d72df7d13a3dc8422882bed5263fdec5a773f56f7baeb02379361cb9e5b0d8e"}, "earmark_parser": {:hex, :earmark_parser, "1.4.9", "819bda2049e6ee1365424e4ced1ba65806eacf0d2867415f19f3f80047f8037b", [:mix], [], "hexpm", "8bf54fddabf2d7e137a0c22660e71b49d5a0a82d1fb05b5af62f2761cd6485c4"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "ex_doc": {:hex, :ex_doc, "0.22.1", "9bb6d51508778193a4ea90fa16eac47f8b67934f33f8271d5e1edec2dc0eee4c", [:mix], [{:earmark, "~> 1.4.0", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "d957de1b75cb9f78d3ee17820733dc4460114d8b1e11f7ee4fd6546e69b1db60"}, - "jason": {:hex, :jason, "1.2.1", "12b22825e22f468c02eb3e4b9985f3d0cb8dc40b9bd704730efa11abd2708c44", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "b659b8571deedf60f79c5a608e15414085fa141344e2716fbd6988a084b5f993"}, + "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, + "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"}, "makeup": {:hex, :makeup, "1.0.3", "e339e2f766d12e7260e6672dd4047405963c5ec99661abdc432e6ec67d29ef95", [:mix], [{:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "2e9b4996d11832947731f7608fed7ad2f9443011b3b479ae288011265cdd3dad"}, "makeup_elixir": {:hex, :makeup_elixir, "0.14.1", "4f0e96847c63c17841d42c08107405a005a2680eb9c7ccadfd757bd31dabccfb", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f2438b1a80eaec9ede832b5c41cd4f373b38fd7aa33e3b22d9db79e640cbde11"}, "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm", "6cbe761d6a0ca5a31a0931bf4c63204bceb64538e664a8ecf784a9a6f3b875f1"}, "nimble_parsec": {:hex, :nimble_parsec, "0.6.0", "32111b3bf39137144abd7ba1cce0914533b2d16ef35e8abc5ec8be6122944263", [:mix], [], "hexpm", "27eac315a94909d4dc68bc07a4a83e06c8379237c5ea528a9acff4ca1c873c52"}, - "opentelemetry": {:hex, :opentelemetry, "0.4.0", "293729f014009b03a1a2c47e6367db6f280b41412faa5639f06dcce9733d18a6", [:rebar3], [{:opentelemetry_api, "~> 0.3.1", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}], "hexpm", "f0eb4281f26879147322b0a6f1c457c57f3f1c4121cbff1f6056e4c98b1647a7"}, - "opentelemetry_api": {:hex, :opentelemetry_api, "0.3.2", "b474cd21af5855a6dfff0912f26c7c40fbf1fd05b045d8e29fd53edeb4c3ec99", [:mix, :rebar3], [], "hexpm", "39b0ef74906e5d001ad244307337d168c594c2a05b67beaddad48ceaebfee352"}, + "opentelemetry": {:hex, :opentelemetry, "0.6.0", "7e7d5a9a66f047dad3ae7613fc7cef25af3c19692663c2f8c00b015e4845592a", [:rebar3], [{:opentelemetry_api, "~>0.6.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}], "hexpm", "91f486315f7c4183245e1ec146563ae1073ec2044f4d186fabe9cb4841005200"}, + "opentelemetry_api": {:hex, :opentelemetry_api, "0.6.0", "749ccbfc68b3c8347e52492503a67f85da61ed898e42a592e62db88d3bcedf19", [:mix, :rebar3], [], "hexpm", "01d6a2455b42cf3aa225692210510c39727ff92f9612aea657d1395b642ad44f"}, "plug": {:hex, :plug, "1.10.3", "c9cebe917637d8db0e759039cc106adca069874e1a9034fd6e3fdd427fd3c283", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "01f9037a2a1de1d633b5a881101e6a444bcabb1d386ca1e00bb273a1f1d9d939"}, "plug_cowboy": {:hex, :plug_cowboy, "2.3.0", "149a50e05cb73c12aad6506a371cd75750c0b19a32f81866e1a323dda9e0e99d", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "bc595a1870cef13f9c1e03df56d96804db7f702175e4ccacdb8fc75c02a7b97e"}, "plug_crypto": {:hex, :plug_crypto, "1.1.2", "bdd187572cc26dbd95b87136290425f2b580a116d3fb1f564216918c9730d227", [:mix], [], "hexpm", "6b8b608f895b6ffcfad49c37c7883e8df98ae19c6a28113b02aa1e9c5b22d6b5"}, diff --git a/test/instrumentation_test.exs b/test/instrumentation_test.exs index 3d9185c..ba1c1ca 100644 --- a/test/instrumentation_test.exs +++ b/test/instrumentation_test.exs @@ -5,7 +5,7 @@ defmodule OpentelemetryAbsintheTest.Instrumentation do doctest OpentelemetryAbsinthe.Instrumentation - for {name, spec} <- Record.extract_all(from_lib: "opentelemetry/include/ot_span.hrl") do + for {name, spec} <- Record.extract_all(from_lib: "opentelemetry/include/otel_span.hrl") do Record.defrecord(name, spec) end @@ -24,7 +24,7 @@ defmodule OpentelemetryAbsintheTest.Instrumentation do setup do Application.delete_env(:opentelemetry_absinthe, :trace_options) OpentelemetryAbsinthe.Instrumentation.teardown() - :ot_batch_processor.set_exporter(:ot_exporter_pid, self()) + :otel_batch_processor.set_exporter(:otel_exporter_pid, self()) end describe "trace configuration" do diff --git a/test/test_helper.exs b/test/test_helper.exs index df77d82..72a6c2e 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -49,7 +49,7 @@ defmodule AbsinthePlug.Test.Server do plug(Absinthe.Plug, schema: AbsinthePlug.Test.Schema) end -:ot_batch_processor.set_exporter(:ot_exporter_pid, self()) +:otel_batch_processor.set_exporter(:otel_exporter_pid, self()) child_spec = [{Plug.Cowboy, scheme: :http, plug: AbsinthePlug.Test.Server, options: [port: 8000]}] {:ok, _pid} = Supervisor.start_link(child_spec, strategy: :one_for_one)