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
(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

Jayraj ChhayaPosted Nov 15, 2024, 6:54 AM
To enable New Relic APM services for your Azure Function, migrating from the in-process model to the isolated model is indeed recommended. The isolated model provides better support for APM integrations, including New Relic, as it allows for more granular control over the application lifecycle and dependencies.
In your current setup, ensure that the necessary environment variables are correctly configured, particularly
NEW_RELIC_LICENSE_KEYandNEW_RELIC_APP_NAME. If these are not set, the APM service will not initialize properly.Here’s a sample of how to register Serilog with New Relic:
By transitioning to the isolated model and ensuring proper configuration, you should be able to successfully create the New Relic APM service for your Azure Function.