Skip to content

Add trace convenience function that encapsulates try-catch-finally boilerplate code#841

Merged
brettmc merged 2 commits into
open-telemetry:mainfrom
Nevay:feature/trace-convenience-function
Oct 10, 2022
Merged

Add trace convenience function that encapsulates try-catch-finally boilerplate code#841
brettmc merged 2 commits into
open-telemetry:mainfrom
Nevay:feature/trace-convenience-function

Conversation

@Nevay

@Nevay Nevay commented Oct 9, 2022

Copy link
Copy Markdown
Contributor

Encapsulates the try-catch-finally boilerplate code, especially useful for decorators.

$span = $this->tracer
    ->spanBuilder('example')
    ->startSpan();
return trace($span, $decorated->method(...), func_get_args());

@Nevay
Nevay requested a review from a team October 9, 2022 23:22
@Nevay
Nevay force-pushed the feature/trace-convenience-function branch from 9a49a9d to 78e10eb Compare October 9, 2022 23:29
@Nevay
Nevay force-pushed the feature/trace-convenience-function branch from ef0003c to 8c4e666 Compare October 10, 2022 16:42
@brettmc
brettmc merged commit 47f8ab9 into open-telemetry:main Oct 10, 2022
@Nevay
Nevay deleted the feature/trace-convenience-function branch April 19, 2023 19:11
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.

2 participants