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

[Instrumentation.AWSLambda] Incoming FaaS Span attributes: detect and set attribute for cold start #2037

Conversation

rypdal
Copy link
Contributor

@rypdal rypdal commented Sep 3, 2024

Fixes #
Design discussion issue #

Changes

Please provide a brief description of the changes here.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@rypdal rypdal requested a review from a team September 3, 2024 15:10
@github-actions github-actions bot requested review from Oberon00 and ppittle September 3, 2024 15:10
@github-actions github-actions bot added the comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda label Sep 3, 2024
Copy link

codecov bot commented Sep 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.77%. Comparing base (71655ce) to head (4c9503b).
Report is 399 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2037      +/-   ##
==========================================
+ Coverage   73.91%   75.77%   +1.85%     
==========================================
  Files         267       20     -247     
  Lines        9615      227    -9388     
==========================================
- Hits         7107      172    -6935     
+ Misses       2508       55    -2453     
Flag Coverage Δ
unittests-Instrumentation.AWS 75.77% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 277 files with indirect coverage changes

Copy link
Contributor

@Kielek Kielek left a comment

Choose a reason for hiding this comment

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

LGTM.
Consider if any tests needs to be added/extended.

var functionTags = AWSLambdaUtils.GetFunctionTags(input, context);
// No parallel invocation of the same lambda handler.
bool faasColdStart = isColdStart;
if (faasColdStart)
Copy link
Member

Choose a reason for hiding this comment

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

The if can be removed, it's fine to unconditionally set it to false here. Then we also might not need the local variable if you change it after calculating functionTags

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can do it. I removed the local variable and moved setting of the internal one after the calculation of functionTags.

@Oberon00
Copy link
Member

Oberon00 commented Sep 4, 2024

Yes, this should be unit-testable, please add or extend one to verify the coldstart attribute going from true on the first call to false on subsequent ones.

@rypdal
Copy link
Contributor Author

rypdal commented Sep 4, 2024

LGTM. Consider if any tests needs to be added/extended.

I added test for the cold start tag check.

@Kielek
Copy link
Contributor

Kielek commented Sep 4, 2024

One more thing, please extend changelog.

@rypdal
Copy link
Contributor Author

rypdal commented Sep 4, 2024

One more thing, please extend changelog.

changelog has been updated.

@Kielek Kielek merged commit 0691810 into open-telemetry:main Sep 4, 2024
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.awslambda Things related to OpenTelemetry.Instrumentation.AWSLambda
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants