Sha256: 9bee3810828c2209ab66c95a357d5dcac11ce7862cc9db09552ae2f6107d4f30

Contents?: true

Size: 571 Bytes

Versions: 1

Compression:

Stored size: 571 Bytes

Contents

[[context]]
=== Adding additional context

==== Adding custom context

You can add your own custom, nested JSON-compatible data to the current transaction using `ElasticAPM.add_custom_context(hash)` eg.:

[source,ruby]
----
class ThingsController < ApplicationController
  before_action do
    ElasticAPM.add_custom_context(company: current_user.company)
  end

  # ...
end
----

==== Adding tags

Tags are special in that they are indexed in your Elasticsearch database and therefore searchable.

[source,ruby]
----
ElasticAPM.set_tag(:company_name, 'Acme, Inc.')
----

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
elastic-apm-0.2.0 docs/context.asciidoc