census-instrumentation / opencensus-erlang

A stats collection and distributed tracing framework
https://opencensus.io
Apache License 2.0
135 stars 39 forks source link

Unknown type: :opencensus.span_kind/0. #152

Open garthk opened 5 years ago

garthk commented 5 years ago

span_kind isn't in the export_type in opencensus.erl, causing dialyzer heartache when I use Record.extract/2 to pull out :kind.

garthk commented 5 years ago

Workaround in mix.exs:

  def project do
    [
      # ...
      dialyzer: dialyzer(),
      # ...
    ]
  end

  defp dialyzer() do
    [
      # 'mix dialyzer --format dialyzer' to get lines you can paste into:
      ignore_warnings: "dialyzer.ignore-warnings",
      list_unused_filters: true
    ]
  end

… then in dialyzer.ignore-warnings:

:0: Unknown type opencensus:span_kind/0
garthk commented 5 years ago

While you're at it, erlang:stack_item doesn't seem to be a thing:

:0: Unknown type erlang:stack_item/0