Skip to content

Using module attributes instead of macros #116

@hez

Description

@hez

Instrumenting our code requires extensive destructive modifications.

From

defmodule OurApp.Unit do
  def some_job do
    # ....
  end
end

To

defmodule OurApp.Unit do
  deftransaction some_job do
    # ....
  end
end

In other APM tracers I have seen the use of module attributes to augment the function.

Would look something like

defmodule OurApp.Unit do
  @trace [some_option: true]
  def some_job do
    # ....
  end
end

Example: https://github.com/newrelic/elixir_agent/blob/master/lib/new_relic/tracer.ex

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions