Azure function New Relic APM Service Not Creating

Vijay Pratap Singh 0 Reputation points
2024-11-18T10:00:32.17+00:00

I'm working with an Azure Function using the in-process model, configured with .NET 8 and Function version 4. I've implemented Serilog with New Relic ingestion and am successfully receiving logs. However, the APM service isn't being created in New Relic. Could someone clarify if migrating the Azure Function from the in-process model to the isolated model is necessary to enable New Relic APM services?

    "CORECLR_ENABLE_PROFILING": "1",
"CORECLR_PROFILER": "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}",
"CORECLR_PROFILER_PATH": "",
"CORECLR_NEWRELIC_HOME": "",
"NEW_RELIC_LICENSE_KEY": "",
"NEW_RELIC_APP_NAME": "",
"NEW_RELIC_APPLICATION_LOGGING_ENABLED": ""

Register serilog with rew relic

public static void RegisterSerilog(AppSettings settings)
{ 
// Set up Serilog configuration
Log.Logger = new LoggerConfiguration()
    .MinimumLevel.Is(Enum.Parse<LogEventLevel> 
(settings.LoggerSettings.NewRelicSettings.MinimumLogLevel, true)) // Read log 
 level from settings
    .Enrich.FromLogContext()
    .Enrich.WithNewRelicLogsInContext()
    .WriteTo.NewRelicLogs( // Write to New Relic Logs
        endpointUrl: settings.LoggerSettings.NewRelicSettings.EndpointUrl,
        applicationName: settings.LoggerSettings.NewRelicSettings.ApplicationName,
        licenseKey: settings.LoggerSettings.NewRelicSettings.LicenseKey)
    .CreateLogger();
}
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 5,600 Reputation points Microsoft Employee Volunteer Moderator
    2024-11-20T09:37:24.38+00:00

    Hello @Vijay Pratap Singh

    Based on the provided document, it seems that migrating the Azure Function from the in-process model to the isolated model is not necessary to enable New Relic APM services.

    However, there could be other reasons why the APM service is not being created in New Relic.

    One thing you can check is whether the required environment variables are properly set up. The environment variables that need to be set up for New Relic APM services are:

    • CORECLR_ENABLE_PROFILING
    • CORECLR_PROFILER
    • CORECLR_PROFILER_PATH
    • CORECLR_NEWRELIC_HOME
    • NEW_RELIC_LICENSE_KEY
    • NEW_RELIC_APP_NAME

    You can also try to check if the New Relic agent is properly installed and configured in your Azure Function.

    You can refer to the following documentation for more information on how to troubleshoot New Relic APM services: Azure Functions Workflow service through Azure Monitor integration

    I hope this helps.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.