faas icon indicating copy to clipboard operation
faas copied to clipboard

feat: add OTEL tracing span middleware during function proxy

Open LucasRoesler opened this issue 4 years ago • 3 comments

Description

Add tracing package the standardizes an OpenTelemetry tracing initialization and Middleware that can be applied to the Gateway handlers.

Add the tracing middleware to the function proxy handler only.

Requires new env variables to be enabled, it is otherwise a no-op.

Motivation and Context

  • [x] I have raised an issue to propose this change (required)
  • [ ] My issue has received approval from the maintainers or lead with the design/approved label

Resolves #1684

How Has This Been Tested?

Manually tested by using the tracing walkthrough https://github.com/LucasRoesler/openfaas-tracing-walkthrough but modifying the Gateway image to a locally built image from this branch

image

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I've read the CONTRIBUTION guide
  • [x] I have signed-off my commits with git commit -s
  • [ ] I have added tests to cover my changes.
  • [x] All new and existing tests passed.

LucasRoesler avatar Dec 20 '21 09:12 LucasRoesler

@alexellis one thing that I did not include in this is the automated scraping of node details when in EKS, i wasn't sure what if any vendors we wanted to support

however, i do have an example here https://github.com/contiamo/go-base/blob/1dfd553de6d3b2da34a247991b609c67d7fc6659/pkg/otel/tracing/provider.go#L121-L132 of the changes that would be required to support EKS and integrating with x-ray

LucasRoesler avatar Feb 11 '22 15:02 LucasRoesler

Is there any progress in this task? thank you

berylshow avatar May 05 '22 10:05 berylshow

@berylshow it is currently stuck, @alexellis has asked the community for some input on use cases to gauge interest in the feature before we merge it.

LucasRoesler avatar May 05 '22 11:05 LucasRoesler