KrakenD Enterprise 2.0 released! Read the Release notes »

Documentation

Recent changes

New Relic integration

New Relic integration

The New Relic integration lets you push KrakenD metrics and traces to your New Relic dashboard. The integration is now an extension of the opencensus module. Prior New Relic integrations using custom builds of KrakenD Enterprise are not compatible or related to this configuration.

Configuration

The following configuration snippet sends data to your New Relic:

{
    "extra_config": {
        "telemetry/opencensus": {
            "exporters": {
                "extra_config": {
                    "newrelic": {
                        "service_name": "krakend-api-gateway",
                        "api_key": "XXXX",
                        "timeout": "15s",
                        "spans_url": "https://trace-api.newrelic.com/trace/v1",
                        "metrics_url": "https://metric-api.newrelic.com/metric/v1",
                        "debug": false
                    }
                }
            }
    }
}
  • service_name(string) The service name as shown in the New Relic dashboard.
  • api_key (string) The API key provided by New Relic to push data into your account.
  • timeout (duration) The maximum time KrakenD will wait before canceling a report batch to New Relic when not responding. Defaults to 15s.

Optional fields:

  • spans_url (string - optional): New Relic might use different endpoints to report traces from its customers depending on the location of their accounts. When this field is not declared, the spans_url defaults to https://trace-api.newrelic.com/trace/v1 (US accounts)
  • metrics_url (string - optional): New Relic might use different endpoints to report metrics from its customers depending on the location of their accounts. When this field is not declared, the metrics_url defaults to https://metric-api.newrelic.com/metric/v1 (US accounts).
  • debug (boolean - optional): Set to true when setting New Relic for the first time, and you want to see the logs of the exporter activity. Set to false in production.

In addition, the opencensus settings module can be declared.

Configuration for European accounts

When using New Relic accounts based in the EU, you will need to set a different URL for the spans and metrics.

{
    "spans_url": "https://trace-api.eu.newrelic.com/trace/v1",
    "metrics_url": "https://metric-api.eu.newrelic.com/metric/v1"
}

Your configuration for EU will look like this:

{
    "extra_config": {
        "telemetry/opencensus": {
            "exporters": {
                "extra_config": {
                    "newrelic": {
                        "service_name": "krakend-api-gateway",
                        "api_key": "XXXX",
                        "timeout": "15s",
                        "spans_url": "https://trace-api.eu.newrelic.com/trace/v1",
                        "metrics_url": "https://metric-api.eu.newrelic.com/metric/v1",
                        "debug": false
                    }
                }
            }
        }
    }
}

Troubleshooting

If you don’t see reports in your New Relic account after sending activity to KrakenD, enable the debug flag locally to see what is going on. The logs will show information to help you understand what is going on.

The logger should be configured with a DEBUG level to see these messages.

Typical problems might be:

  • Your API Key is not properly set
  • Your API Key is of the wrong type
  • You are pushing data to the wrong endpoint (you’ll see 403 errors in the debug). You might be using an account from the EU, but the endpoint is from US or similar.

Getting your API Key from New Relic

  1. Go to your account, and select API keys Setting an API Key
  2. In the API keys screen, select Create a key Setting an API Key
  3. Select the Key type Ingest - License from the dropdown and create the key Setting an API Key
  4. Copy the resulting API key into the configuration.

The screenshots and options above might change as a result of New Relic redesigns.

Unresolved issues?

The documentation is only a piece of the help you can get! Whether you are looking for Open Source or Enterprise support, see more support channels that can help you.

We use cookies to understand how you use our site and to improve your overall experience. By continuing to use our site, you accept our Privacy Policy. More information