New Relic Integration

This article is a continuation of Monitoring Streaming Tenants. Please read that article first to understand the fundamentals of what resources are being used.

According to the New Relic documentation, there are 3 different ways to integrate external Prometheus data into New Relic:

Options 1 and 2 are not relevant for Astra Streaming, so option 3 is the only possible solution. Option 3 would require modifying the configuration of the Prometheus server which Astra Streaming relies on, but due to the managed-service nature of Astra Streaming, this is not possible. Instead, an extra Prometheus server can be installed (per the instructions in External Prometheus and Grafana Integration) to act as a bridge to forward scraped Astra Streaming metrics to New Relic. The diagram below shows this idea:

Map
External Prometheus server for New Relic integration

Prerequisites

  • Set up a New Relic account

  • When creating a New Relic account, it will generate a license key. Save this key to a local file for usage in later steps.

Configure New Relic

  1. Log in the New Relic UI with your account.

  2. Click “Add Data” and select “Prometheus Remote Write Integration” under the “Open source monitoring” category.

  3. In the new window, supply the name of your local Prometheus server (e.g. prometheus-docker-desktop) and click “Generate URL”. This generates the URL endpoints required for configuring “remote_write integration” on your local Prometheus server.

  4. Configure and restart your local Prometheus server. In this example, since the local Prometheus server is installed in a local docker-desktop K8s cluster, the installation and configuration method is K8s-oriented.

    1. Create a K8s secret that corresponds to the New Relic license key that you received when setting up the account:

      kubectl create secret generic nr-license-key --from-literal=value=<license_key_value>
    2. Modify the Prometheus configuration in the kube-prometheus-stack Helm chart file (e.g. custom-values.yaml).

      prometheus:
         prometheusSpec:
            scrapeInterval: 60s
            evaluationInterval: 15s
            additionalScrapeConfigsSecret:
            enabled: true
               name: astra-msgenrich
               key: astra-msgenrich.yml
      
            remoteWrite:
              - url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=prometheus-docker-desktop
                 authorization:
                    credentials:
                       key: value
              	   name: nr-license-key

      The top section of this configuration is for scraping Astra Streaming metrics (as described in External Prometheus and Grafana Integration) and the bottom section is for sending local Prometheus metrics to New Relic via remote_write. The remote_write URL and authorization settings are described above.

  5. Restart your local Prometheus server.

  6. Return to the New Relic UI. If everything is set up correctly, you should see Astra Streaming metrics in New Relic UI. Below is a screenshot from New Relic data browsing UI in which we can see the Pulsar message backlog metrics are shown on the UI and aggregated by different Pulsar namespaces.

Metrics
Pulsar message backlog metrics in New Relic

What’s next?

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com