### New Relic Guided Install Commands for Integrations Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/host-integrations/installation/new-relic-guided-install-overview Commands to install various New Relic integrations using the `newrelic install` CLI tool. Each command corresponds to a specific application or service, enabling monitoring setup. ```bash newrelic install -n apache-open-source-integration newrelic install -n cassandra-open-source-integration newrelic install -n couchbase-open-source-integration newrelic install -n dotnet-agent-installer newrelic install -n elasticsearch-open-source-integration newrelic install -n haproxy-open-source-integration newrelic install -n hashicorp-consul-open-source-integration newrelic install -n infrastructure-agent-installer newrelic install -n java-agent-installer newrelic install -n memcached-open-source-integration newrelic install -n mssql-server-integration-installer newrelic install -n mongodb-open-source-integration newrelic install -n mysql-open-source-integration newrelic install -n nagios-open-source-integration newrelic install -n nginx-open-source-integration newrelic install -n node-agent-installer newrelic install -n php-agent-installer newrelic install -n postgres-open-source-integration newrelic install -n rabbitmq-open-source-integration newrelic install -n redis-open-source-integration newrelic install -n varnish-cache-open-source-integration ``` -------------------------------- ### Basic New Relic Varnish Integration Configuration Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/host-integrations/host-integrations-list/varnish-cache-monitoring-integration This example shows a fundamental `varnish-config.yml` setup for the New Relic Varnish integration. It includes essential parameters like `INSTANCE_NAME`, `PARAMS_CONFIG_FILE`, and defines labels for environment and role, enabling both metrics and inventory collection. ```yaml integrations: - name: nri-varnish env: INSTANCE_NAME: new_relic PARAMS_CONFIG_FILE: /etc/default/varnish/varnish.params interval: 15s labels: env: production role: varnish inventory_source: config/varnish ``` -------------------------------- ### Example Output for Azure CLI Account Show Command Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/microsoft-azure-integrations/getting-started/activate-azure-integrations This JSON snippet demonstrates the expected response structure from the `az account show` command, highlighting where to locate the subscription `id` and `tenantId` for New Relic setup. ```json { "environmentName": "AzureCloud", "id": "9ffe9512-f4a2-42dd-1230-518aec34be21", "isDefault": true, "name": "Beyond Team Sandbox", "state": "Enabled", "tenantId": "ac6692da-1231-422f-22a8-9eed6dbe83f1", "user": { "name": "youremail@domain", "type": "user" } } ``` -------------------------------- ### Clone New Relic Terraform Example Repository Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure-as-code/terraform/terraform-modules Clones the accompanying example code from GitHub, providing a pre-configured starting point for following the guide's examples and understanding the project structure. ```bash git clone https://github.com/jsbnr/nr-terraform-intro-example.git ``` -------------------------------- ### Start New Relic C SDK Daemon Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/c-sdk/install-configure/install-c-sdk-compile-link-your-code Demonstrates how to start the New Relic C SDK daemon from the command line. The example shows running the daemon in the foreground (`-f`), specifying a log file (`-logfile`), and setting the log level to debug (`-loglevel debug`). ```Bash $ ./newrelic-daemon -f -logfile newrelic-daemon.log -loglevel debug ``` -------------------------------- ### Start New Relic C SDK Daemon Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/apm/agents/c-sdk/install-configure/install-c-sdk-compile-link-your-code Command to start the New Relic C SDK daemon. This example runs the daemon in the foreground (`-f`), specifies a log file (`-logfile`), and sets the log level to debug (`-loglevel debug`) for detailed output. ```Bash ./newrelic-daemon -f -logfile newrelic-daemon.log -loglevel debug ``` -------------------------------- ### Install New Relic CLI on Linux Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-solutions/tutorials/new-relic-cli Installs the New Relic CLI on Linux systems using Snapcraft. This command requires `sudo` privileges to execute successfully. ```bash sudo snap install newrelic-cli ``` -------------------------------- ### Initialize Terraform Working Directory Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/more-integrations/terraform/terraform-intro Executes the `terraform init` command. This command downloads and installs the declared New Relic provider, sets up the backend, and prepares the working directory for subsequent Terraform operations like `plan` and `apply`. ```bash terraform init ``` -------------------------------- ### New Relic Infrastructure Agent MSI Installation with License Key and Proxy Example Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/infrastructure-agent/windows-installation/windows-msi-installer An example `msiexec.exe` command demonstrating how to install the New Relic Infrastructure Agent, generate a configuration file, set the license key, configure a proxy, and add a custom attribute during installation. ```bash msiexec.exe /qn /i PATH\TO\newrelic-infra.msi GENERATE_CONFIG=true LICENSE_KEY=YOUR_LICENSE_KEY PROXY=http://YOUR_PROXY_SERVER:PROXY_PORT CUSTOM_ATTRIBUTES="{'ATTRIBUTE_1':'VALUE_1'}" ``` -------------------------------- ### Full PostgreSQL Integration Configuration Example Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/host-integrations/host-integrations-list/postgresql/postgresql-integration A comprehensive example of the `integrations` block within `postgresql-config.yml`. This snippet demonstrates how to configure the `nri-postgresql` integration, including environment variables for database connection, a detailed `COLLECTION_LIST`, timeout settings, and labels for metric categorization. ```YAML integrations: - name: nri-postgresql env: USERNAME: postgres PASSWORD: pass HOSTNAME: psql-sample.localnet PORT: 6432 DATABASE: postgres COLLECT_DB_LOCK_METRICS: false COLLECTION_LIST: '{"postgres":{"public":{"pg_table1":["pg_index1","pg_index2"],"pg_table2":[]}}}' TIMEOUT: 10 interval: 15s labels: env: production role: postgresql inventory_source: config/postgresql ``` -------------------------------- ### Download New Relic ECS Task Definition Example (Fargate) Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/integrations/elastic-container-service-integration/installation/install-ecs-integration Download the latest New Relic infrastructure agent task definition example, including a sidecar container, for AWS Fargate launch type. ```bash curl -O https://download.newrelic.com/infrastructure_agent/integrations/ecs/newrelic-infra-ecs-fargate-example-latest.json ``` -------------------------------- ### Start Node.js Application with New Relic Agent Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/nodejs-agent/installation-configuration/install-nodejs-agent Examples demonstrating how to load the New Relic agent during application startup using the Node.js `-r` (require) flag or `NODE_OPTIONS` environment variable. This ensures the agent initializes before your application code. ```bash node -r newrelic ./dist/server.js ``` ```dockerfile CMD ["node", "-r", "newrelic", "server.js"] ``` ```dockerfile CMD ["NODE_OPTIONS='-r newrelic'", "next", "start"] ``` ```bash nest start --exec 'node -r newrelic' ``` -------------------------------- ### Example Scripted Installation with License Key and Proxy Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/install-configure-manage-infrastructure/windows-installation/install-infrastructure-windows-server-using-msi-installer A comprehensive command example for a scripted installation of the New Relic Infrastructure Agent on 64-bit Windows. It demonstrates how to include the license key, configure a proxy server, and add a custom attribute directly during the MSI installation process. ```bash msiexec.exe /qn /i PATH\TO\newrelic-infra.msi GENERATE_CONFIG=true LICENSE_KEY=YOUR_LICENSE_KEY PROXY=http://YOUR_PROXY_SERVER:PROXY_PORT CUSTOM_ATTRIBUTES="{'ATTRIBUTE_1':'VALUE_1'}" ``` -------------------------------- ### New Relic Guided Install Commands for Integrations Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-one/use-new-relic-one/cross-product-functions/install-configure/new-relic-guided-install-overview This section lists the `newrelic install` CLI commands for various New Relic agents and on-host integrations. It helps users quickly identify the correct command to deploy a specific integration via the guided installer. ```APIDOC newrelic install -n apache-open-source-integration newrelic install -n cassandra-open-source-integration newrelic install -n couchbase-open-source-integration newrelic install -n dotnet-agent-installer newrelic install -n elasticsearch-open-source-integration newrelic install -n haproxy-open-source-integration newrelic install -n hashicorp-consul-open-source-integration newrelic install -n infrastructure-agent-installer newrelic install -n java-agent-installer newrelic install -n memcached-open-source-integration newrelic install -n mssql-server-integration-installer newrelic install -n mongodb-open-source-integration newrelic install -n mysql-open-source-integration newrelic install -n nagios-open-source-integration newrelic install -n nginx-open-source-integration newrelic install -n node-agent-installer newrelic install -n php-agent-installer newrelic install -n postgres-open-source-integration newrelic install -n rabbitmq-open-source-integration newrelic install -n redis-open-source-integration newrelic install -n varnish-cache-open-source-integration ``` -------------------------------- ### Example: Starting an Interaction in Android (Java/Kotlin) Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/mobile-monitoring/new-relic-mobile/mobile-sdk/start-interaction Illustrates how to use `NewRelic.startInteraction` in a practical Android application context, showing examples in both Java and Kotlin. ```Java public class MainActivity extends Activity { ... @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_refresh: NewRelic.startInteraction("RefreshContacts"); ... return true; default: return super.onOptionsItemSelected(item); } } ... } ``` ```Kotlin class MainActivity : AppCompatActivity() { ... var client: OkHttpClient = OkHttpClient(); binding.fab.setOnClickListener { view -> val interActionId = NewRelic.startInteraction("Getting Data From Server") lifecycleScope.launch(Dispatchers.IO) { val result = getRequest() NewRelic.endInteraction(interActionId) } } } ... ``` -------------------------------- ### Install New Relic CLI on Windows Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-solutions/tutorials/new-relic-cli Installs the New Relic CLI on Windows systems using Scoop. This process involves adding the New Relic CLI's GitHub repository as a Scoop bucket, then installing the CLI package from that bucket. ```bash scoop bucket add newrelic-cli https://github.com/newrelic/newrelic-cli.git scoop install newrelic-cli ``` -------------------------------- ### Copy PostgreSQL Log Configuration Example (Linux) Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/host-integrations/host-integrations-list/postgresql/postgresql-integration Copies the example PostgreSQL log configuration file to its active name, enabling automatic parsing and forwarding of PostgreSQL logs by the New Relic Infrastructure agent on Linux. ```bash sudo cp /etc/newrelic-infra/logging.d/postgresql-log.yml.example /etc/newrelic-infra/logging.d/postgresql-log.yml ``` -------------------------------- ### New Relic Infrastructure Agent Configuration File Example Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure-install-windows-server Example content for the `newrelic-infra.yml` file, located in `C:\Program Files\New Relic\newrelic-infra\`, showing how to set the `license_key` attribute manually after installation. ```yaml license_key: YOUR_LICENSE_KEY ``` -------------------------------- ### Install New Relic Go Agent Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/serverless-function-monitoring/aws-lambda-monitoring/get-started/enable-new-relic-monitoring-aws-lambda Installs the core New Relic Go agent package using `go get`. This package provides the foundational functionalities required for New Relic instrumentation in Go applications. ```bash go get -u github.com/newrelic/go-agent/v3/newrelic ``` -------------------------------- ### Install New Relic CLI and Agent on Linux via Bash Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/infrastructure-agent/new-relic-guided-install-overview This snippet provides commands to install the New Relic CLI and an associated agent/integration on Linux systems. It uses `curl` to download and execute the installation script, requiring New Relic API key, account ID, and region for proper configuration. Examples include a generic recipe and the Apache integration. ```bash curl -Ls https://download.newrelic.com/install/newrelic-cli/scripts/install.sh | bash && sudo NEW_RELIC_API_KEY=INSERT_YOUR_API_KEY NEW_RELIC_ACCOUNT_ID=INSERT_YOUR_ACCOUNT_ID NEW_RELIC_REGION=INSERT_YOUR_REGION /usr/local/bin/newrelic install -n INSERT_THE_RECIPE_NAME ``` ```bash curl -Ls https://download.newrelic.com/install/newrelic-cli/scripts/install.sh | bash && sudo NEW_RELIC_API_KEY=INSERT_YOUR_API_KEY NEW_RELIC_ACCOUNT_ID=INSERT_YOUR_ACCOUNT_ID /usr/local/bin/newrelic install -n apache-open-source-integration ``` -------------------------------- ### Example Output for Azure Account Show Command Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/microsoft-azure-integrations/get-started/activate-azure-integrations This JSON output demonstrates the expected response from the 'az account show' command. The 'id' field represents the subscription ID, and 'tenantId' represents the tenant ID, both of which are required for New Relic integration setup. ```json { "environmentName": "AzureCloud", "id": "9ffe9512-f4a2-42dd-1230-518aec34be21", "isDefault": true, "name": "Beyond Team Sandbox", "state": "Enabled", "tenantId": "ac6692da-1231-422f-22a8-9eed6dbe83f1", "user": { "name": "youremail@domain", "type": "user" } } ``` -------------------------------- ### Install New Relic Apache Integration on Linux Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/host-integrations/installation/new-relic-guided-install-overview This command demonstrates how to install the New Relic Apache integration specifically on a Linux system using the guided install. It leverages the New Relic CLI and requires the API Key and Account ID for authentication, automatically applying the 'apache-open-source-integration' recipe. ```bash curl -Ls https://download.newrelic.com/install/newrelic-cli/scripts/install.sh | bash && sudo NEW_RELIC_API_KEY=INSERT_YOUR_API_KEY NEW_RELIC_ACCOUNT_ID=INSERT_YOUR_ACCOUNT_ID /usr/local/bin/newrelic install -n apache-open-source-integration ``` -------------------------------- ### Initialize New Relic C SDK Application and Connect to Daemon Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/install-c-agent-compile-link-your-code Illustrates the process of initializing the New Relic C SDK, connecting to the daemon, and creating an application instance. This snippet includes basic error handling for daemon connection and demonstrates how to destroy the app configuration after use. ```C newrelic_app_t* app; /* ... */ if (!newrelic_init(NULL, 0)) { printf("Error connecting to daemon.\n"); return -1; } /* Wait up to 10 seconds for the SDK to connect to the daemon */ app = newrelic_create_app(config, 10000); newrelic_destroy_app_config(&config); ``` -------------------------------- ### Install New Relic Go Agent Core Package Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/serverless-function-monitoring/aws-lambda-monitoring/instrument-lambda-function/sdk-based-instrumentation Installs the primary New Relic Go agent package using the `go get` command. This package provides the core functionalities for New Relic instrumentation in Go applications. ```bash go get -u github.com/newrelic/go-agent/v3/newrelic ``` -------------------------------- ### Start New Relic Nerdpack Local Development Server Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-solutions/tutorials/build-hello-world-app This bash snippet provides the command `nr1 nerdpack:serve` to initiate a local development server for a New Relic Nerdpack. The output demonstrates the server's initialization process, including certificate creation, webpack bundling, and the local URLs for testing the application. ```bash nr1 nerdpack:serve Found and loaded 2 nr1.json files on MyAwesomeNerdpack (123a4b95-678c-9012-3456-d7e8f90g1hi2) Nerdpack. Nerdpack: ✓ MyAwesomeNerdpack (123a4b95-678c-9012-3456-d7e8f90g1hi2) nr1.json Launchers: ✓ launcher launchers/launcher/nr1.json Nerdlets: ✓ home nerdlets/home/nr1.json There is no certificate created yet. ✓ New certificate created. Webpack bundle analyzer is enabled (you need to wait for the first build to finish) └ You can head to http://127.0.0.1:27888 NOTE: To verify how your assets will look in production, you need to add "--mode=prod" when starting the development server. ⚒ Built artifact files for:ex.js... ⁎ 123a4b95-678c-9012-3456-d7e8f90g1hi2--home built ✓ ✓ Nerdpack built successfully! ★ Starting as orchestrator... ✓ Server ready! Test it at: https://one.newrelic.com/?nerdpacks=local ↩ Server will reload automatically if you modify any file! ℹ Additionally, you can test the following artifacts at: Launchers: ⁎ launcher https://onenr.io/0JBQrggmDwZ ℹ You can use "npm start -- --mode=prod" to run the development server in prod mode. ``` -------------------------------- ### Install New Relic Apache Integration (Linux) Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-one/use-new-relic-one/cross-product-functions/install-configure/new-relic-guided-install-overview This command demonstrates how to install a specific integration, such as the Apache integration, using the New Relic CLI on Linux. It first installs the CLI and then executes the `newrelic install` command, providing the necessary API key and account ID as environment variables. ```bash curl -Ls https://download.newrelic.com/install/newrelic-cli/scripts/install.sh | bash && sudo NEW_RELIC_API_KEY=INSERT_YOUR_API_KEY NEW_RELIC_ACCOUNT_ID=INSERT_YOUR_ACCOUNT_ID /usr/local/bin/newrelic install -n apache-open-source-integration ``` -------------------------------- ### Start New Relic Infrastructure Agent with Custom Configuration Path Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/install-configure-manage-infrastructure/linux-installation/tarball-manual-install-infrastructure-linux This command demonstrates how to start the New Relic Infrastructure agent binary, specifying a custom path for its configuration file using the -config flag. This is useful for testing or managing multiple configurations. ```bash usr/bin/newrelic-infra -config /whatever/path/custom_config_name.yml ``` -------------------------------- ### Start and Get New Relic Segment Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/java-agent/custom-instrumentation/java-agent-api Start a new Segment within the current New Relic Transaction and get a reference to it for detailed timing of specific operations. ```APIDOC NewRelic.getAgent().getTransaction().startSegment() ``` -------------------------------- ### Initialize New Relic C SDK and Create Application Instance Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/install-c-sdk-compile-link-your-code Initializes the New Relic C SDK's connection to the daemon and creates an application instance using the previously configured application settings. Includes basic error handling and resource cleanup for the configuration. ```C newrelic_app_t* app; /* ... */ if (!newrelic_init(NULL, 0)) { printf("Error connecting to daemon.\n"); return -1; } /* Wait up to 10 seconds for the SDK to connect to the daemon */ app = newrelic_create_app(config, 10000); newrelic_destroy_app_config(&config); ``` -------------------------------- ### Start New Relic Infrastructure Service Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/new-relic-infrastructure/installation/install-infrastructure-windows-server Command to start the New Relic Infrastructure agent service on Windows after installation and configuration. ```bash net start newrelic-infra ``` -------------------------------- ### Initialize New Relic C SDK Application and Connect to Daemon Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/apm/agents/c-sdk/install-configure/install-c-sdk-compile-link-your-code Illustrates the process of initializing the New Relic C SDK, connecting to the daemon, and creating an application instance. This snippet includes basic error handling for daemon connection and demonstrates proper resource cleanup for the application configuration. ```C newrelic_app_t* app; /* ... */ if (!newrelic_init(NULL, 0)) { printf("Error connecting to daemon.\n"); return -1; } /* Wait up to 10 seconds for the SDK to connect to the daemon */ app = newrelic_create_app(config, 10000); newrelic_destroy_app_config(&config); ``` -------------------------------- ### Manually Complete New Relic PHP Agent Installation Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/apm/agents/php-agent/installation/php-agent-installation-ubuntu-debian If the `newrelic-php5` package cannot automatically configure PHP (e.g., in non-standard installations or custom PHP setups), this command runs the `newrelic-install` script as root to complete the setup process and ensure proper integration. ```bash sudo newrelic-install install ``` -------------------------------- ### Initialize New Relic C SDK and Create Application Instance Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/c-sdk/install-configure/install-c-sdk-compile-link-your-code Shows the process of initializing the New Relic C SDK and creating an application instance that connects to the daemon. It includes basic error handling for connection failures and specifies a timeout for daemon connection. ```C newrelic_app_t* app; /* ... */ if (!newrelic_init(NULL, 0)) { printf("Error connecting to daemon.\n"); return -1; } /* Wait up to 10 seconds for the SDK to connect to the daemon */ app = newrelic_create_app(config, 10000); newrelic_destroy_app_config(&config); ``` -------------------------------- ### New Relic .NET Agent: StartAgent Example Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/apm/agents/net-agent/net-agent-api/net-agent-api Example demonstrating how to explicitly start the New Relic .NET Agent using the `StartAgent` method. ```C# NewRelic.Api.Agent.NewRelic.StartAgent(); ``` -------------------------------- ### Scripted Installation with License Key and Proxy Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure-install-windows-server Example command for a scripted installation of the New Relic Infrastructure agent, demonstrating how to set the license key, configure a proxy server, and add a single custom attribute during the MSI installation process. ```bash msiexec.exe /qn /i PATH\TO\newrelic-infra.msi GENERATE_CONFIG=true LICENSE_KEY=YOUR_LICENSE_KEY PROXY=http://YOUR_PROXY_SERVER:PROXY_PORT CUSTOM_ATTRIBUTES="{'ATTRIBUTE_1':'VALUE_1'}" ``` -------------------------------- ### Install New Relic CLI on macOS Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-solutions/tutorials/new-relic-cli Installs the New Relic CLI on macOS systems using Homebrew. Ensure Homebrew is installed and properly configured on your system before running this command. ```bash brew install newrelic-cli ``` -------------------------------- ### Display New Relic C SDK Daemon Help Options Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/install-c-sdk-compile-link-your-code Command to display all available command-line options and usage instructions for the New Relic C SDK daemon. ```bash ./newrelic-daemon --help ``` -------------------------------- ### Example PHP Version Selection Menu Output Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/php/the-newrelic-install-script This snippet displays an example of the interactive menu presented by the `newrelic-install` script when multiple PHP versions are detected on the system. Users are prompted to select one or more PHP versions for agent installation. ```Shell 1) /usr/bin 2) /usr/local/php/5.2.16/bin 3) /usr/local/php/5.2.16-zts/bin 4) /usr/local/php/5.3.4/bin 5) /usr/local/php/5.3.4-zts/bin 6) /usr/local/php/5.4.19-zts/bin 7) /usr/local/php/5.5.4-zts/bin 0) Exit Select (1-7, 0 to exit, or all): ``` -------------------------------- ### Enable New Relic Infrastructure Service with SysV Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/install-configure-manage-infrastructure/linux-installation/tarball-manual-install-infrastructure-linux These commands configure the New Relic Infrastructure agent service to start automatically on boot using SysV init scripts, integrating it into the system's startup process. ```bash update-rc.d newrelic-infra defaults update-rc.d newrelic-infra enable ``` -------------------------------- ### Complete New Relic PHP Agent Manual Configuration Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/php-agent/installation/php-agent-installation-ubuntu-and-debian If the `newrelic-php5` package cannot automatically configure PHP due to a non-standard installation, this command runs the `newrelic-install` script. This script guides you through the necessary steps to complete the agent setup manually. ```bash sudo newrelic-install install ``` -------------------------------- ### Integration Execution Command Examples Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/create-integrations/infrastructure-integrations-sdk/specifications/host-integrations-newer-configuration-format Examples of how the `foo-monitor` executable is invoked by the agent for each discovered container, passing the path to the generated temporary configuration file. ```bash /opt/foo/bin/monitor --config=/tmp/123_discovered ``` ```bash /opt/foo/bin/monitor --config=/tmp/456_discovered ``` ```bash /opt/foo/bin/monitor --config=/tmp/789_discovered ``` -------------------------------- ### Start New Relic Infrastructure Agent Service Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/infrastructure-agent/windows-installation/windows-msi-installer Command to manually start the `newrelic-infra` service after installation and configuration on Windows. ```bash net start newrelic-infra ``` -------------------------------- ### Clone New Relic nr1-how-to Example Application Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-solutions/tutorials/add-tables Commands to clone the New Relic nr1-how-to repository from GitHub and navigate into the specific example directory for table creation. ```bash git clone https://github.com/newrelic/nr1-how-to.git cd nr1-how-to/create-a-table/nerdlets/create-a-table-nerdlet ``` -------------------------------- ### Complete New Relic PHP Agent Installation Manually Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/php-agent/installation/php-agent-installation-ubuntu-debian If the `newrelic-php5` package cannot automatically configure PHP due to a non-standard installation, this command runs the `newrelic-install` script as root to complete the agent setup process. ```bash sudo newrelic-install install ``` -------------------------------- ### New Relic Nerdpack Local Server Output Example Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-solutions/tutorials/customize-nerdpacks An example of the console output after running `nr1 nerdpack:serve`, listing the URLs for locally served New Relic visualizations. ```bash Visualizations: ⁎ circular-progress-bar https://one.nr/04ERPALBYjW ⁎ range-chart https://one.nr/0oqQaxezJj1 ⁎ stacked-bar-chart https://one.nr/0PLRElq3bwa ``` -------------------------------- ### Start New Relic Infrastructure Service Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure-install-windows-server Command to manually start the New Relic Infrastructure agent service on Windows after installation and configuration. ```bash net start newrelic-infra ``` -------------------------------- ### Run New Relic Installation Script Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/php-agent/installation/php-agent-installation-redhat-centos After installing the packages, execute the `newrelic-install` script to finalize the agent setup. This script guides you through configuration steps, such as setting your license key and configuring PHP INI files. ```bash sudo newrelic-install install ``` -------------------------------- ### Download New Relic ECS Integration Installer Script Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/integrations/elastic-container-service-integration/installation/install-ecs-integration Downloads the New Relic ECS integration installer script from the official New Relic download server. This script automates the setup process for the New Relic infrastructure agent on ECS. ```bash curl -O https://download.newrelic.com/infrastructure_agent/integrations/ecs/newrelic-infra-ecs-installer.sh ``` -------------------------------- ### Publish New Relic Nerdpack to Instant Observability Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-solutions/tutorials/build-hello-world-app This command publishes the current New Relic Nerdpack from its root directory to Instant Observability. It compiles the application, uploads it, and tags a stable version, making it accessible to other users within New Relic. ```bash $ nr1 nerdpack:publish Found and loaded 2 nr1.json files on MyAwesomeNerdpack (123a4b95-678c-9012-3456-d7e8f90g1hi2) Nerdpack. Nerdpack: ✔ MyAwesomeNerdpack (123a4b95-678c-9012-3456-d7e8f90g1hi2) nr1.json Launchers: ✔ launcher launchers/launcher/nr1.json Nerdlets: ✔ home nerdlets/home/nr1.json 🛠 Built artifact files for: ⁎ 123a4b95-678c-9012-3456-d7e8f90g1hi2--home built ✔ ✔ Nerdpack built successfully! Publishing Nerdpack MyAwesomeNerdpack (123a4b95-678c-9012-3456-d7e8f90g1hi2) ✔ Nerdpack published successfully! ✔ Tagged 123a4b95-678c-9012-3456-d7e8f90g1hi2 version 0.1.0 as STABLE. ``` -------------------------------- ### Run New Relic PHP Agent Install Script Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/php-agent/installation/update-php-agent Executes the New Relic PHP agent installation script on RedHat or CentOS systems to finalize the agent setup. Follow prompts for confirmation. ```bash $ sudo newrelic-install install ``` -------------------------------- ### Clone New Relic One Sample Applications Repository Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-solutions/tutorials/add-time-picker This command clones the `nr1-how-to` GitHub repository, which contains various New Relic One example applications. It's the first step to obtain the sample code for local development. The repository is a dependency for all subsequent steps involving sample applications. ```bash git clone https://github.com/newrelic/nr1-how-to.git ``` -------------------------------- ### View New Relic C SDK Daemon Help Options Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/c-sdk/install-configure/install-c-sdk-compile-link-your-code Shows the command to display all available command-line options and usage information for the New Relic C SDK daemon. This is useful for understanding various configuration parameters and troubleshooting. ```Bash $ ./newrelic-daemon --help ``` -------------------------------- ### New Relic dbt_job_run Event Structure and Example Query Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/other-infrastructure-integrations/dbt-cloud-integration Documentation for the `dbt_job_run` custom event reported to New Relic, including its attributes and an example NRQL query to retrieve job run statuses. ```APIDOC dbt_job_run Event: description: Provides metadata and the status of all completed runs. This event does not include any data about models, snapshots, seeds and tests. attributes: - project_name - environment_name - run_team - All fields listed in the dbt Cloud v2 API for runs (prepended with 'run_' except project_name and environment_name). ``` ```SQL -- Get status of all job runs in the past seven days select project_name, environment_name, job_name, run_created_at, run_run_duration_humanized, run_status, run_status_humanized, run_status_message from dbt_job_run since 7 days ago ``` -------------------------------- ### Install New Relic Go Agent Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/install-enable-new-relics-monitoring-aws-lambda Installs the core New Relic Go agent package using the `go get` command. This agent is essential for monitoring Go applications, including Lambda functions. ```bash go get -u github.com/newrelic/go-agent/v3/newrelic ``` -------------------------------- ### Install Plugin Dependencies and Generate Sample Configuration Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/accounts-partnerships/accounts/install-new-relic/partner-based-installation/rackspace-cloud-load-balancer-plugin These commands are executed from within the plugin's extracted directory. The first command, `bundle install -binstubs`, installs all necessary Ruby gem dependencies required for the plugin to function. The second command, `./bin/newrelic_rs --sample-config`, generates a template `newrelic_plugin.yml` file, which users must then modify with their specific New Relic license key and Rackspace API credentials. ```bash bundle install -binstubs ./bin/newrelic_rs --sample-config ``` -------------------------------- ### Install Agent with License Key, Proxy, and Custom Attribute Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/new-relic-infrastructure/installation/install-infrastructure-windows-server Example command for installing the New Relic Infrastructure agent, generating a configuration file, setting the license key, configuring a proxy server, and adding a single custom attribute during installation. ```bash msiexec.exe /qn /i PATH\TO\newrelic-infra.msi GENERATE_CONFIG=true LICENSE_KEY=YOUR_LICENSE_KEY PROXY=http://YOUR_PROXY_SERVER:PROXY_PORT CUSTOM_ATTRIBUTES="{'ATTRIBUTE_1':'VALUE_1'}" ``` -------------------------------- ### New Relic dbt_failed_test_rows Event Structure and Example Query Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/other-infrastructure-integrations/dbt-cloud-integration Documentation for the `dbt_failed_test_rows` custom event, which provides metadata and up to the first ten columns of failed test query results, along with an example NRQL query. ```APIDOC dbt_failed_test_rows Event: description: Provides metadata and up to the first ten columns of the results of a failed test query. This event is only created when the meta config for a dbt test has alert_failed_test_rows: true. attributes: - All attributes in dbt_resource_run - field_1 - field_10 (representing the first ten columns returned in a test query) ``` ```SQL select project_name, environment_name, job_name, run_created_at, name, field_1, field_2, field_3, field_4, field_5, field_6, field_7, field_8, field_9, field_10 from dbt_failed_test_row since 7 days ago ``` -------------------------------- ### Install Docker and Docker Compose Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/host-integrations/host-integrations-list/temporal-monitoring-integration Instructions to install Docker and Docker Compose on a Linux system using apt package manager. ```bash $ sudo apt install docker $ sudo apt install docker-compose ``` -------------------------------- ### Download New Relic Rackspace Load Balancer Plugin Archive Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/accounts-partnerships/accounts/install-new-relic/partner-based-installation/rackspace-cloud-load-balancer-plugin This command downloads the New Relic Rackspace Load Balancer plugin archive (version 1.0.0) directly from its GitHub repository. It uses `wget` to fetch the compressed `.zip` file, which is the initial step in the manual installation process. ```bash wget https://github.com/newrelic-platform/newrelic_rackspace_load_balancers_plugin/archive/1.0.0.zip ``` -------------------------------- ### New Relic Android: Example Initialization with Custom Version Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/mobile-monitoring/new-relic-mobile/mobile-sdk/set-application-version This example illustrates how to integrate the `withApplicationVersion` method into the New Relic Android agent's initialization process. It shows a complete setup including token and version setting before starting the agent. ```Java NewRelic.withApplicationToken("").withApplicationVersion("1.23.4").start(this.getApplication()); ``` ```Kotlin NewRelic.withApplicationToken("").withApplicationVersion("1.23.4").start(applicationContext) ``` -------------------------------- ### Run New Relic Post-Installation Script Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/php-agent/installation/php-agent-installation-aws-linux-redhat-centos After installing the New Relic PHP agent packages, execute this script to complete the setup and configuration process. It guides you through necessary steps like license key input. ```bash sudo newrelic-install install ``` -------------------------------- ### Start New Relic C SDK Daemon Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/install-c-sdk-compile-link-your-code Command to start the New Relic C SDK daemon in the foreground, specifying a log file and debug log level. The daemon must be running before the instrumented application is invoked. ```bash ./newrelic-daemon -f -logfile newrelic-daemon.log -loglevel debug ``` -------------------------------- ### Display New Relic C SDK Daemon Help Options Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/install-c-agent-compile-link-your-code Command to display all available command-line options and usage instructions for the New Relic C SDK daemon. This is useful for understanding various configuration and operational parameters. ```Bash ./newrelic-daemon --help ``` -------------------------------- ### Enable New Relic Infrastructure Agent SysV Service Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/infrastructure-agent/linux-installation/tarball-manual-linux These commands enable the New Relic Infrastructure Agent service for SysV init systems, setting up default runlevel links and ensuring it starts automatically. It assumes the service file has been copied to `/etc/init.d/system/newrelic-infra`. ```bash update-rc.d newrelic-infra defaults update-rc.d newrelic-infra enable ``` -------------------------------- ### Install New Relic Redis Integration MSI (Windows) Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/integrations/host-integrations/host-integrations-list/redis-monitoring-integration This command initiates the installation of the New Relic Redis integration on Windows systems using the provided MSI installer via the command prompt. The `/qn` flag ensures a quiet installation, meaning it proceeds without displaying any user interface or requiring user interaction. ```bash msiexec.exe /qn /i PATH\TO\nri-redis-amd64.msi ``` -------------------------------- ### Install New Relic CLI and Agent with Generic Recipe (Linux) Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-one/use-new-relic-one/cross-product-functions/install-configure/new-relic-guided-install-overview This command downloads and executes the New Relic CLI installer script, then uses `sudo` to run the `newrelic install` command. It requires setting environment variables for the New Relic API key, account ID, and region, and specifies a generic recipe name for installation on Linux systems. ```bash curl -Ls https://download.newrelic.com/install/newrelic-cli/scripts/install.sh | bash && sudo NEW_RELIC_API_KEY=INSERT_YOUR_API_KEY NEW_RELIC_ACCOUNT_ID=INSERT_YOUR_ACCOUNT_ID NEW_RELIC_REGION=INSERT_YOUR_REGION /usr/local/bin/newrelic install -n INSERT_THE_RECIPE_NAME ``` -------------------------------- ### Install New Relic Go Agent and Lambda Integration Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/serverless-function-monitoring/aws-lambda-monitoring/instrument-lambda-function/enable-serverless-monitoring-aws-lambda-layerless These commands install the New Relic Go agent and its specific integration for AWS Lambda functions using the `go get` utility. This is a prerequisite for instrumenting Go Lambdas. ```bash go get -u github.com/newrelic/go-agent/v3/newrelic ``` ```bash go get -u github.com/newrelic/go-agent/v3/integrations/nrlambda ``` -------------------------------- ### Configure New Relic Application with a Single Name (C SDK) Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/install-c-sdk-compile-link-your-code Initializes the New Relic application configuration with a single, meaningful application name. This is the first step in setting up the C SDK for monitoring. ```C newrelic_app_config_t* config; /* ... */ config = newrelic_create_app_config("Your Application Name", "LICENSE_KEY_HERE"); ``` -------------------------------- ### Initialize Terraform Project Directory Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/more-integrations/terraform/terraform-intro Creates a new directory named 'terraform-project', navigates into it, and then creates an empty 'main.tf' file. This file will store the Terraform configuration for New Relic resources. ```bash mkdir terraform-project && cd terraform-project touch main.tf ``` -------------------------------- ### Run New Relic Agent Installation Script Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/php-agent/installation/php-agent-installation-redhat-and-centos This command executes the `newrelic-install` script, initiating the final configuration steps for the New Relic PHP agent. This script guides the user through essential setup procedures to ensure the agent functions correctly. ```bash sudo newrelic-install install ``` -------------------------------- ### Initialize and Run Airflow with Docker Compose Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/other-infrastructure-integrations/dbt-cloud-integration These commands are used to set up and start the Airflow environment using Docker Compose, suitable for quick proofs-of-concept. The first command navigates into the Airflow directory, followed by commands to initialize the environment and then bring up all defined services. ```bash cd newrelic-dbt-cloud-integration/airflow ``` ```bash docker-compose up airflow-init ``` ```bash docker-compose up ``` -------------------------------- ### Install New Relic Integrations via CLI Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/infrastructure-agent/new-relic-guided-install-overview Commands to install various New Relic agents and on-host integrations using the `newrelic install` CLI command. These commands are part of the guided installation process and are executed in a shell environment. ```bash newrelic install -n apache-open-source-integration ``` ```bash newrelic install -n cassandra-open-source-integration ``` ```bash newrelic install -n couchbase-open-source-integration ``` ```bash newrelic install -n dotnet-agent-installer ``` ```bash newrelic install -n elasticsearch-open-source-integration ``` ```bash newrelic install -n haproxy-open-source-integration ``` ```bash newrelic install -n hashicorp-consul-open-source-integration ``` ```bash newrelic install -n infrastructure-agent-installer ``` ```bash newrelic install -n java-agent-installer ``` ```bash newrelic install -n memcached-open-source-integration ``` ```bash newrelic install -n mssql-server-integration-installer ``` ```bash newrelic install -n mongodb-open-source-integration ``` ```bash newrelic install -n mysql-open-source-integration ``` ```bash newrelic install -n nagios-open-source-integration ``` ```bash newrelic install -n nginx-open-source-integration ``` ```bash newrelic install -n node-agent-installer ``` ```bash newrelic install -n php-agent-installer ``` ```bash newrelic install -n postgres-open-source-integration ``` ```bash newrelic install -n rabbitmq-open-source-integration ``` ```bash newrelic install -n redis-open-source-integration ``` ```bash newrelic install -n varnish-cache-open-source-integration ``` -------------------------------- ### New Relic dbt_resource_run Event Structure and Example Queries Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/other-infrastructure-integrations/dbt-cloud-integration Documentation for the `dbt_resource_run` custom event, detailing metadata and statuses for dbt resources (models, snapshots, seeds, tests) within a job run, along with multiple NRQL query examples. ```APIDOC dbt_resource_run Event: description: Provides metadata and statuses for all resources run in a dbt job run. Resources include models, snapshots, seeds and tests. attributes: - All attributes in dbt_job_run - team (Configured in dbt project meta) - alert_failed_test_rows - failed_test_rows_limit - slack_mentions - message - resource_type - unique_id - database_name - schema_name - test_column_name - test_model_name - test_namespace - test_parameters - test_short_name - alias - severity - warn_if - error_if - tags - path - original_file_path - meta - meta_config ``` ```SQL -- Get status of all resources run in the past day -- Status = 'None' means the resource exists in the project but was not executed in a particular run select project_name, environment_name, job_name, run_created_at, resource_type, name, status from dbt_resource_run where status != 'None' since 1 day ago limit 200 ``` ```SQL -- Get all resources types in the past day select uniques(resource_type) from dbt_resource_run since 1 day ago ``` ```SQL -- Get the count of all statuses in the last day -- Status = 'None' means the resource exists in the dbt project, but was not executed in a particular run select count(*) as total_count from dbt_resource_run facet status since 1 day ago ``` -------------------------------- ### Start Temporal Server with Docker Compose Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/host-integrations/host-integrations-list/temporal-monitoring-integration Command to build and start the Temporal Server instance using the configured Docker Compose file, bringing up the services. ```bash $ sudo docker-compose up ``` -------------------------------- ### Configure and Start NVIDIA DCGM Exporter Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/host-integrations/host-integrations-list/nvidia-dcgm-integration This sequence of bash commands guides you through cloning the DCGM exporter repository, navigating into its directory, building and installing necessary binaries, starting the exporter in the background, and finally, verifying that the exporter is serving metrics on its default port. ```bash git clone https://github.com/NVIDIA/dcgm-exporter cd dcgm-exporter make binary sudo make install dcgm-exporter & curl localhost:9400/metrics ``` -------------------------------- ### View New Relic C SDK Daemon Help Options Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/apm/agents/c-sdk/install-configure/install-c-sdk-compile-link-your-code Command to display all available command-line options and usage instructions for the New Relic C SDK daemon. This is useful for understanding various configuration and operational parameters. ```Bash ./newrelic-daemon --help ``` -------------------------------- ### autostart.denylisted_constants Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/ruby-agent/configuration/ruby-agent-configuration Specify a list of constants that should prevent the agent from starting automatically. Separate individual constants with a comma `,`. For example, "Rails::Console,UninstrumentedBackgroundJob". ```APIDOC autostart.denylisted_constants: Type: String Default: "Rails::Command::ConsoleCommand,Rails::Command::CredentialsCommand,Rails::Command::Db::System::ChangeCommand,Rails::Command::DbConsoleCommand,Rails::Command::DestroyCommand,Rails::Command::DevCommand,Rails::Command::EncryptedCommand,Rails::Command::GenerateCommand,Rails::Command::InitializersCommand,Rails::Command::NotesCommand,Rails::Command::RoutesCommand,Rails::Command::RunnerCommand,Rails::Command::SecretsCommand,Rails::Console,Rails::DBConsole" Environ variable: NEW_RELIC_AUTOSTART_DENYLISTED_CONSTANTS ``` -------------------------------- ### Update UUID and Serve New Relic One Sample Application Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-solutions/tutorials/add-time-picker These commands use the New Relic One CLI to prepare and run the sample application locally. `nr1 update` ensures the local environment is up-to-date, `nr1 nerdpack:uuid -gf` generates or updates the application's unique ID, and `nr1 nerdpack:serve` starts a local server to host the application for testing. These steps are essential to deploy and view the application in a local New Relic One environment. ```bash nr1 update nr1 nerdpack:uuid -gf nr1 nerdpack:serve ``` -------------------------------- ### Start New Relic Nerdpack Local Development Server Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-solutions/build-nr-ui/custom-visualizations/build-visualization This command sequence navigates into a New Relic Nerdpack directory and starts a local Node.js server. This server serves the custom visualization, allowing for local testing and live updates to certain files like `index.js`. ```bash cd my-awesome-nerdpack nr1 nerdpack:serve ``` -------------------------------- ### Download New Relic ECS Fargate Task Definition Example Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/integrations/elastic-container-service-integration/installation/install-ecs-integration Downloads the example JSON task definition for New Relic ECS integration with Fargate. This definition includes a sidecar container for the New Relic infrastructure agent, which can be adapted for monitoring your application containers. ```bash curl -O https://download.newrelic.com/infrastructure_agent/integrations/ecs/newrelic-infra-ecs-fargate-example-latest.json ``` -------------------------------- ### Install New Relic CLI and Agent on Windows via PowerShell Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/infrastructure-agent/new-relic-guided-install-overview This snippet demonstrates the PowerShell command for installing the New Relic CLI and agent on Windows. It handles security protocol settings, downloads the installation script, and sets necessary environment variables for the API key, account ID, and region before initiating the installation. ```powershell [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls'; (New-Object System.Net.WebClient).DownloadFile("https://download.newrelic.com/install/newrelic-cli/scripts/install.ps1", "$env:TEMP\install.ps1"); & PowerShell.exe -ExecutionPolicy Bypass -File $env:TEMP\install.ps1; $env:NEW_RELIC_API_KEY='INSERT_YOUR_API_KEY'; $env:NEW_RELIC_ACCOUNT_ID='INSERT_YOUR_ACCOUNT_ID'; $env:NEW_RELIC_REGION='INSERT_YOUR_REGION'; & 'C:\Program Files\New Relic\New Relic CLI\newrelic.exe' install ``` -------------------------------- ### NRQL query for Envoy downstream connections Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/host-integrations/host-integrations-list/envoy-integration A New Relic Query Language (NRQL) example to retrieve the latest total downstream connections reported by Envoy metrics. ```nrql SELECT latest(envoy_http_downstream_cx_total) as 'Downstream total connections' from Metric ``` -------------------------------- ### New Relic Browser API: newrelic.start() Method Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/browser/new-relic-browser/browser-apis/start Documents the `newrelic.start()` API method, which is used to initiate agent features when the New Relic Browser agent is running in a deferred state. It specifies the required agent versions and notes a current limitation regarding its integration with the larger deployment system, affecting its use in certain installation types. ```APIDOC newrelic.start() Description: Browser API used to start agent features when running in a deferred state. Requirements: - Browser Lite, Pro, or Pro+SPA agent (v1.239.0 or higher) - Important: The configuration required to use this API is not currently connected to the larger deployment system within New Relic. As such, calling this API will only have an effect in copy/paste or npm browser installations until further changes are made. ``` -------------------------------- ### New Relic CLI: Retrieve Application Tags Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/new-relic-solutions/tutorials/new-relic-cli Demonstrates how to fetch all tags associated with a specific New Relic application using its `guid` via the `newrelic entity tags get` CLI command. The command returns tags as a JSON array, showing the key and an array of values. ```bash newrelic entity tags get --guid YOUR_APP_GUID ``` ```JSON [ { "Key": "tag1", "Values": ["true"] }, { "Key": "tag2", "Values": ["test"] }, { "Key": "tag3", "Values": ["testing"] } // ... ] ``` -------------------------------- ### Start New Relic C SDK Daemon Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/install-c-agent-compile-link-your-code Command to start the New Relic C SDK daemon in the foreground, specifying a log file and debug log level. It is crucial that the daemon is running before the instrumented application is invoked. ```Bash ./newrelic-daemon -f -logfile newrelic-daemon.log -loglevel debug ``` -------------------------------- ### Preconfigure New Relic PHP Agent Settings with debconf-set-selections Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/php-agent/installation/php-agent-installation-ubuntu-and-debian Demonstrates how to use `debconf-set-selections` to preconfigure the New Relic PHP agent's application name and license key for headless installations on Debian/Ubuntu systems. This is crucial when not using `newrelic-install` and ensures the agent is configured before it starts. ```bash $ echo newrelic-php5 newrelic-php5/application-name string "My App Name" | debconf-set-selections $ echo newrelic-php5 newrelic-php5/license-key string "YOUR_LICENSE_KEY" | debconf-set-selections ``` -------------------------------- ### Compile and Link C Application with New Relic C SDK Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/install-c-agent-compile-link-your-code Provides an example `gcc` command to compile and link a C application with the New Relic C SDK. It includes necessary libraries (`libpcre`, `libpthread`) and highlights the use of the `-rdynamic` linker flag for enhanced error traces in APM's Error analytics. ```Bash gcc -o test_app test_app.c -L. -lnewrelic -lpcre -lm -pthread -rdynamic ``` -------------------------------- ### Dockerfile for New Relic PHP Agent and Daemon (Same Container) Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/agents/php-agent/advanced-installation/install-php-agent-docker This Dockerfile provides a complete example for building a Docker image that includes both the New Relic PHP agent and its daemon within the same container. It automates the discovery of the latest agent version, installation, and configuration. ```Dockerfile FROM php:fpm # Install the latest New Relic PHP Agent RUN \ cd /tmp \ # Discover the latest released version: && export NEW_RELIC_AGENT_VERSION=$(curl -s https://download.newrelic.com/php_agent/release/ | grep -o '[1-9][0-9]\?\(\.[0-9]\+\)\{3\}' | head -n1) \ # Discover libc provider && export NR_INSTALL_PLATFORM=$(ldd --version 2>&1 | grep -q musl && echo "linux-musl" || echo "linux") \ # Download the discovered version: && curl -o newrelic-php-agent.tar.gz https://download.newrelic.com/php_agent/release/newrelic-php5-${NEW_RELIC_AGENT_VERSION}-${NR_INSTALL_PLATFORM}.tar.gz \ # Install the downloaded agent: && tar xzf newrelic-php-agent.tar.gz \ && NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=0 ./*/newrelic-install install \ # Configure the agent to use license key from NEW_RELIC_LICENSE_KEY env var: && sed -ie 's/[ ;]*newrelic.license[[:space:]]=.*/newrelic.license=${NEW_RELIC_LICENSE_KEY}/' $(php-config --ini-dir)/newrelic.ini \ ``` -------------------------------- ### New Relic Integration Configuration Example (Multiple Instances) Source: https://docs.newrelic.com/docs/new-relic-solutions/get-started/intro-new-relic/infrastructure/integrations-sdk/file-specifications/integration-definition-file-specifications An example YAML configuration file demonstrating how to define multiple instances for a New Relic integration, each with its own command, arguments, and labels. ```YAML integration_name: com.myorg.nginx instances: - name: nginx1.myorg.com-metrics command: metrics arguments: status_url: http://one.url/status labels: environment: production role: load_balancer - name: nginx2.myorg.com-metrics command: metrics arguments: status_url: http://another.url/status labels: environment: production role: load_balancer ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.