Sha256: da2fe6b71da0732fe5aaf9b3cc8094d674f76314ed53a77258c965fe1e8d58fc

Contents?: true

Size: 1.64 KB

Versions: 14

Compression:

Stored size: 1.64 KB

Contents

By default, the AppOpticsAPM gem will not trace routes with extensions
for common static files.  Examples of such files may be images,
javascript, pdfs and text files.

This is done by using the regular expression stored in
`AppOpticsAPM::Config[:dnt_regexp]`:

    .(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|ttf|woff|svg|less)$

This string is used as a regular expression and is tested against
candidate URLs to be instrumented.

To replace the pattern in use, you can update this regular expression
string.  Here are some examples.

If you prefer that you want your javascript and CSS files instrumented,
you can update `AppOpticsAPM::Config[:dnt_regexp]` with an updated regexp
pattern (without the "js" and "css" entries):

    .(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|flv|swf|ttf|woff|svg|less)$

If you prefer to not instrument all javascript files except for one
named `show.js`, you could put this assignment into your initializer,
rackup file or application.rb (note that this example uses a standard
regexp [negative
look-behind](http://www.regular-expressions.info/lookaround.html) that
isn't supported in Ruby 1.8):

    AppOpticsAPM::Config[:dnt_regexp] = "(\.js$)(?<!show.js)"

Since this pattern is used with the standard Ruby Regexp class, you can
use any Regexp supported pattern.  See the documentation on Ruby Regexp
[here](https://www.omniref.com/ruby/2.2.0/symbols/Regexp?d=380181456&n=0#doc_uncollapsed=true&d=380181456&n=0)
or you can also view the oboe gem [source code documentation for this
feature](https://github.com/tracelytics/ruby-appoptics/blob/master/lib/appoptics/config.rb#L129).

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
appoptics_apm-4.2.2 examples/DNT.md
appoptics_apm-4.2.1 examples/DNT.md
appoptics_apm-4.2.0 examples/DNT.md
appoptics_apm-4.0.9 examples/DNT.md
appoptics_apm-4.1.1 examples/DNT.md
appoptics_apm-4.0.8 examples/DNT.md
appoptics_apm-4.1.0 examples/DNT.md
appoptics_apm-4.0.7 examples/DNT.md
appoptics_apm-4.0.6 examples/DNT.md
appoptics_apm-4.0.5 examples/DNT.md
appoptics_apm-4.0.4 examples/DNT.md
appoptics_apm-4.0.3 examples/DNT.md
appoptics_apm-4.0.2 examples/DNT.md
appoptics_apm-4.0.1-x86_64-linux examples/DNT.md