Why Add Additional Instrumentation?
Your application might use libraries that aren’t covered by the instrumentation packages you installed during setup, such as:- Database drivers
- HTTP client libraries
- Message queue systems
- Custom or niche libraries
General Steps
This section describes the steps that are needed for most languages to instrument additional library. Check the Language-Specific Instructions section for language specific steps.1. Identify Libraries to Instrument
First, determine which libraries your application uses that you’d like to monitor. Common candidates include:- Database clients (MySQL, PostgreSQL, MongoDB, Redis)
- HTTP clients
- Message queues (RabbitMQ, Kafka, SQS)
- Template engines
2. Find Instrumentation Packages
Look for instrumentation packages in this order of preference:- Official OpenTelemetry packages - Maintained by the OpenTelemetry community
- OpenTelemetry contrib packages - Community-contributed instrumentation
- Third-party packages - Ensure you trust the maintainer and review the code
3. Install the Package
Once you’ve found a relevant instrumentation package, install the instrumentation package using your language’s package manager. For example:4. Initialize the Instrumentation
Depending on the language and SDK instrumentation method, instrumentation packages may require initialization in your application’s startup code. This typically involves:- Importing the instrumentation package
- Calling an initialization function
- Configuring any package-specific options
5. Check Incoming Data
After installation, verify that the instrumentation is working:- Check that new spans about the instrumented library appear in your traces reported to AppSignal.com.
- Confirm metrics about the instrumented library are being reported to AppSignal.com.
- Test error scenarios to ensure errors are reported.
Language-Specific Instructions
For detailed instructions on adding instrumentation packages for specific languages:Troubleshooting
Common Issues
- Missing traces: Ensure the instrumentation is initialized before the library is used.
- Incomplete data: Check if the instrumentation package supports your library version.
- Duplicate spans: Avoid instrumenting the same library multiple times.
Getting Help
If you encounter issues:- Check the instrumentation package documentation
- Contact AppSignal support for assistance