> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filter function parameters

export const Compatibility = ({versions = [], label = "Available in"}) => {
  if (!Array.isArray(versions) || versions.length === 0) {
    return null;
  }
  const defaultPillStyle = {
    borderColor: "#d4d4d8",
    background: "#f4f4f5",
    color: "#3f3f46"
  };
  const pillStyles = {
    "AppSignal for Elixir": {
      background: "#f3e8ff",
      borderColor: "#d8b4fe",
      color: "#6b21a8"
    },
    "AppSignal for Front-end": {
      background: "#fef9c3",
      borderColor: "#fde047",
      color: "#854d0e"
    },
    "AppSignal for Go": {
      background: "#ccfbf1",
      borderColor: "#5eead4",
      color: "#115e59"
    },
    "AppSignal for JavaScript": {
      background: "#fef9c3",
      borderColor: "#fde047",
      color: "#854d0e"
    },
    "AppSignal for Node.js": {
      background: "#dcfce7",
      borderColor: "#86efac",
      color: "#166534"
    },
    "AppSignal for Python": {
      background: "#dbeafe",
      borderColor: "#93c5fd",
      color: "#1e40af"
    },
    "AppSignal for Ruby": {
      background: "#fee2e2",
      borderColor: "#fca5a5",
      color: "#991b1b"
    },
    "AppSignal for Rust": {
      background: "#ffedd5",
      borderColor: "#fdba74",
      color: "#9a3412"
    }
  };
  const getPillStyle = name => ({
    ...defaultPillStyle,
    ...pillStyles[name] || ({})
  });
  return <div className="not-prose my-4 rounded-lg border border-zinc-200 bg-zinc-50 px-4 py-3 text-sm dark:border-white/10 dark:bg-white/5">
      <div className="flex flex-wrap items-center gap-x-2 gap-y-1">
        <span className="font-semibold text-zinc-700 dark:text-zinc-200">
          {label}:
        </span>
        {versions.map((v, i) => <span key={`${v.name}-${v.version}-${i}`} className="inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium" style={getPillStyle(v.name)}>
            <span>{v.name}</span>
            <span className="opacity-70">
              {v.version}
              {v.exact ? "" : "+"}
            </span>
          </span>)}
      </div>
    </div>;
};

<Compatibility versions={[{ name: "AppSignal Collector", version: "0.6.0" }]} />

You can store function parameters for languages supported through our OpenTelemetry beta
Storing function parameters makes it possible to view the parameters that background jobs or scripts started with.
It's not meant to store the parameters for each function call in a trace, only the top-level parameters.

Function parameter data may contain user-identifiable information such as email addresses, API tokens, etc.
To protect your application's sensitive data, you must ensure this data is filtered out before being sent to the AppSignal servers.
This way, your application doesn't leak any sensitive data.

<Warning>
  Your application should not collect user-identifiable information (such as
  personal names, email addresses, passwords, etc.). Use the tools described in
  this guide to limit and filter out this data.
</Warning>

## Function Parameter Filtering

Function parameter filtering works with a denylist: a list of keys to filter out and not to send.
You can set a "filter function parameters" option with a list of parameter keys to filter.

Values of parameters you've configured to filter out will be replaced with a `[FILTERED]` value.
This way, the list of parameters in the app data on AppSignal.com still includes the parameter key but not the value, so you still have visibility that a value had potentially sensitive data filtered out before being sent to AppSignal.

### Example

For example, an application with this AppSignal config:

<CodeGroup>
  ```yaml YAML theme={null}
  filter_function_parameters: ["secret_key"]
  ```
</CodeGroup>

Results in this view for the parameters of a trace on AppSignal.com:

<CodeGroup>
  ```json JSON theme={null}
  {
    "secret_key": "[FILTERED]"
  }
  ```
</CodeGroup>

This guide will show you how to configure your application's function parameter filtering denylist based on what language your application uses:

* [Go](#go)
* [Java](#java)
* [PHP](#php)

## Go

Use the [`filter_function_parameters` denylist](/go/configuration/options#option-filter_function_parameters) for function parameter filtering. Set the [`send_function_parameters` option](/go/configuration/options#option-send_function_parameters) to `true` to avoid sending any function parameters.

For more information on configuring OpenTelemetry for Go apps, see the [Go configuration page](/go/configuration/options).

<CodeGroup>
  ```go Go theme={null}
  res := resource.NewWithAttributes(
  	attribute.StringSlice("appsignal.config.filter_function_parameters", []string{"api_token", "secret"}),
  )
  ```
</CodeGroup>

## Java

Use the [`filter_function_parameters` denylist](/java/configuration/options#option-filter_function_parameters) for function parameter filtering. Set the [`send_function_parameters` option](/java/configuration/options#option-send_function_parameters) to `true` to avoid sending any function parameters.

For more information on configuring OpenTelemetry for Java apps, see the [Java configuration page](/java/configuration/options).

<CodeGroup>
  ```bash Bash theme={null}
  function encode() {
    echo -n "$@" | sed 's/,/%2C/g'
  }

  export OTEL_RESOURCE_ATTRIBUTES="\
    appsignal.config.filter_function_parameters=$(encode "api_token,secret"),\
    ..."
  ```
</CodeGroup>

## PHP

Use the [`filter_function_parameters` denylist](/php/configuration/options#option-filter_function_parameters) for function parameter filtering. Set the [`send_function_parameters` option](/php/configuration/options#option-send_function_parameters) to `true` to avoid sending any function parameters.

For more information on configuring AppSignal for PHP, see the [PHP configuration page](/php/configuration/options).

<CodeGroup>
  ```php PHP theme={null}
  return [
      'filter_function_parameters' => ['api_token', 'secret'],
      // ... other options
  ];
  ```
</CodeGroup>
