   defmacro with_span(name, start_opts \\ quote(do: %{}), do: block) do
     quote do
       :otel_tracer.with_span(
-        :opentelemetry.get_tracer(__MODULE__),
+        :opentelemetry.get_application_tracer(__MODULE__),
         unquote(name),
         Map.new(unquote(start_opts)),
         fn _ -> unquote(block) end

  """
  defmacro start_span(name, opts \\ quote(do: %{})) do
    quote bind_quoted: [name: name, start_opts: opts] do
      :otel_tracer.start_span(:opentelemetry.get_tracer(__MODULE__), name, Map.new(start_opts))
    end
  end


    quote do
      :otel_tracer.with_span(
        unquote(ctx),
        :opentelemetry.get_application_tracer(__MODULE__),
        unquote(name),
        Map.new(unquote(start_opts)),
        fn _ -> unquote(block) end
