Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ecto metrics "source_unavailable" #229

Open
tyhill3 opened this issue Feb 28, 2024 · 1 comment
Open

Ecto metrics "source_unavailable" #229

tyhill3 opened this issue Feb 28, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@tyhill3
Copy link

tyhill3 commented Feb 28, 2024

Describe the bug
I don't think this is a bug, I'm just not sure why I get "source_unavailable" for my Ecto metrics.

Expected behavior
I see in the code:

    defp ecto_query_tag_values(%{repo: repo, source: source, result: result}) do
      %{
        repo: repo |> Atom.to_string() |> String.trim_leading("Elixir."),
        source: normalize_source(source),
        command: normalize_command(result)
      }
    end

    defp normalize_source(nil), do: "source_unavailable"
    defp normalize_source(source) when is_binary(source), do: source
    defp normalize_source(source) when is_atom(source), do: Atom.to_string(source)
    defp normalize_source(_), do: "source_unavailable"

What scenarios result in "source_unavailable"? I see the &ecto_query_tag_values/1 call, but I'm not sure why I keep resulting in "source_unavailable".

@tyhill3 tyhill3 added the bug Something isn't working label Feb 28, 2024
@wkpatrick
Copy link

Im running off of memory here when I was looking into this a while back, but I believe source_unavailable is for inserts. Ecto does not set the source on inserts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants