OpenTelemetry config options

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 standalone agent.

App name

  • Attribute name: appsignal.config.app_name
  • Type: String
  • Required: Yes

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

Python
attributes = { # Add this line to the resource attributes "appsignal.config.app_name": "My awesome app", } resource = Resource(attributes=attributes)

App environment

  • Attribute name: appsignal.config.app_environment
  • Type: String
  • Required: Yes

The environment of the application as it should be displayed on AppSignal.com.

Python
attributes = { # Add this line to the resource attributes "appsignal.config.app_environment": "staging", } resource = Resource(attributes=attributes)

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.

Python
attributes = { # Add this line to the resource attributes "appsignal.config.push_api_key": "00000000-0000-0000-0000-000000000000", } resource = Resource(attributes=attributes)

App revision

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

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.

Python
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)

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", "go" and "nodejs".

Python
attributes = { # Add this line to the resource attributes "appsignal.config.language_integration": "python", } resource = Resource(attributes=attributes)

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.

Python
import os attributes = { # Add this line to the resource attributes "appsignal.config.app_path": os.path.dirname(__file__), } resource = Resource(attributes=attributes)

Hostname

  • Attribute name: host.name
  • Type: String
  • Required: No

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

Python
import socket attributes = { # Add this line to the resource attributes "host.name": socket.gethostname(), } resource = Resource(attributes=attributes)

Service name

  • Attribute name: service.name
  • Type: String
  • Required: No

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.

Python
import socket attributes = { # Add this line to the resource attributes "service.name": "My service name", } resource = Resource(attributes=attributes)