C SDK configuration

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.

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 license key, logging level, transaction tracing, datastore tracing, etc., use:

newrelic_app_config_t

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:

newrelic_transaction_tracer_config_t

Datastore segments

To configure whether a database name and datastore instance name are reported, use:

newrelic_datastore_segment_config_t

Communication with the C SDK

To configure how the C SDK daemon and your instrumented application communicate, specify your preferred socket communication:

newrelic_process_config_t

Change app name (alias) in UI

Owner, Admins, or Add-on Managers

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:

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:

  1. Make a new config with a call to newrelic_create_app_config() using the new application name.
  2. Make a new connected app with a call to newrelic_create_app().

Timing is everything. Switching application names during a single application execution may mean that your instrumented data is sent under the new application name.

For more help

Recommendations for learning more: