Your C application requires two configuration values:
All other configuration values are optional, and typically the default settings do not 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.
Here are examples of some available configuration options you can change, as defined in the C SDK's public header,
C SDK configuration options
General configuration settings
To set or change the app name, set the license key, 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:
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:
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.
To change the application's alias or Apdex T threshold in the UI go to one.newrelic.com > APM > (select an app) > Settings > Application.
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
configwith a call to
newrelic_create_app_config()using the new application name.
- Make a new connected app with a call to
Timing is everything. Switching application names during a single application execution may mean that your instrumented data is sent under the new application name.
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 in New Relic One.
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's data security and licenses documentation.