OpenTelemetry config options

This documentation outlines the partial OpenTelemetry support for our Go integration. If you're looking to send metrics to AppSignal directly via an OpenTelemetry package rather than an AppSignal integration please visit our OpenTelemetry beta documentation.

OpenTelemetry can be configured to configure AppSignal using 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 standalone agent.

To add a resource a resource, add it to your tracer provider like so:

Go
import ( // Other imports .... "go.opentelemetry.io/otel/sdk/resource" semconv "go.opentelemetry.io/otel/semconv/v1.27.0" ) res := resource.NewWithAttributes( // Add resource attributes here semconv.SchemaURL, semconv.ServiceNameKey.String("My service name"), resource.WithAttributes(attribute.String("appsignal.config.app_name", "My app name")), ) tp := sdktrace.NewTracerProvider( // Other .With... calls sdktrace.WithResource(res), )

App revision

  • Attribute name: appsignal.config.revision
  • Type: String
  • Required: No

To report new deploys of OpenTelemetry applications, we 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.

Go
import ( "context" "fmt" "os/exec" ) cmd := exec.Command("git", "rev-parse", "--short", "HEAD") output, err := cmd.Output() if err != nil { fmt.Println("Error running git command:", err) return } // Convert output to a string and trim any extra whitespace. revision := string(output) revision = revision[:len(revision)-1] // Remove newline character res := resource.NewWithAttributes( 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. No backtraces will be displayed if language_integration is not defined.

Go
res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.language_integration", "go")), )

App path

  • Attribute name: appsignal.config.app_path
  • Type: String
  • Required: No

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 ( "fmt" "os" ) path, err := os.Getwd() if err != nil { fmt.Println("Error:", err) return } res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.app_path", path)), )

Ignore namespaces

  • Attribute name: appsignal.config.ignore_namespaces
  • Type: List of strings (as a comma-separated string)
  • Required: No
  • Standalone agent version required: 0.0.26

The ignore_namespaces config option tells our agent to ignore all data from one or more namespaces.

Go
res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.ignore_namespaces", "admin,secret")), )

Ignore actions

  • Attribute name: appsignal.config.ignore_actions
  • Type: List of strings (as a comma-separated string)
  • Required: No
  • Standalone agent version required: 0.0.26

The ignore_actions config option tells our agent to ignore all data from one or more actions.

Go
res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.ignore_actions", "GET /up,GET /health")), )

Ignore errors

  • Attribute name: appsignal.config.ignore_errors
  • Type: List of strings (as a comma-separated string)
  • Required: No
  • Standalone agent version required: 0.0.26

The ignore_errors config option tells our agent to ignore errors with a matching name. The span will be reported, but the error will be ignored, as if no error occurred.

Go
res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.ignore_errors", "TypeError,NameError")), )

Send parameters

  • Attribute name: appsignal.config.send_parameters
  • Type: Boolean (as a string)
  • Required: No (Default: "true")
  • Standalone agent version required: 0.0.26

The send_parameters config option tells our agent whether or not to include parameters on the trace. If set to false parameters are not included.

Go
res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.send_parameters", "false")), )

Send session data

  • Attribute name: appsignal.config.send_session_data
  • Type: Boolean (as a string)
  • Required: No (Default: "true")
  • Standalone agent version required: 0.0.26

The send_session_data config option tells our agent whether or not to include session data on the trace. If set to false session data is not included.

Go
res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.send_session_data", "false")), )

Filter parameters

  • Attribute name: appsignal.config.filter_parameters
  • Type: List of strings (as a comma-separated string)
  • Required: No
  • Standalone agent version required: 0.0.26

The filter_parameters config option tells our agent which parameter keys to filter out, like password and secret. They will be reported with the [FILTERED] value.

Go
res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.filter_parameters", "password,secret")), )

Filter session data

  • Attribute name: appsignal.config.filter_session_data
  • Type: List of strings (as a comma-separated string)
  • Required: No
  • Standalone agent version required: 0.0.26

The filter_session_data config option tells our agent which parameter keys to filter out, like secret1 and secret2. They will be reported with the [FILTERED] value.

Go
res := resource.NewWithAttributes( // Other resource attributes resource.WithAttributes(attribute.String("appsignal.config.filter_session_data", "secret1,secret2")), )