Vijay Pratap Singh

Vijay Pratap Singh

  • 343
  • 5k
  • 466.8k

Azure Function New Relic APM Service Failing to Create

Nov 14 2024 5:45 AM

I'm working with an Azure Function using the in-process model, configured with .NET 8 and Function version 4. I've set up Serilog for New Relic ingestion, and logs are being received successfully. However, the New Relic APM service is not being created. Could someone clarify if migrating the Azure Function from the in-process model to the isolated model is required 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 new 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();
}

Thanks


Answers (1)