OpenTelemetry Beta
The OpenTelemetry beta involves more installation steps than usual. Please ensure you follow all the steps carefully to set it up correctly.
Create a new application
To report data to AppSignal the following three config options are required:
- Application name: the name of the application as it appears on AppSignal.com.
- Application environment: the environment of the application as it appears on AppSignal.com.
- Push API key: The key used to authenticate with the AppSignal Push API.
- Get your organization-level Push API key from the API keys settings page.
Before proceeding to the next steps, ensure you have the above required option values to hand.
If you already have an application that uses the same name and environment, reported by one of our existing language integration packages, please use another name and/or environment. This beta introduces new UI elements and pages that are not compatible with the data reported by our integration packages. We recommend reporting the application OpenTelemetry data to a new AppSignal application so the UI will not be so confusing.
Install the AppSignal agent
To report data to AppSignal, we need to install the AppSignal standalone agent. Either the standalone Linux package or Docker image will work.
When configuring the standalone agent, use the configuration options you wrote down before.
If multiple applications report to the same AppSignal standalone agent, such as in a Kubernetes cluster, configure each application with a unique name and environment. This ensures that data remains separate and does not get mixed between applications.
Install the OpenTelemetry packages
To install the OpenTelemetry packages in your app follow the OpenTelemetry installation instructions for the language your app uses.
Below are links to OpenTelemetry getting started guides for some popular languages:
- Ruby, the "Instrumentation" section.
- Elixir, the "Dependencies" section.
- Node.js, the "Instrumentation" section.
- Python, the "Setup" section.
- Go, the "Add OpenTelemetry Instrumentation" section.
- Rust, the "Instrumentation" section.
- PHP, the "Add zero-code instrumentation" or "Add manual instrumentation" section.
- Java, the "Instrumentation" section.
Also follow any additional steps needed to have OpenTelemetry instrument your application, instrument specific libraries, and setting up a tracer and creating spans where needed.
Below are examples for a couple languages:
Configure OpenTelemetry in your app
Configure OpenTelemetry in your application with the application details you wrote down before: application name, environment and Push API key. We will also configure the service name in OpenTelemetry and set up an HTTP exporter that exports OpenTelemetry tracing data to the AppSignal standalone agent.
This configuration is different than the configuration used by the standalone agent and is not optional. It will fall back on the standalone agent's configuration if no configuration is specified as documented in this step.
Configure the OpenTelemetry Resource with the SDK with the following required attributes:
appsignal.config.app_name
: The application's name.appsignal.config.app_environment
: The application's environment.appsignal.config.push_api_key
: The application's Push API key.service.name
: The service's name as it should show up on AppSignal.com. See the Customize the service name in OpenTelemetry section for more details.
Additionally, configure the following config options to get a better experience:
appsignal.config.revision
: Automatically create deploys in AppSignal by specifying the app revision.appsignal.config.language_integration
: Set the programming language name to help us recognize what programming language the app data is from so we can optimize the tracing data. Example values: "python", "rust", "ruby", "elixir", "go", "node.js", etc.appsignal.config.app_path
: Specify the app's root directory. We'll use this to clean up backtraces and recognize which lines are from the application and which are from other libraries.
See also our configuration options page for a list of all supported config options.
Customize the service name in OpenTelemetry
Choose a service name for your app that makes each component or service easily recognizable. This service name will be used to group namespaces by service.
The resulting namespaces are formatted like so: <service name>/<namespace>
If the service name is "My service name" and the namespace is "admin", the resulting namespace on AppSignal.com becomes: "My service namespace/admin"
The important part of naming is that it makes sense to you and your team.
Some examples of service names:
- Rails server
- Sidekiq worker
- Authentication API
- Loadbalancer
- Or whatever internal name each service has in your infrastructure
Below is an example of how to configure it in Ruby. See the previous steps code example for the language your app is using on where to modify the service_name
field or service.name
attribute.
Customize the exporter
When OpenTelemetry is instrumenting your application, it's necessary to export the data to our standalone agent so that it can then be sent to our API.
In the code examples shown earlier, an OpenTelemetry HTTP traces exporter is already configured to send data to this endpoint on the standalone agent: http://localhost:8099/enriched/v1/traces
Port 8099
is different than OpenTelemetry's default port, so it's required to specify to export data to our standalone agent.
We recommend using the standalone agent's default 8099
port, but if this is not possible, the port can be changed with the opentelemetry_port
config option. Ensure that you also update the ports definition in the Install the AppSignal agent step for the Docker command if you've chosen to install the standalone agent using the Docker image.
Most OpenTelemetry exporter packages automatically append the /v1/traces
part if you specify /enriched
as the path, but for some languages (like Python and Node.js) it may be needed to specify the entire path: http://localhost:8099/enriched/v1/traces
If your app is using the standalone agent's Docker container, change localhost
to the container's (host) name to send the data to the correct host on the internal network, like http://appsignal-agent:8099/enriched/v1/traces
Test the app!
Now that all the components are connected, start your app and test if you see data arrive in AppSignal. Check the "Errors > Issue list" and "Performance > Traces" page specifically.
If after following our installation instructions you still don't see data in AppSignal, let us know and we'll help you finalize your OpenTelemetry installation!