Logo of AppSignal

Menu
Docs navigation

Tagging

Use the Appsignal.Transaction.set_sample_data function to supply extra context on errors and performance issues. This can help to add information that is not already part of the request, session or environment parameters.

1
Appsignal.Transaction.set_sample_data("tags", %{locale: "en"})

Tags

Using tags you can easily add more information to errors and performance issues tracked by AppSignal. There are a few limitations on tagging though.

  • The tag key must be a String or Atom.
  • The tagged value must be a String, Atom or Integer.

Tags that do not meet these limitations are dropped without warning.

set_sample_data can be called multiple times, the given data will be merged, for example:

1
2
3
Appsignal.Transaction.set_sample_data("tags", %{locale: "en"})
Appsignal.Transaction.set_sample_data("tags", %{user: "bob"})
Appsignal.Transaction.set_sample_data("tags", %{locale: "de"})

will result in the following data:

1
2
3
4
%{
  user: "bob",
  locale: "de"
}

Link templates

Tags can also be used to create link templates. Read more about link templates in our link templates guide.

Sending personal data

Please be mindful of sending personal data about your users to AppSignal. You can choose to send user data, but a better workflow would be to send user IDs or hashes and use link templates to link them back to your own system.