Go config options

AppSignal for Go can be configured through OpenTelemetry resource attributes.

Resource attributes are attributes that apply that every trace reported from the application using OpenTelemetry.

These resource attributes should be configured in your application, where you also configure the OpenTelemetry exporter to export to the AppSignal collector.

To configure the resource attributes, add a resource to your tracer provider like shown below

Go
import ( // Other imports here... // Import these OpenTelemetry packages "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" semconv "go.opentelemetry.io/otel/semconv/v1.27.0" sdktrace "go.opentelemetry.io/otel/sdk/trace" ) func initTracer() func(context.Context) error { // OpenTelemetry config setup here res := resource.NewSchemaless( // Add your resource attributes here // Example config option set as a resource attribute resource.WithAttributes(attribute.String("appsignal.config.name", "My app name")), ) tracerProvider := sdktrace.NewTracerProvider( // Including other `.With...` function calls sdktrace.WithResource(res), ) // Followed by the rest of the OpenTelemetry config }

Available options

environment

Resource attribute keyappsignal.config.environment
Requiredyes
TypeString
Default valuenil (This is unset by default)

Description

The environment of the app to be reported to AppSignal.

Go
res := resource.NewWithAttributes( resource.WithAttributes(attribute.String("appsignal.config.environment", "production")), // And other resource attributes )
Note: Changing the name or environment of an existing app will create a new app on AppSignal.com.

host.name

Resource attribute keyhost.name
Requiredyes
TypeString
Default valuedetected from system

Description

The host.name resource attribute helps AppSignal recognize different hosts for traces and tag the traces automatically with the hostname.

Go
import ( "os" // And other imports ) // Fetch hostname from system hostname, err := os.Hostname() if err != nil { hostname = "unknown" } res := resource.NewWithAttributes( resource.WithAttributes(attribute.String("host.name", hostname)), // And other resource attributes )

language_integration

Resource attribute keyappsignal.config.language_integration
Requiredyes
TypeString
Default valueundefined

Description

AppSignal uses the language_integration resource attribute to detect the language of a trace and correctly parse exception backtraces.

To set this option, specify the language name in lowercase format, e.g. "python", "rust", "ruby", "elixir", "golang" and "nodejs".

Go
res := resource.NewWithAttributes( resource.WithAttributes(attribute.String("appsignal.config.language_integration", "golang")), // And other resource attributes )

name

Resource attribute keyappsignal.config.name
Requiredyes
TypeString
Default valuenil (This is unset by default)

Description

Name of your application as it should be displayed on AppSignal.com.

Go
res := resource.NewWithAttributes( resource.WithAttributes(attribute.String("appsignal.config.name", "My awesome app")), // And other resource attributes )
Note: Changing the name or environment of an existing app will create a new app on AppSignal.com.

push_api_key

Resource attribute keyappsignal.config.push_api_key
Requiredyes
TypeString
Default valuenil (This is unset by default)

Description

The organization-level authentication key to authenticate with our Push API.

Read more about the AppSignal Push API key.

Go
res := resource.NewWithAttributes( resource.WithAttributes(attribute.String("appsignal.config.push_api_key", "00000000-0000-0000-0000-000000000000")), // And other resource attributes )

revision

Resource attribute keyappsignal.config.revision
Requiredyes
TypeString
Default valuenil (This is unset by default)

Description

Set the app revision to report the currently running version of your app. AppSignal will create a deploy marker when this value changes, and tag all incoming data with the current revision.

Read more about deploy markers in the deploy markers topic.

Go
import ( "os/exec" // And other imports ) var revision string cmd := exec.Command("git", "rev-parse", "--short", "HEAD") output, err := cmd.Output() if err != nil { revision = "unknown" } else { revision = strings.TrimSpace(string(output)) } res := resource.NewWithAttributes( resource.WithAttributes(attribute.String("appsignal.config.revision", revision)), // And other resource attributes )

service.name

Resource attribute keyservice.name
Requiredyes
TypeString
Default valueundefined

Description

The service.name resource attribute helps AppSignal recognize different services for traces and groups the traces automatically in a namespace based on the service name.

Choose a name that fits your application, like "Web server", "Background worker", "Email service", "Authentication service", etc.

Go
res := resource.NewWithAttributes( resource.WithAttributes(attribute.String("service.name", "My service name")), // And other resource attributes )

app_path

Resource attribute keyappsignal.config.app_path
Requiredno
TypeString
Default valueundefined

Description

The location of the app on the host's file system.

The app_path resource attribute helps AppSignal clean up backtraces by stripping away the absolute app path of backtrace lines. This way only paths within the context of the project directory is shown. This makes our Backtrace links feature possible.

Go
import ( "os" // And other imports ) res := resource.NewWithAttributes( resource.WithAttributes(attribute.String("appsignal.config.app_path", os.Getenv("PWD"))), // And other resource attributes )

filter_attributes

Resource attribute keyappsignal.config.filter_attributes
Requiredno
Typelist(String)
Default value[]

Description

The filter_attributes resource attribute allows you to filter out specific attributes from being reported to AppSignal. This can be useful to filter out sensitive or non-relevant information from being reported.

If an attribute is filtered out this way, it will not show up in the interface at all.

Go
res := resource.NewWithAttributes( attribute.StringSlice("appsignal.config.filter_attributes", []string{"my.secret.attribute", "some.opentelemetry.attribute"}), // And other resource attributes )

filter_function_parameters

Resource attribute keyappsignal.config.filter_function_parameters
Requiredno
Typelist(String)
Default value[]

Description

This resource attribute allows you to filter out any function parameters set in the appsignal.function.parameters span attribute.

In the example below, the keys set in the filter_function_parameters config option will be replaced with [FILTERED] before being sent to our servers.

Go
res := resource.NewWithAttributes( attribute.StringSlice("appsignal.config.filter_function_parameters", []string{"password", "cvv"}), // And other resource attributes )

filter_request_payload

Resource attribute keyappsignal.config.filter_request_payload
Requiredno
Typelist(String)
Default value[]

Description

This resource attribute allows you to filter out any request payload data set in the appsignal.request.payload span attribute.

In the example below, the keys set in the filter_request_payload config option will be replaced with [FILTERED] before being sent to our servers.

Read more about request query parameter filtering.

Go
res := resource.NewWithAttributes( attribute.StringSlice("appsignal.config.filter_request_payload", []string{"password", "cvv"}), // And other resource attributes )

filter_request_query_parameters

Resource attribute keyappsignal.config.filter_request_query_parameters
Requiredno
Typelist(String)
Default value[]

Description

This resource attribute allows you to filter out any request query parameters set in the appsignal.request.query_parameters span attribute.

In the example below, the keys set in the filter_request_query_parameters config option will be replaced with [FILTERED] before being sent to our servers.

Read more about request query parameter filtering.

Go
res := resource.NewWithAttributes( attribute.StringSlice("appsignal.config.filter_request_query_parameters", []string{"password", "cvv"}), // And other resource attributes )

filter_request_session_data

Resource attribute keyappsignal.config.filter_request_session_data
Requiredno
Typelist(String)
Default value[]

Description

This resource attribute allows you to filter out any request session data set in the appsignal.request.session_data span attribute.

In the example below, the keys set in the filter_request_session_data config option will be replaced with [FILTERED] before being sent to our servers.

Read more about session data filtering.

Go
res := resource.NewWithAttributes( attribute.StringSlice("appsignal.config.filter_session_data", []string{"password", "cvv"}), // And other resource attributes )

filter_request_session_data

Resource attribute keyappsignal.config.filter_request_session_data
Requiredno
Typelist(String)
Default value[]

Description

The filter_request_session_data resource attribute allows you to filter out any request session data set in the appsignal.request.session_data span attribute.

In the example below, the keys set in the filter_request_session_data config option will be replaced with [FILTERED] before being sent to our servers.

Read more about request session data filtering.

Go
res := resource.NewWithAttributes( attribute.StringSlice("appsignal.config.filter_session_data", []string{"password", "cvv"}), // And other resource attributes )

ignore_actions

Resource attribute keyappsignal.config.ignore_actions
Requiredno
Typelist(String)
Default value[]

Description

With this config option you can specify a list of actions that will be ignored by AppSignal. Everything that happens including exceptions will not be transmitted to AppSignal. This can be useful to ignore health check endpoints or other actions that you don't want to monitor.

Go
res := resource.NewWithAttributes( attribute.StringSlice("appsignal.config.ignore_actions", []string{"GET /heath_check", "POST /ping"}), // And other resource attributes )

ignore_errors

Resource attribute keyappsignal.config.ignore_errors
Requiredno
Typelist(String)
Default value[]

Description

This config option allows you to ignore specific errors from being reported to AppSignal. This can be useful to ignore expected errors or errors that can't be solved.

Read more about ignoring errors.

Go
res := resource.NewWithAttributes( attribute.StringSlice("appsignal.config.ignore_errors", []string{"MyCustomError", "ExpectedError"}), // And other resource attributes )

ignore_namespaces

Resource attribute keyappsignal.config.ignore_namespaces
Requiredno
Typelist(String)
Default value[]

Description

This config option allows you to ignore specific namespaces from being reported to AppSignal. This can be useful to ignore specific parts of your application from being monitored.

Read more about namespaces.

Go
res := resource.NewWithAttributes( attribute.StringSlice("appsignal.config.ignore_namespaces", []string{"admin", "secret"}), // And other resource attributes )

request_headers

Resource attribute keyappsignal.config.request_headers
Requiredno
Typelist(String)
Default value["accept", "accept-charset", "accept-encoding", "accept-language", "cache-control", "connection", "content-length", "host", "range"]

Description

Configure which request headers to include when a request is made to an HTTP server. This option is an allowlist. It only includes the headers that are configured. If the list is empty, no headers are included.

The request headers are read from the http.request.header.<key> OpenTelemetry span attributes, where <key> is the normalized header name (lowercase).

To not set any headers, explicitly set the resource attribute value to an empty array.

Go
res := resource.NewWithAttributes( // Only send these specific headers attribute.StringSlice("appsignal.config.request_headers", []string{"accept", "request_method", "content_length"}), // Do not send any headers attribute.StringSlice("appsignal.config.request_headers", []string{}), )

response_headers

Resource attribute keyappsignal.config.response_headers
Requiredno
Typelist(String)
Default value["accept", "accept-charset", "accept-encoding", "accept-language", "cache-control", "connection", "content-length", "host", "range"]

Description

Configure which response headers to include when a request is made by an HTTP client. This option is an allowlist. It only includes the headers that are configured. If the list is empty, no headers are included.

The response headers are read from the http.response.header.<key> OpenTelemetry span attributes, where <key> is the normalized header name (lowercase).

To not set any headers, explicitly set the resource attribute value to an empty array.

Go
res := resource.NewWithAttributes( // Only send these specific headers attribute.StringSlice("appsignal.config.response_headers", []string{"accept", "request_method", "content_length"}), // Do not send any headers attribute.StringSlice("appsignal.config.response_headers", []string{}), )

send_function_parameters

Resource attribute keyappsignal.config.send_function_parameters
Requiredno
TypeBoolean (true / false)
Default valuetrue

Description

Configure whether to include function parameters in traces. If set to false no such data is sent to our servers.

These values are set with the appsignal.function.parameters span attribute.

Go
res := resource.NewWithAttributes( attribute.Bool("appsignal.config.send_function_parameters", false), // And other resource attributes )

send_request_payload

Resource attribute keyappsignal.config.send_request_payload
Requiredno
TypeBoolean (true / false)
Default valuetrue

Description

Configure whether to send request payload data in traces. If set to false no such data is sent to our servers.

These values are set with the appsignal.request.payload span attribute.

For more information please read about request payload filtering.

Go
res := resource.NewWithAttributes( attribute.Bool("appsignal.config.send_request_payload", false), // And other resource attributes )

send_request_query_parameters

Resource attribute keyappsignal.config.send_request_query_parameters
Requiredno
TypeBoolean (true / false)
Default valuetrue

Description

Configure whether to include request query parameters in traces. If set to false no such data is sent to our servers.

These values are set with the appsignal.request.query_parameters span attribute.

For more information please read about request parameter filtering.

Go
res := resource.NewWithAttributes( attribute.Bool("appsignal.config.send_request_query_parameters", false), // And other resource attributes )

send_request_session_data

Resource attribute keyappsignal.config.send_request_session_data
Requiredno
TypeBoolean (true / false)
Default valuetrue

Description

Configure whether to send request session data in traces. If set to false no such data is sent to our servers.

These values are set with the appsignal.request.session_data span attribute.

For more information please read about request session data filtering.

Go
res := resource.NewWithAttributes( attribute.Bool("appsignal.config.send_session_data", false), // And other resource attributes )