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

Add OpenTelemetry layer as optional #898

Merged
merged 1 commit into from
Jun 26, 2024
Merged

Conversation

calavera
Copy link
Contributor

Issue #, if available:

Closes #866

Description of changes:

  • Add the OpenTelemetryLayer as an optional module to the runtime.
  • Fixes issue creating multiple spans instead of assigning one as parent.

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

Signed-off-by: David Calavera <david.calavera@gmail.com>
@calavera calavera requested a review from bnusunny June 25, 2024 22:05
@calavera calavera merged commit f484569 into main Jun 26, 2024
7 checks passed
@calavera calavera deleted the optional_open_telemetry branch June 26, 2024 02:07
Comment on lines +76 to +78
// Enter the span before calling the inner service
// to ensure that it's assigned as parent of the inner spans.
let _guard = span.enter();
Copy link
Contributor

@Oliboy50 Oliboy50 Jun 26, 2024

Choose a reason for hiding this comment

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

I didn't know that using .instrument(span) was not enough when calling a future (or maybe it's only useful in a "inner service" context?), where did you find docs about that?

And since the span is entered before starting to poll the future, it will increase the span duration, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See this PR: #896

Copy link
Contributor

@Oliboy50 Oliboy50 Jun 26, 2024

Choose a reason for hiding this comment

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

line 67:

{ traceconv::FAAS_TRIGGER } = "http",

I think it should be configurable because the lambda_runtime crate can be used without using HTTP triggers (it could defaults to http when using the lambda_http crate though)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that sounds like a good idea. Feel free to open a PR with improvements

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 ➡️ #903

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.

Add OpenTelemetryLayer to lambda_runtime layers
3 participants