Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update Azure Functions Detector to Only Detect When Function Version is Defined #1846

Merged

Conversation

JacksonWeber
Copy link
Contributor

@JacksonWeber JacksonWeber commented Dec 4, 2023

Which problem is this PR solving?

Azure Functions Detector should only detect Azure Functions when the function version is set. Currently it is erroneously detecting functions when in app service.

@JacksonWeber JacksonWeber requested a review from a team December 4, 2023 22:02
@github-actions github-actions bot requested a review from hectorhdzg December 4, 2023 22:02
@trentm
Copy link
Contributor

trentm commented Dec 4, 2023

Notes to self:

Currently it is erroneously detecting functions when in app service.

"Azure App Service" is a base service for a number of Azure services, of which Azure Functions is one. So the presence of the WEBSITE_SITE_NAME envvar is not sufficient to identify this as being an Azure Function.

Docs on envvars in App Service here: https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings
And the subset of envvars in Azure Functions here: https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#functions

Copy link
Member

@hectorhdzg hectorhdzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Merging #1846 (d30c964) into main (094fd6f) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1846   +/-   ##
=======================================
  Coverage   91.49%   91.49%           
=======================================
  Files         144      144           
  Lines        7388     7388           
  Branches     1474     1474           
=======================================
  Hits         6760     6760           
  Misses        628      628           
Files Coverage Δ
...ctor-azure/src/detectors/AzureFunctionsDetector.ts 100.00% <100.00%> (ø)

@trentm trentm merged commit 8f2a195 into open-telemetry:main Dec 6, 2023
13 checks passed
@dyladan dyladan mentioned this pull request Dec 6, 2023
trentm pushed a commit to trentm/opentelemetry-js-contrib that referenced this pull request Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants