[SVLS-6337] Don't spawn agent process if DD_AZURE_RESOURCE_GROUP not set for Azure flex consumption functions#31
Conversation
…n that doesn't have DD_AZURE_RESOURCE_GROUP set
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. |
duncanpharvey
left a comment
There was a problem hiding this comment.
Looks good just one nit!
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
kathie.huang@datadoghq.com cancelled this merge request build |
|
/remove |
|
View all feedbacks in Devflow UI.
|
What does this PR do?
Adds a check to see if we are in an Azure function that is on the flex consumption plan and doesn't have the
DD_AZURE_RESOURCE_GROUPenv var set. If so, return before the agent process can be spawned.Motivation
aas.resource.groupspan attribute for functions on flex consumption plans is set incorrectly in Datadog - they're all set to "flex"aas.resource.idis built usingaas.resource.group, and the resource id is used in billing, which needs to be accurateDD_AZURE_RESOURCE_GROUPenv var. Rather than handling that inlibdatadog, we decided to do it at a higher level in the trace agent to inform the customer of the error while shutting down the trace agent gracefully and preventing any traces from being sent to Datadog, as well as adding this in the serverless-compat layers to have defense in depthJira Ticket
Describe how to test/QA your changes
everywhere that
libdatadogis used to the most recent commit hash of the PR in libdatadog (currentlyd1b35ef21fff3c4588073504905081c8923bbc4b)use_serverless_compat_local_pathto true and making sure the built binary is in yourpythonfolderDD_AZURE_RESOURCE_GROUPenv var, you should see no tracesDD_AZURE_RESOURCE_GROUPas an environment variable with your resource group. Repeat step 4, you should see the correct resource group in theresource.groupspan attribute!