Add Function Parameters

This feature requires AppSignal Collector version 0.6.0 or higher.

For languages supported through our OpenTelemetry beta, it is possible to set function parameters. Function parameters are designated for background jobs and scripts, not for storing parameters for each function call in a trace.

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.

For security and privacy we recommend filtering function parameters before sending them 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
GoJSON serialized string
PHPJSON serialized string

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

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.function.parameters", string(json)))
php
use OpenTelemetry\API\Trace\Span; $params = [ 'param1' => 'value1', 'param2' => 'value2', 'nested' => [ 'param3' => 'value3', 'param4' => 'value4', ], ]; $json = json_encode($params); $span = Span::getCurrent(); $span->setAttribute( 'appsignal.function.parameters', $json );

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

Limitations

If the application sets function parameters multiple times, the latest set value is leading.