New Relic, Programmability and Open Source
Tags: newrelic, opensource, observability, java
Published: 2020-07-21 18:16:29

####_Charles Humble for New Relic_

While New Relic has been involved in various open-source projects for some time, these efforts have received increased focus in recent months, as the company has made a concerted push into open source and [made the New Relic One platform programmable](https://blog.newrelic.com/product-news/new-relic-one-applications/). The recently launched <https://opensource.newrelic.com site> is intended to act as a hub for developers to discover, use, and contribute to the open-source projects maintained and supported by the vendor. Areas the projects cover include instrumentation, third-party integrations, custom apps, tooling templates and example code.

Among the approximately 180 projects, you’ll find the source code for a large number of the Nerdpacks available through the application catalogue on New Relic One. These provide working, usable examples of the programmatic capabilities of the platform. Nerdpacks are [Webpack](https://webpack.js.org/) applications that use [GraphQL](https://graphql.org/) to interact with the data available in New Relic, and [React](https://reactjs.org/) components for visualization and other UI. These are the same tools that New Relic’s developers use to build the platform itself.

Examples of Nerdpacks include [Cloud Optimize](https://opensource.newrelic.com/projects/newrelic/nr1-cloud-optimize), which evaluates the size and utilization of your AWS, GCP and Azure cloud instances and shows the amount of money you could save by right-sizing; [Container Explorer](https://opensource.newrelic.com/projects/newrelic/nr1-container-explorer), which gives you a global view of all containers associated with an account; and (Top)[https://opensource.newrelic.com/projects/newrelic/nr1-top], a simple process monitor inspired by the Unix top command:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2k7o7minik492qaq43ay.png)

The [source](https://opensource.newrelic.com/projects/newrelic/opensource-website) for the New Relic open-source website itself, built using [Gatsby](https://www.gatsbyjs.org/), is also available.

In addition, you can find a number of libraries, including [GraphQL Java Core](https://opensource.newrelic.com/projects/newrelic/newrelic-graphql-java-core), which provides helpers for integrating (graphql-java)[https://github.com/graphql-java/graphql-java] with a JVM application, simplifying input mapping and schema configuration. [Ben Evans](https://github.com/kittylyst), Principal Engineer & JVM Technologies Architect at New Relic, explained that

>We use GraphQL as a key "glue" technology - where the schema acts as an interface definition and a contract between the back end and front end (and because we have programmability capability customers can use the same contract to build their own rich front ends if they want).

>This means we quite naturally fall into the "schema first" view of the world - where we want to enable teams to write the schema and then auto-generate based upon that schema, rather than adding Java annotations to pre-existing services... Of course, the schema-first approach may not work for everyone - but it works for us so we thought we'd share those pieces that enable it.

There are three major community-led projects that New Relic doesn’t host, but to which it contributes. The first is the [OpenTelemetry](https://opentelemetry.io/) standard, currently incubating with the CNCF. This project, formed through a merger of OpenTracing and OpenCensus, is a multi-vendor effort that provides a single set of APIs, libraries, agents, and collector services to capture distributed traces and metrics from your application. New Relic contributes by defining specifications, implementing parts of the specification in language SDKs, reviewing pull requests from other contributors, and serving as a maintainer in the various OpenTelemetry sub projects. The company has two full-time engineers working on the project - [John Watson](https://github.com/jkwatson) is a Java maintainer, and [Tyler Yahn](https://github.com/MrAlias) is a Go maintainer. John is also highly active on the project’s [Gitter](https://gitter.im/open-telemetry/community).

Secondly, New Relic is a participant in the [W3C Distributed Tracing Working Group](https://www.w3.org/2018/distributed-tracing/). The W3C project is closely linked to OpenTelemetry, which supports the emerging W3C standard as one of the available options for context propagation. As Alois Reitbauer has written in an [explainer about the W3C Trace Context sub-project](https://medium.com/@AloisReitbauer/trace-context-and-the-road-toward-trace-tool-interoperability-d4d56932369c)

>The W3C Trace Context specification is a set of new standards being developed by open source and commercial tool providers that defines a unified approach to context and event correlation within distributed systems, such as microservices environments. Having such a standard will enable end-to-end transaction tracing within distributed applications across a range of monitoring tools.

The third community effort is [AdoptOpenJDK](https://www.infoq.com/news/2020/06/adoptopenjdk-eclipse-adoptium/) (soon to be moving to the Eclipse Foundation and renamed [Eclipse Adoptium](https://adoptopenjdk.net/)). AdoptOpenJDK started in 2017 as an advocacy and on-boarding program for OpenJDK (the OSS project behind Java itself), but has since shifted its efforts to providing a long-term, stable build platform for OpenJDK. New Relic is a Silver Sponsor, with a pool of around five engineers involved in the project. New Relic's involvement came about, Evans explained, after Oracle changed the terms under which they distribute their Java binaries.

>We decided that we would adopt the same upgrade cadence as we see our customers using and that meant sticking with LTS Java releases. In turn, that meant choosing a vendor to be our supplier for open-source Java binaries.

>AdoptOpenJDK offers free, high quality binaries - and they are focused on the binaries, not on making source code contributions. After Oracle, AdoptOpenJDK is the stand-out distribution that we see our customers using, so it was an easy choice to make them our supplier as well.

>The decision to get involved on a technical level came about due to a confluence of: a) New Relic engineers who wanted to spend more time working on open-source software and b) Technical efforts within AdoptOpenJDK that are relevant to New Relic. Our services and backend is pretty much all Java and Kotlin so we have a key strategic interest in the success of the project. So at one level it's no more complicated than the familiar: "Contribute to what matters to you" mantra of open source.

In terms of what New Relic contributes to the project Evans told me that

>As New Relic is an Observability company, it's probably no surprise that we're interested in anything that intersects our business. So, we're interested in things like Java Flight Recorder (JFR) and innovations in serviceability. We are also very interested in performance improvements and avoiding regressions - both for customers and for our own high-performance services.

>For example, when we transitioned to using AdoptOpenJDK last year, we had a programme of chasing down and fully investigating every performance regression that was reported when moving from Oracle to OpenJDK. From our knowledge of how the OpenJDK project works we were basically sure that any regressions should be false positives, but our approach was very much "Trust But Verify". As you might hope, we were able to prove that all the reports were false positives and there were no real regressions caused by the upgrade to OpenJDK.

>It's not a very glamorous example, but sometimes making more perfect software requires detailed, meticulous work. Developers and teams need the confidence when upgrading that their systems won't break or regress in subtle ways. We're happy to do our bit to help provide that confidence for our customers, ourselves, and the whole community.