OpenTelemetry config options
AppSignal can be configured through OpenTelemetry resource attributes. On this page we'll describe how to configure resource attributes and which attributes can be set.
Configuring OpenTelemetry resource attributes
You can configure OpenTelemetry to send data to AppSignal using resource attributes.
Resource attributes are attributes that apply to every trace reported from the application using OpenTelemetry.
You can configure resource attributes in your OpenTelemetry configuration file, this is also where you need to set up the OpenTelemetry exporter to send data to the AppSignal collector.
import ( // Other imports .... "go.opentelemetry.io/otel/sdk/resource" semconv "go.opentelemetry.io/otel/semconv/v1.27.0" sdktrace "go.opentelemetry.io/otel/sdk/trace" ) res := resource.NewSchemaless( // Add resource attributes here semconv.ServiceNameKey.String("My service name"), resource.WithAttributes(attribute.String("appsignal.config.name", "My app name")), ) tp := sdktrace.NewTracerProvider( // Other .With... calls sdktrace.WithResource(res), )
App name
- Attribute name:
appsignal.config.name
- Type: String
- Required: Yes
Name of your application as it should be displayed on AppSignal.com.
attributes = { # Add this line to the resource attributes "appsignal.config.name": "My awesome app", } resource = Resource(attributes=attributes)
import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.name", "My awesome app")), )
App environment
- Attribute name:
appsignal.config.environment
- Type: String
- Required: Yes
The environment of the application as it should be displayed on AppSignal.com.
attributes = { # Add this line to the resource attributes "appsignal.config.environment": "staging", } resource = Resource(attributes=attributes)
import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.environment", "production")), )
Push API key
- Attribute name:
appsignal.config.push_api_key
- Type: String
- Required: Yes
The organization-level authentication key to authenticate with our Push API.
For detailed information about the AppSignal Push API key, check out our terminology documentation.
attributes = { # Add this line to the resource attributes "appsignal.config.push_api_key": "00000000-0000-0000-0000-000000000000", } resource = Resource(attributes=attributes)
import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.push_api_key", "00000000-0000-0000-0000-000000000000")), )
App revision
- Attribute name:
appsignal.config.revision
- Type: String
- Required: Yes
To report new deploys of OpenTelemetry applications, you can use Deploy Markers.
Deploy markers can be configured with the revision resource attribute. The value of this attribute will be used to identify new deploys. It needs to be unique per deploy to pick up new deploys. We recommend using Git commit SHAs or a tag in your SCM. This can be used in combination with our backtrace links to directly link from AppSignal back to the source code on platforms like GitHub and GitLab.
import subprocess attributes = { # ... } try: revision = subprocess.check_output("git rev-parse --short HEAD", shell=True, text=True).strip() attributes["appsignal.config.revision"] = revision except subprocess.CalledProcessError: pass resource = Resource(attributes=attributes)
import ( "os/exec" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) 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( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.revision", revision)), )
Language integration
- Attribute name:
appsignal.config.language_integration
- Type: String
- Required: Yes
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".
attributes = { # Add this line to the resource attributes "appsignal.config.language_integration": "python", } resource = Resource(attributes=attributes)
import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.language_integration", "golang")), )
OTP app name
- Attribute name:
appsignal.config.otp_app
- Type: String
- Required: Yes, for Elixir apps
AppSignal uses the appsignal.config.otp_app
resource attribute to detect which backtrace lines from errors belong to the application.
You can find the OTP app name for your application by calling IO.inspect(:application.get_application())
in your application and checking the output.
config :opentelemetry, resource: [ {"appsignal.config.otp_app", "OTP app name"}, # And other resource attributes ]
Service name
- Attribute name:
service.name
- Type: String
- Required: Yes
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.
import socket attributes = { # Add this line to the resource attributes "service.name": "My service name", } resource = Resource(attributes=attributes)
import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("service.name", "My service name")), )
Hostname
- Attribute name:
host.name
- Type: String
- Required: Yes
The host.name
resource attribute helps AppSignal recognize different hosts for traces and tag the traces automatically with the hostname.
import socket attributes = { # Add this line to the resource attributes "host.name": socket.gethostname(), } resource = Resource(attributes=attributes)
import ( "os" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) hostname, err := os.Hostname() if err != nil { hostname = "unknown" } res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("host.name", hostname)), )
App path
- Attribute name:
appsignal.config.app_path
- Type: String
- Required: No
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.
import os attributes = { # Add this line to the resource attributes "appsignal.config.app_path": os.getcwd() } resource = Resource(attributes=attributes)
import ( "os" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.app_path", os.Getenv("PWD"))), )
Filter attributes
- Attribute name:
appsignal.config.filter_attributes
- Type: Array
- Required: No
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.
attributes = { # Add this line to the resource attributes "appsignal.config.filter_attributes": ["my.secret.attribute", "some.opentelemetry.attribute"], } resource = Resource(attributes=attributes)
import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes attribute.StringSlice("appsignal.config.filter_attributes", []string{"my.secret.attribute", "some.opentelemetry.attribute"}), )
Filter function parameters
- Attribute name:
appsignal.config.filter_function_parameters
- Type: Array
- Default value: Empty
- Required: No
The filter_function_parameters
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.
# Configure the exporter's resource like so: attributes = { # Add this line to the resource attributes "appsignal.config.filter_function_parameters": ["password", "cvv"], } resource = Resource(attributes=attributes) # Rest of the exporter config... # Then in the trace, set the function parameters span attribute import json from opentelemetry import trace tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("something.custom") as span: span.set_attribute("appsignal.function.parameters", json.dumps({ "password": "super secret", "test_param": "test value", "nested": { "password": "super secret nested", "test_param": "test value", } }))
// Configure the exporter's resource like so: import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes attribute.StringSlice("appsignal.config.filter_function_parameters", []string{"password", "cvv"}), ) // Rest of the exporter config... // Then in the trace, set the function parameters span attribute import ( "encoding/json" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" ) // The context needs contain the active span you plan to extract // Like `c.Request.Context()` for gin apps ctx := context.TODO() span := trace.SpanFromContext(ctx) params := map[string]interface{}{ "password": "super secret", "test_param": "test value", "nested": map[string]interface{}{ "password": "super secret", "test_param": "test value", }, } json, _ := json.Marshal(params) span.SetAttributes(attribute.String("appsignal.function.parameters", string(json)))
Filter request query parameters
- Attribute name:
appsignal.config.filter_request_query_parameters
- Type: Array
- Default value: Empty
- Required: No
The filter_request_query_parameters
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.
# Configure the exporter's resource like so: attributes = { # Add this line to the resource attributes "appsignal.config.filter_request_query_parameters": ["password", "cvv"], } resource = Resource(attributes=attributes) # Rest of the exporter config... # Then in the trace, set the query parameters span attribute import json from opentelemetry import trace tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("something.custom") as span: span.set_attribute("appsignal.request.query_parameters", json.dumps({ "password": "super secret", "test_param": "test value" }))
// Configure the exporter's resource like so: import ( "encoding/json" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes attribute.StringSlice("appsignal.config.filter_request_query_parameters", []string{"password", "cvv"}), ) // Rest of the exporter config... // Then in the trace, set the query parameters span attribute import ( "encoding/json" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" ) // The context needs contain the active span you plan to extract // Like `c.Request.Context()` for gin apps ctx := context.TODO() span := trace.SpanFromContext(ctx) params := map[string]interface{}{ "password": "super secret", "test_param": "test value", "nested": map[string]interface{}{ "password": "super secret", "test_param": "test value", }, } json, _ := json.Marshal(params) span.SetAttributes(attribute.String("appsignal.request.query_parameters", string(json)))
Filter request payload
- Attribute name:
appsignal.config.filter_request_payload
- Type: Array
- Default value: Empty
- Required: No
The filter_request_payload
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.
# Configure the exporter's resource like so: attributes = { # Add this line to the resource attributes "appsignal.config.filter_request_payload": ["password", "cvv"], } resource = Resource(attributes=attributes) # Rest of the exporter config... # Then in the trace, set the request payload span attribute import json from opentelemetry import trace tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("something.custom") as span: span.set_attribute("appsignal.request.payload", json.dumps({ "password": "super secret", "test_param": "test value", "nested": { "password": "super secret nested", "test_param": "test value", } }))
// Configure the exporter's resource like so: import ( "encoding/json" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes attribute.StringSlice("appsignal.config.filter_request_payload", []string{"password", "cvv"}), ) // Rest of the exporter config... // Then in the trace, set the function parameters span attribute import ( "encoding/json" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" ) // The context needs contain the active span you plan to extract // Like `c.Request.Context()` for gin apps ctx := context.TODO() span := trace.SpanFromContext(ctx) params := map[string]interface{}{ "password": "super secret", "test_param": "test value", "nested": map[string]interface{}{ "password": "super secret", "test_param": "test value", }, } json, _ := json.Marshal(params) span.SetAttributes(attribute.String("appsignal.request.payload", string(json)))
Filter request session data
- Attribute name:
appsignal.config.filter_request_session_data
- Type: Array
- Default value: Empty
- Required: No
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.
# Configure the exporter's resource like so: attributes = { # Add this line to the resource attributes "appsignal.config.filter_request_session_data": ["password", "cvv"], } resource = Resource(attributes=attributes) # Rest of the exporter config... # Then in the trace, set the session data span attribute import json from opentelemetry import trace tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("something.custom") as span: span.set_attribute("appsignal.request.session_data", json.dumps({ "password": "super secret", "test_param": "test value", "nested": { "password": "super secret nested", "test_param": "test value", } }))
// Configure the exporter's resource like so: import ( "encoding/json" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes attribute.StringSlice("appsignal.config.filter_session_data", []string{"password", "cvv"}), ) // Rest of the exporter config... // Then in the trace, set the session data parameters span attribute import ( "encoding/json" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" ) // The context needs contain the active span you plan to extract // Like `c.Request.Context()` for gin apps ctx := context.TODO() span := trace.SpanFromContext(ctx) sessionData := map[string]interface{}{ "password": "super secret", "test_param": "test value", "nested": map[string]interface{}{ "password": "super secret", "test_param": "test value", }, } json, _ := json.Marshal(sessionData) span.SetAttributes(attribute.String("appsignal.request.session_data", string(json)))
Ignore actions
- Attribute name:
appsignal.config.ignore_actions
- Type: Array of Strings
- Required: No
The ignore_actions
resource attribute allows you to ignore specific actions from being reported to AppSignal. This can be useful to ignore health check endpoints or other actions that you don't want to monitor.
attributes = { # Add this line to the resource attributes "appsignal.config.ignore_actions": ["GET /health_check", "POST /ping"], } resource = Resource(attributes=attributes)
import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes attribute.StringSlice("appsignal.config.ignore_actions", []string{"GET /heath_check", "POST /ping"}), )
Ignore errors
- Attribute name:
appsignal.config.ignore_errors
- Type: Array of Strings
- Required: No
The ignore_errors
resource attribute 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.
attributes = { # Add this line to the resource attributes "appsignal.config.ignore_errors": ["MyCustomError", "ExpectedError"], } resource = Resource(attributes=attributes)
import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes attribute.StringSlice("appsignal.config.ignore_errors", []string{"MyCustomError", "ExpectedError"}), )
Ignore namespaces
- Attribute name:
appsignal.config.ignore_namespaces
- Type: Array of Strings
- Required: No
The ignore_namespaces
resource attribute 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.
attributes = { # Add this line to the resource attributes "appsignal.config.ignore_namespaces": ["admin" ,"secret"], } resource = Resource(attributes=attributes)
import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" ) res := resource.NewWithAttributes( // Other resource attributes attribute.StringSlice("appsignal.config.ignore_namespaces", []string{"admin", "secret"}), )
Response headers
- Attribute name:
appsignal.config.response_headers
- Type: Array of Strings
- Default value:
["content-length", "accept", "accept-charset", "accept-encoding", "accept-language", "cache-control", "connection", "range", "host"]
- Required: No
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.
attributes = { # Only send these specific headers "appsignal.config.response_headers": ["accept", "request_method", "content_length"] # Do not send any headers "appsignal.config.response_headers": [] } resource = Resource(attributes=attributes)
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{}), )
Request headers
- Attribute name:
appsignal.config.request_headers
- Type: Array of Strings
- Default value:
["content-length", "accept", "accept-charset", "accept-encoding", "accept-language", "cache-control", "connection", "range", "host"]
- Required: No
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.
attributes = { # Only send these specific headers "appsignal.config.request_headers": ["accept", "request_method", "content_length"] # Do not send any headers "appsignal.config.response_headers": [] } resource = Resource(attributes=attributes)
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{}), )
Send function parameters
- Attribute name:
appsignal.config.send_function_parameters
- Type: Boolean
- Default value:
true
- Required: No
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.
attributes = { # Add this line to the resource attributes "appsignal.config.send_function_parameters": false } resource = Resource(attributes=attributes)
res := resource.NewWithAttributes( // Add this line to the resource attributes attribute.Bool("appsignal.config.send_function_parameters", false), )
Send request query parameter
- Attribute name:
appsignal.config.send_request_query_parameters
- Type: Boolean
- Default value:
true
- Required: No
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.
attributes = { # Add this line to the resource attributes "appsignal.config.send_request_query_parameters": false } resource = Resource(attributes=attributes)
res := resource.NewWithAttributes( // Add this line to the resource attributes attribute.Bool("appsignal.config.send_request_query_parameters", false), )
Send request payload
- Attribute name:
appsignal.config.send_request_payload
- Type: Boolean
- Default value:
true
- Required: No
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.
attributes = { # Add this line to the resource attributes "appsignal.config.send_request_payload": false } resource = Resource(attributes=attributes)
res := resource.NewWithAttributes( // Add this line to the resource attributes attribute.Bool("appsignal.config.send_request_payload", false), )
Send request session data
- Attribute name:
appsignal.config.send_request_session_data
- Type: Boolean
- Default value:
true
- Required: No
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.
attributes = { # Add this line to the resource attributes "appsignal.config.send_request_session_data": false } resource = Resource(attributes=attributes)
res := resource.NewWithAttributes( // Add this line to the resource attributes attribute.Bool("appsignal.config.send_session_data", false), )