Add Request Parameters

This feature requires AppSignal for Ruby version 4.0.0 or higher.
This feature requires AppSignal for Elixir version 1.0.0 or higher.
This feature requires AppSignal for Node.js version 3.0.0 or higher.
This feature requires AppSignal for Python version 0.3.0 or higher.
This feature requires AppSignal Collector version 0.6.0 or higher.

By default, the AppSignal integrations track request parameters for web requests in supported libraries. These include query parameters and the POST request body*. For background jobs, we store the job arguments in the parameters.

*: The languages supported through our OpenTelemetry beta store the request query parameters and request payload data separately. See the request payload data section for more information on how to set request payload data separately.

Do not send Personal Identifiable Information (PII) to AppSignal. Filter PII (e.g., names, emails) and use an ID, hash, or pseudonymized identifier instead.

Use Link Templates to link them back in your app.

You can set custom parameters on a transaction or span. Modifying the parameters of a transaction will overwrite the data set by the AppSignal instrumentations.

All parameters are filtered by our integrations before being sent to our servers.

See the table below for a list of accepted root values per language. Each nested object can contain values that result in valid JSON (strings, integers, floats, booleans, nulls, etc.).

LanguageAccepted root values
RubyArrays, Hashes
JavaScriptArrays, Objects
ElixirLists, Maps
PythonLists, Maps
Go langJSON serialized string

The below code sample shows how to set custom request parameters:

Ruby
# Values are merged at the top level Appsignal.add_params( :post => { :title => "My title", :body => "Post text." } ) Appsignal.add_params(:user => { :login => "some_name" }) Appsignal.add_params(:user => { :id => 123 }) # Parameters: # { # :post => { :title => "My title", :body => "Post text." }, # :user => { :id => 123 } # }
Elixir
Appsignal.Span.set_sample_data( Appsignal.Tracer.root_span, "params", %{ post: %{ title: "My new blog post!", body: "Some long blog post text." } } )
Node.js
import { setParams } from "@appsignal/nodejs"; setParams({ post: { title: "My new blog post!", body: "Some long blog post text.", }, });
Python
from appsignal import set_params set_params({ post: { title: "My new blog post!", body: "Some long blog post text." } })
Go
// Additional setup is required to first fetch or create a new span import ( "encoding/json" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" ) params := map[string]interface{}{ "param1": "value1", "param2": "value2", "nested": map[string]interface{}{ "param3": "value3", "param4": "value4", }, } json, _ := json.Marshal(params) span.SetAttributes(attribute.String("appsignal.request.query_parameters", string(json)))

For certain languages, additional setup is required. Please follow the instructions for these languages:

params

Request payload data

The languages supported through our OpenTelemetry beta store the request query parameters and request payload data separately. This section describes how to set the request payload data from POST requests.

You can set custom request payload data on a span. Modifying the request payload data of a span will overwrite the data set by the AppSignal instrumentations.

All parameters are filtered by our integrations before being sent to our servers.

See the table below for a list of accepted root values per language. Each nested object can contain values that result in valid JSON (strings, integers, floats, booleans, nulls, etc.).

LanguageAccepted root values
Go langJSON serialized string

The below code sample shows how to set custom request payload data:

Go
// Additional setup is required to first fetch or create a new span import ( "encoding/json" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" ) payload := map[string]interface{}{ "param1": "value1", "param2": "value2", "nested": map[string]interface{}{ "param3": "value3", "param4": "value4", }, } json, _ := json.Marshal(payload) span.SetAttributes(attribute.String("appsignal.request.payload", string(json)))

For certain languages, additional setup is required. Please follow the instructions for these languages:

Limitations

If the application sets request query parameters or request payload data multiple times, the Ruby gem will merge values at the root level. For other integrations, only the last set value is stored.