apm-agent-dotnet icon indicating copy to clipboard operation
apm-agent-dotnet copied to clipboard

Make sure the service.environment is always set

Open gregkalapos opened this issue 4 years ago • 1 comments

  • When Microsoft.Extensions.Configuration.IConfiguration is passed (e.g. ASP.NET Core) we read builder.ApplicationServices.GetEnvironmentName()
  • On ASP.NET classic we actually pass null
  • The EnvironmentConfigurationReader (which is the default one if you don't configure the agent) also returns null.

Task:

  • make sure service.environment is always set to a default, which is production
  • make sure this is also covered in the docs.

gregkalapos avatar Sep 17 '20 10:09 gregkalapos

To resolve this, should

  1. FullFrameworkConfigReader pass a value of production for defaultEnvironmentName in the call to the base ctor?

or

  1. AbstractConfigurationReader return production when kv inside ParseEnvironment is null (which would be inherited by EnvironmentConfigurationReader) ?

russcam avatar Nov 16 '20 06:11 russcam