EOL NOTICE
From April 2022, we don't support the C SDK capability. For more details, see our Support Forum post.
Your C application requires two configuration values:
- Application's name:
app_name
- New Relic :
license_key
All other configuration values are optional, and typically the default settings don't need to be changed. However, when necessary, you can adjust New Relic's C SDK configuration.
This document is a quick reference for using some basic configuration options with the C SDK API. For detailed information about changing your configuration settings, including code values and examples, see the C SDK's configuration GUIDE.md on GitHub.
Change configuration settings
Here are examples of some available configuration options you can change, as defined in the C SDK's public header, libnewrelic.h
.
C SDK configuration options | Comments |
---|---|
General configuration settings | To set or change the app name, set the , logging level, transaction tracing, datastore tracing, etc., use:
|
Additional transaction tracing configuration | To enable the transaction tracer and to configure what transaction durations are considered for reporting a trace to New Relic, use:
|
Datastore segments | To configure whether a database name and datastore instance name are reported, use: |
Communication with the C SDK | To set the socket endpoint for agent-to-daemon communications, use:
|
Change app name (alias) in UI
You can change your application's alias from the Application settings page in the New Relic UI. This is useful, for example, to give your application a different name, yet keep historic data under the new alias. For more information, see Name your application.
New Relic's C SDK does not support server-side configuration. However, you can also use this Application settings page in the UI to set your application's Apdex T threshold.
To change the application's alias or Apdex T threshold in the UI go to one.newrelic.com > All capabilities > APM & services > (select an app) > Settings > Application.
Change app name in configuration
If you change your application's name in your configuration settings, this will result in the same app appearing in the UI with a new name. Any historic data (based on the data retention schedule) will only exist under the old name. (To rename your application but still keep historic data, use the UI settings to change the alias.)
If you need to change your application's name in your configuration after your application is connected to the daemon:
- Make a new
config
with a call tonewrelic_create_app_config()
using the new application name. - Make a new connected app with a call to
newrelic_create_app()
.
Caution
Timing is everything. Switching application names during a single application execution may mean that your instrumented data is sent under the new application name.
View logs for your APM and infrastructure data
You can also bring your logs and application's data together to make troubleshooting easier and faster. With logs in context, you can see log messages related to your errors and traces directly in your app's UI. You can also see logs in context of your infrastructure data, such as Kubernetes clusters. No need to switch to another UI page.