Automate instrumentation

Replacing manual instrumentation with automated setup benefits you in many ways. Automation can make you faster, and it helps to eliminate fat-finger errors—and more importantly, it improves observability. You'll spend less time instrumenting systems, and reduce toil as your development ecosystem grows.

Prerequisite

Before starting this tutorial, be sure to complete the Measure code pipeline tutorial.

1. Make instrumentation part of every build

Rolling instrumentation into your standard build process makes visibility the default, instead of being viewed as yet another burden on your developers. Modern build tools like Gradle can do almost anything; you can take advantage of that power to instrument your code quickly and efficiently.

Read this Best Practices post for more information about automating instrumentation in your pipeline

2. Take advantage of integrations and existing tools

It’s always worth taking a little extra time to look for time-saving integrations and tools that can help to achieve your automation goals. For example, you can use IBM’s open-sourced New Relic CLI (command line interface) tool to automate a variety of tasks, such as managing New Relic Synthetics monitors; creating, editing, and deleting New Relic Alerts policies and conditions; and managing user accounts.

UI image of the NRCLI tool
Use IBM's New Relic CLI tool to manage your Synthetics monitors, alert policies, and user accounts.

3. Leverage the power of APIs

Now that you've instrumented your services, you can take advantage of New Relic's REST API to harvest information from your instrumentation and to manage your monitoring process. The New Relic API Explorer can help you to determine the cURL request format, available parameters, potential response status codes, and JSON response structure for each of the available API calls.

The New Relic documentation includes a wealth of additional information on APIs that you can use to automate a number of important tasks, including:

For more help

Recommendations for learning more: