DataDog / datadog-aas-extension

Datadog Azure App Services Site Extension
Apache License 2.0
9 stars 12 forks source link

Extension/DDstatsd not working with AppService webjobs to submit custome metrics. #48

Closed benzhou closed 2 years ago

benzhou commented 3 years ago

Hi, we installed the extension in Azure AppService, it worked for App Services to emit custom metrics, however, when we trying to emit custom metrics in a web job hosted in the same App Service, there was an error saying config.StatsdServerName and DD_AGENT_HOST environment variable not set. Upon further investigation, it appears the Datadog Azure App Service is using named pipe for the client SDK to connect to the DogStatsd agent. But not sure if how to configure the client in an App Service web job.

colin-higgins commented 3 years ago

Hi @benzhou There are two separate contexts the applicationHost transforms are applied in. The web jobs run within the SCM context, which does not have any of the environment variables set which are needed for custom metrics.

Theoretically, you could set the pipe name variable in your web job to match what is in the applicationHost.xdt file.

We will look into supporting this scenario in the future.

colin-higgins commented 2 years ago

@benzhou This is resolved in https://github.com/DataDog/datadog-aas-extension/releases/tag/dotnet-v1.9.0

Thanks for opening the issue.