Skip to content

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

Merged
Kielek merged 5 commits into
open-telemetry:mainfrom
rypdal:feature/detect-and-set-attribute-for-cold-start
Sep 4, 2024
Merged

[Instrumentation.AWSLambda] Incoming FaaS Span attributes: detect and set attribute for cold start#2037
Kielek merged 5 commits into
open-telemetry:mainfrom
rypdal:feature/detect-and-set-attribute-for-cold-start

Conversation

@rypdal

@rypdal rypdal commented Sep 3, 2024

Copy link
Copy Markdown
Contributor

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
@codecov

codecov Bot commented Sep 3, 2024

Copy link
Copy Markdown

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

@Kielek Kielek left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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

Oberon00 commented Sep 4, 2024

Copy link
Copy Markdown
Member

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

rypdal commented Sep 4, 2024

Copy link
Copy Markdown
Contributor Author

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

I added test for the cold start tag check.

@Kielek

Kielek commented Sep 4, 2024

Copy link
Copy Markdown
Member

One more thing, please extend changelog.

@rypdal

rypdal commented Sep 4, 2024

Copy link
Copy Markdown
Contributor Author

One more thing, please extend changelog.

changelog has been updated.

Comment thread src/OpenTelemetry.Instrumentation.AWSLambda/CHANGELOG.md Outdated
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
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