Repository: fission/fission
Pull request #2484 (2022-07-13 07:42:25)

Upgrade Opentelemetry Libraries and adopt enhancements
1. Use websocket support introduced in Openetelemetry Librarries
2. Use propagators settings introduced in Opentelemetry Go SDK
3. Use samplers settings introduced in Openetelemetry Go SDK

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

<!--  Thanks for sending a pull request! We request you provide detailed description as much as possible. -->

## Description
<!--- Describe your changes in detail. -->
<!-- Typically try to give details of what, why and how of the PR changes. -->

## Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #

## Testing
<!--- Please describe in detail how you tested your changes. -->

## Checklist:
<!-- Please tick following checkboxes as per your understanding. -->
- [ ] I ran tests as well as code linting locally to verify my changes. 
- [ ] I have done manual verification of my changes, changes working as expected.
- [ ] I have added new tests to cover my changes.
- [ ] My changes follow contributing guidelines of Fission.
- [ ] I have signed all of my commits.


codecov[bot]: # [Codecov](https://codecov.io/gh/fission/fission/pull/2484?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission) Report
> Merging [#2484](https://codecov.io/gh/fission/fission/pull/2484?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission) (f2e2119) into [master](https://codecov.io/gh/fission/fission/commit/1abe4dadb78d9815539fdc272acab38e8d748607?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission) (1abe4da) will **decrease** coverage by `0.43%`.
> The diff coverage is `0.00%`.

```diff
@@            Coverage Diff             @@
##           master    #2484      +/-   ##
==========================================
- Coverage   19.23%   18.80%   -0.44%     
==========================================
  Files          62       62              
  Lines        6836     6765      -71     
==========================================
- Hits         1315     1272      -43     
+ Misses       5418     5391      -27     
+ Partials      103      102       -1     
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `18.80% <0.00%> (-0.44%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/fission/fission/pull/2484?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission) | Coverage Δ | |
|---|---|---|
| [pkg/router/functionHandler.go](https://codecov.io/gh/fission/fission/pull/2484/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission#diff-cGtnL3JvdXRlci9mdW5jdGlvbkhhbmRsZXIuZ28=) | `11.02% <0.00%> (+0.10%)` | :arrow_up: |
| [pkg/utils/otel/provider.go](https://codecov.io/gh/fission/fission/pull/2484/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission#diff-cGtnL3V0aWxzL290ZWwvcHJvdmlkZXIuZ28=) | `21.62% <0.00%> (-21.95%)` | :arrow_down: |
| [pkg/utils/httpserver/server.go](https://codecov.io/gh/fission/fission/pull/2484/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission#diff-cGtnL3V0aWxzL2h0dHBzZXJ2ZXIvc2VydmVyLmdv) | `66.66% <0.00%> (+11.11%)` | :arrow_up: |

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. [Learn more](https://about.codecov.io/product/feature/runtime-insights/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission)


Patch:
diff --git a/charts/fission-all/values.yaml b/charts/fission-all/values.yaml
index a07a0fa6..1e67339b 100644
--- a/charts/fission-all/values.yaml
+++ b/charts/fission-all/values.yaml
@@ -662,6 +662,7 @@ openTelemetry:
   ## parentbased_always_on - (default if empty) Sampler that respects its parent span's sampling decision, but otherwise always samples.
   ## parentbased_always_off - Sampler that respects its parent span's sampling decision, but otherwise never samples.
   ## parentbased_traceidratio - Sampler that respects its parent span's sampling decision, but otherwise samples probabalistically based on rate.
+  ## See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#general-sdk-configuration
   ##
   tracesSampler: "parentbased_traceidratio"
   ## Each Sampler type defines its own expected input, if any.
@@ -679,6 +680,8 @@ openTelemetry:
   ## jaeger - Jaeger uber-trace-id header
   ## xray - AWS X-Ray (third party)
   ## ottrace - OpenTracing Trace (third party)
+  ## none - No tracing
+  ## See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#general-sdk-configuration
   ##
   propagators: "tracecontext,baggage"
 
diff --git a/go.mod b/go.mod
index ce42fafa..af63cb62 100644
--- a/go.mod
+++ b/go.mod
@@ -32,18 +32,15 @@ require (
 	github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
 	github.com/spf13/cobra v1.4.0
 	github.com/spf13/pflag v1.0.5
-	github.com/stretchr/testify v1.7.1
+	github.com/stretchr/testify v1.8.0
 	github.com/wcharczuk/go-chart v2.0.1+incompatible
-	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0
-	go.opentelemetry.io/contrib/propagators/aws v1.7.0
-	go.opentelemetry.io/contrib/propagators/b3 v1.7.0
-	go.opentelemetry.io/contrib/propagators/jaeger v1.7.0
-	go.opentelemetry.io/contrib/propagators/ot v1.7.0
-	go.opentelemetry.io/otel v1.7.0
-	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0
-	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0
-	go.opentelemetry.io/otel/sdk v1.7.0
-	go.opentelemetry.io/otel/trace v1.7.0
+	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0
+	go.opentelemetry.io/contrib/propagators/autoprop v0.33.0
+	go.opentelemetry.io/otel v1.8.0
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.8.0
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.8.0
+	go.opentelemetry.io/otel/sdk v1.8.0
+	go.opentelemetry.io/otel/trace v1.8.0
 	go.uber.org/zap v1.21.0
 	golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e
 	google.golang.org/grpc v1.47.0
@@ -89,7 +86,7 @@ require (
 	github.com/eapache/queue v1.1.0 // indirect
 	github.com/emirpasic/gods v1.12.0 // indirect
 	github.com/evanphx/json-patch v4.12.0+incompatible // indirect
-	github.com/felixge/httpsnoop v1.0.2 // indirect
+	github.com/felixge/httpsnoop v1.0.3 // indirect
 	github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
 	github.com/go-git/gcfg v1.5.0 // indirect
 	github.com/go-git/go-billy/v5 v5.3.1 // indirect
@@ -151,9 +148,12 @@ require (
 	github.com/ulikunitz/xz v0.5.9 // indirect
 	github.com/xanzy/ssh-agent v0.3.0 // indirect
 	github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
-	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0 // indirect
-	go.opentelemetry.io/otel/internal/metric v0.27.0 // indirect
-	go.opentelemetry.io/otel/metric v0.27.0 // indirect
+	go.opentelemetry.io/contrib/propagators/aws v1.8.0 // indirect
+	go.opentelemetry.io/contrib/propagators/b3 v1.8.0 // indirect
+	go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 // indirect
+	go.opentelemetry.io/contrib/propagators/ot v1.8.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.8.0 // indirect
+	go.opentelemetry.io/otel/metric v0.31.0 // indirect
 	go.opentelemetry.io/proto/otlp v0.18.0 // indirect
 	go.uber.org/atomic v1.9.0 // indirect
 	go.uber.org/multierr v1.8.0 // indirect
diff --git a/go.sum b/go.sum
index 88eb0ac4..e5bd9141 100644
--- a/go.sum
+++ b/go.sum
@@ -235,8 +235,8 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv
 github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
 github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
 github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
-github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o=
-github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
+github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
+github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
 github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
 github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
 github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c=
@@ -726,14 +726,16 @@ github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH
 github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
 github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
 github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
 github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
 github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
@@ -783,44 +785,41 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
 go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc=
 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E=
 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0 h1:SLme4Porm+UwX0DdHMxlwRt7FzPSE0sys81bet2o0pU=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0/go.mod h1:tLYsuf2v8fZreBVwp9gVMhefZlLFZaUiNVSq8QxXRII=
-go.opentelemetry.io/contrib/propagators/aws v1.7.0 h1:hzLtX+K4YhsrBabA35uBYxCENb5rS/9Z9X8MToTlA3k=
-go.opentelemetry.io/contrib/propagators/aws v1.7.0/go.mod h1:h/ql5T6e1XLRFplWNNdzLHp8eb0dkBu+xYOCYxerh0Q=
-go.opentelemetry.io/contrib/propagators/b3 v1.7.0 h1:oRAenUhj+GFttfIp3gj7HYVzBhPOHgq/dWPDSmLCXSY=
-go.opentelemetry.io/contrib/propagators/b3 v1.7.0/go.mod h1:gXx7AhL4xXCF42gpm9dQvdohoDa2qeyEx4eIIxqK+h4=
-go.opentelemetry.io/contrib/propagators/jaeger v1.7.0 h1:x2mXKtONfOJFfNFSx4QXFx1fms6bKIPVvWvgdiaPdRI=
-go.opentelemetry.io/contrib/propagators/jaeger v1.7.0/go.mod h1:kt2lNImfxV6dETRsDCENd6jU6G0mPRS+P0qlNuvtkTE=
-go.opentelemetry.io/contrib/propagators/ot v1.7.0 h1:KPPToDRxyY/HI3qD4RqwWRbaQ65RIpF8uKWDqWkFHDA=
-go.opentelemetry.io/contrib/propagators/ot v1.7.0/go.mod h1:5qxBZR730yb71uXc3bazxt2Si8o8LQK3iJTnSLca/BU=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M=
+go.opentelemetry.io/contrib/propagators/autoprop v0.33.0 h1:vYrciMtw1n9n7OeZ3OF51fORYEGjfHXt7JSbSmgxJsg=
+go.opentelemetry.io/contrib/propagators/autoprop v0.33.0/go.mod h1:m1BVaXLEU1iSomaBqQ0tGcEfAQVMD6FI7yGLq5h4rIA=
+go.opentelemetry.io/contrib/propagators/aws v1.8.0 h1:Ky4pY6IKdGPPSEv/ffkA1/LRBIpz4ohhuOhrk545YQk=
+go.opentelemetry.io/contrib/propagators/aws v1.8.0/go.mod h1:0ptHDgrpjxekjXayHNG0fTUdFnehgJVQlDk4P7hfDKM=
+go.opentelemetry.io/contrib/propagators/b3 v1.8.0 h1:l6+IOjo7VzRWuYeKM/uDUkKOQvG22jDV3l8zs9+f1w0=
+go.opentelemetry.io/contrib/propagators/b3 v1.8.0/go.mod h1:fqKNRj1Bkecfq8v1T1H0q5di1ZHZK8fuSNpVn56tlAU=
+go.opentelemetry.io/contrib/propagators/jaeger v1.8.0 h1:Qmaw0Uwaw+iRL4U8eU+gP07xctL1IfXxvZH7Hy72rIE=
+go.opentelemetry.io/contrib/propagators/jaeger v1.8.0/go.mod h1:uC5cTyLIJO4cZXDdx2QE/BMhO4NCUua9pXmF5F5VMP0=
+go.opentelemetry.io/contrib/propagators/ot v1.8.0 h1:LJRQci6KUNa6Rtcn27c0QX0B3d10HSyrTt+sAYyBvnU=
+go.opentelemetry.io/contrib/propagators/ot v1.8.0/go.mod h1:xjICLXWlvu139XAY2jAchS8bFGN2MKIUMXZCzKrRFf0=
 go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo=
-go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk=
-go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM=
-go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
+go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg=
+go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM=
 go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM=
-go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0 h1:7Yxsak1q4XrJ5y7XBnNwqWx9amMZvoidCctv62XOQ6Y=
-go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0/go.mod h1:M1hVZHNxcbkAlcvrOMlpQ4YOO3Awf+4N2dxkZL3xm04=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0 h1:cMDtmgJ5FpRvqx9x2Aq+Mm0O6K/zcUkH73SFz20TuBw=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0/go.mod h1:ceUgdyfNv4h4gLxHR0WNfDiiVmZFodZhZSbOLhpxqXE=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0 h1:MFAyzUPrTwLOwCi+cltN0ZVyy4phU41lwH+lyMyQTS4=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0/go.mod h1:E+/KKhwOSw8yoPxSSuUHG6vKppkvhN+S1Jc7Nib3k3o=
-go.opentelemetry.io/otel/internal/metric v0.27.0 h1:9dAVGAfFiiEq5NVB9FUJ5et+btbDQAUIJehJ+ikyryk=
-go.opentelemetry.io/otel/internal/metric v0.27.0/go.mod h1:n1CVxRqKqYZtqyTh9U/onvKapPGv7y/rpyOTI+LFNzw=
+go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.8.0 h1:ao8CJIShCaIbaMsGxy+jp2YHSudketpDgDRcbirov78=
+go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.8.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.8.0 h1:LrHL1A3KqIgAgi6mK7Q0aczmzU414AONAGT5xtnp+uo=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.8.0/go.mod h1:w8aZL87GMOvOBa2lU/JlVXE1q4chk/0FX+8ai4513bw=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.8.0 h1:00hCSGLIxdYK/Z7r8GkaX0QIlfvgU3tmnLlQvcnix6U=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.8.0/go.mod h1:twhIvtDQW2sWP1O2cT1N8nkSBgKCRZv2z6COTTBrf8Q=
 go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU=
-go.opentelemetry.io/otel/metric v0.27.0 h1:HhJPsGhJoKRSegPQILFbODU56NS/L1UE4fS1sC5kIwQ=
-go.opentelemetry.io/otel/metric v0.27.0/go.mod h1:raXDJ7uP2/Jc0nVZWQjJtzoyssOYWu/+pjZqRzfvZ7g=
+go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs=
+go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A=
 go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw=
 go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc=
-go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0=
-go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU=
+go.opentelemetry.io/otel/sdk v1.8.0 h1:xwu69/fNuwbSHWe/0PGS888RmjWY181OmcXDQKu7ZQk=
+go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c=
 go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE=
 go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE=
 go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw=
-go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE=
-go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o=
-go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU=
+go.opentelemetry.io/otel/trace v1.8.0 h1:cSy0DF9eGI5WIfNwZ1q2iUyGj00tGzP24dE1lOlHrfY=
+go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4=
 go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
-go.opentelemetry.io/proto/otlp v0.16.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
 go.opentelemetry.io/proto/otlp v0.18.0 h1:W5hyXNComRa23tGpKwG+FRAc4rfF6ZUg1JReK+QHS80=
 go.opentelemetry.io/proto/otlp v0.18.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
 go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
@@ -830,7 +829,6 @@ go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
 go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
 go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
 go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA=
-go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
 go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
 go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
 go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=
@@ -1050,7 +1048,6 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -1293,7 +1290,6 @@ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD
 google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
 google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
 google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
-google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
 google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8=
 google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
diff --git a/pkg/router/functionHandler.go b/pkg/router/functionHandler.go
index fb288fc7..4f6a7553 100644
--- a/pkg/router/functionHandler.go
+++ b/pkg/router/functionHandler.go
@@ -39,7 +39,6 @@ import (
 	ferror "github.com/fission/fission/pkg/error"
 	"github.com/fission/fission/pkg/error/network"
 	executorClient "github.com/fission/fission/pkg/executor/client"
-	"github.com/fission/fission/pkg/router/util"
 	"github.com/fission/fission/pkg/throttler"
 	"github.com/fission/fission/pkg/utils"
 	otelUtils "github.com/fission/fission/pkg/utils/otel"
@@ -318,39 +317,22 @@ func (roundTripper *RetryingRoundTripper) RoundTrip(req *http.Request) (*http.Re
 			dumpReqFunc(newReq)
 		}
 
-		// The otelhttp.NewTransport() does not work with WebSocket.
-		// This is probably because it modifies the response body.
-		// Until we find a better solution to handle websocket requests, we will continue to
-		// use http.Transport(). We check if the request isWebsocketRequest() and use the
-		// http.Transport() irrespective of open telemetry is enabled or not.
-		// Related issue: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/12
-
 		// forward the request to the function service
-		var resp *http.Response
-		if util.IsWebsocketRequest(newReq) {
-			resp, err = transport.RoundTrip(newReq)
-		} else {
-			otelUtils.SpanTrackEvent(ctx, "roundtrip", otelUtils.MapToAttributes(map[string]string{
-				"function-name":      fnMeta.Name,
-				"function-namespace": fnMeta.Namespace,
-				"function-url":       newReq.URL.String(),
-				"retryCounter":       fmt.Sprintf("%d", retryCounter)})...)
-			otelRoundTripper := otelhttp.NewTransport(transport)
-			resp, err = otelRoundTripper.RoundTrip(newReq)
+		otelUtils.SpanTrackEvent(ctx, "roundtrip", otelUtils.MapToAttributes(map[string]string{
+			"function-name":      fnMeta.Name,
+			"function-namespace": fnMeta.Namespace,
+			"function-url":       newReq.URL.String(),
+			"retryCounter":       fmt.Sprintf("%d", retryCounter)})...)
+		otelRoundTripper := otelhttp.NewTransport(transport)
+		resp, err := otelRoundTripper.RoundTrip(newReq)
+		if roundTripper.funcHandler.isDebugEnv {
+			dumpRespFunc(resp)
 		}
-
 		if err == nil {
 			// return response back to user
-			if roundTripper.funcHandler.isDebugEnv {
-				dumpRespFunc(resp)
-			}
 			return resp, nil
 		}
 
-		if roundTripper.funcHandler.isDebugEnv && resp != nil {
-			dumpRespFunc(resp)
-		}
-
 		roundTripper.totalRetry++
 
 		if i >= roundTripper.funcHandler.tsRoundTripperParams.maxRetries-1 {
diff --git a/pkg/utils/otel/provider.go b/pkg/utils/otel/provider.go
index 40c7044a..0fa0a4e1 100644
--- a/pkg/utils/otel/provider.go
+++ b/pkg/utils/otel/provider.go
@@ -2,19 +2,14 @@ package otel
 
 import (
 	"context"
-	"fmt"
 	"os"
 	"strconv"
 	"strings"
 
-	"go.opentelemetry.io/contrib/propagators/aws/xray"
-	"go.opentelemetry.io/contrib/propagators/b3"
-	"go.opentelemetry.io/contrib/propagators/jaeger"
-	"go.opentelemetry.io/contrib/propagators/ot"
+	"go.opentelemetry.io/contrib/propagators/autoprop"
 	"go.opentelemetry.io/otel"
 	"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
 	"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
-	"go.opentelemetry.io/otel/propagation"
 	"go.opentelemetry.io/otel/sdk/resource"
 	sdktrace "go.opentelemetry.io/otel/sdk/trace"
 	semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
@@ -25,12 +20,10 @@ import (
 )
 
 const (
-	OtelEnvPrefix        = "OTEL_"
-	OtelEndpointEnvVar   = "OTEL_EXPORTER_OTLP_ENDPOINT"
-	OtelInsecureEnvVar   = "OTEL_EXPORTER_OTLP_INSECURE"
-	OtelTracesSampler    = "OTEL_TRACES_SAMPLER"
-	OtelTracesSamplerArg = "OTEL_TRACES_SAMPLER_ARG"
-	OtelPropogaters      = "OTEL_PROPOGATORS"
+	OtelEnvPrefix      = "OTEL_"
+	OtelEndpointEnvVar = "OTEL_EXPORTER_OTLP_ENDPOINT"
+	OtelInsecureEnvVar = "OTEL_EXPORTER_OTLP_INSECURE"
+	OtelPropagaters    = "OTEL_PROPAGATORS"
 )
 
 type OtelConfig struct {
@@ -38,111 +31,6 @@ type OtelConfig struct {
 	insecure bool
 }
 
-/*
-Each Sampler type defines its own expected input, if any.
-Currently we get trace ratio for the case of,
-1. traceidratio
-2. parentbased_traceidratio
-*/
-func getSamplerArg() (float64, error) {
-	arg := os.Getenv(OtelTracesSamplerArg)
-	return strconv.ParseFloat(arg, 64)
-}
-
-/* GetPropogater returns a slice of propagators to be used by the OpenTelemetry
-provider.
-
-Supported providers:
-tracecontext - W3C Trace Context
-baggage - W3C Baggage
-b3 - B3 Single
-b3multi - B3 Multi
-jaeger - Jaeger uber-trace-id header
-xray - AWS X-Ray (third party)
-ottrace - OpenTracing Trace (third party)
-*/
-func GetPropogater(logger *zap.Logger) []propagation.TextMapPropagator {
-	propogatersEnv := os.Getenv(OtelPropogaters)
-	if propogatersEnv == "" {
-		return []propagation.TextMapPropagator{
-			propagation.TraceContext{}, propagation.Baggage{},
-		}
-	}
-	propogators := []propagation.TextMapPropagator{}
-	for _, prop := range strings.Split(propogatersEnv, ",") {
-		switch prop {
-		case "tracecontext":
-			propogators = append(propogators, propagation.TraceContext{})
-		case "baggage":
-			propogators = append(propogators, propagation.Baggage{})
-		case "b3multi":
-			propogators = append(propogators, b3.New(b3.WithInjectEncoding(b3.B3MultipleHeader)))
-		case "b3":
-			propogators = append(propogators, b3.New(b3.WithInjectEncoding(b3.B3SingleHeader)))
-		case "jaeger":
-			propogators = append(propogators, jaeger.Jaeger{})
-		case "xray":
-			propogators = append(propogators, xray.Propagator{})
-		case "ottrace":
-			propogators = append(propogators, ot.OT{})
-		default:
-			logger.Error("Unsupported propagation type", zap.String("propagation", prop))
-		}
-	}
-	if len(propogators) == 0 {
-		return []propagation.TextMapPropagator{
-			propagation.TraceContext{}, propagation.Baggage{},
-		}
-	}
-	return propogators
-}
-
-/*
-GetSampler returns a sampler that can be used to sample traces.
-This is based on https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#general-sdk-configuration
-We have to implement as open-telemetry Go sdk doesn't support configuration of different samplers.
-Once its added we may remove this code.
-
-Supported samplers:
-always_on - Sampler that always samples spans, regardless of the parent span's sampling decision.
-always_off - Sampler that never samples spans, regardless of the parent span's sampling decision.
-traceidratio - Sampler that samples probabalistically based on rate.
-parentbased_always_on - (default) Sampler that respects its parent span's sampling decision, but otherwise always samples.
-parentbased_always_off - Sampler that respects its parent span's sampling decision, but otherwise never samples.
-parentbased_traceidratio - Sampler that respects its parent span's sampling decision, but otherwise samples probabalistically based on rate.
-
-Environment variables:
-OTEL_TRACES_SAMPLER - Sampler to use(one of the above samplers)
-OTEL_TRACES_SAMPLER_ARG - Argument to pass to the sampler(float value)
-*/
-func GetSampler() (sdktrace.Sampler, error) {
-	samplerType := os.Getenv(OtelTracesSampler)
-	switch samplerType {
-	case "always_on":
-		return sdktrace.AlwaysSample(), nil
-	case "always_off":
-		return sdktrace.NeverSample(), nil
-	case "parentbased_always_on":
-		return sdktrace.ParentBased(sdktrace.AlwaysSample()), nil
-	case "parentbased_always_off":
-		return sdktrace.ParentBased(sdktrace.NeverSample()), nil
-	case "traceidratio":
-		arg, err := getSamplerArg()
-		if err != nil {
-			return nil, fmt.Errorf("invalid sampler arg: %w", err)
-		}
-		return sdktrace.TraceIDRatioBased(arg), nil
-	case "parentbased_traceidratio":
-		arg, err := getSamplerArg()
-		if err != nil {
-			return nil, fmt.Errorf("invalid sampler arg: %w", err)
-		}
-		return sdktrace.ParentBased(sdktrace.TraceIDRatioBased(arg)), nil
-	default:
-		return sdktrace.ParentBased(sdktrace.AlwaysSample()), nil
-	}
-}
-
 // parseOtelConfig parses the environment variables OTEL_EXPORTER_OTLP_ENDPOINT and
 func parseOtelConfig() OtelConfig {
 	config := OtelConfig{}
@@ -191,13 +79,8 @@ func InitProvider(ctx context.Context, logger *zap.Logger, serviceName string) (
 	if err != nil {
 		return nil, err
 	}
-	sampler, err := GetSampler()
-	if err != nil {
-		return nil, err
-	}
 	tracerProvider := sdktrace.NewTracerProvider(
 		sdktrace.WithResource(res),
-		sdktrace.WithSampler(sampler),
 	)
 	traceExporter, err := getTraceExporter(ctx, logger)
 	if err != nil {
@@ -210,8 +93,7 @@ func InitProvider(ctx context.Context, logger *zap.Logger, serviceName string) (
 	}
 
 	otel.SetTracerProvider(tracerProvider)
-	propogaters := GetPropogater(logger)
-	otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propogaters...))
+	otel.SetTextMapPropagator(autoprop.NewTextMapPropagator())
 	// Shutdown will flush any remaining spans and shut down the exporter.
 	return func(ctx context.Context) {
 		err := tracerProvider.Shutdown(ctx)


Test patch:
diff --git a/pkg/utils/otel/provider_test.go b/pkg/utils/otel/provider_test.go
index 00fb5906..226df034 100644
--- a/pkg/utils/otel/provider_test.go
+++ b/pkg/utils/otel/provider_test.go
@@ -2,145 +2,54 @@ package otel
 
 import (
 	"context"
-	"errors"
 	"fmt"
 	"os"
 	"reflect"
+	"sort"
 	"testing"
 
-	"go.opentelemetry.io/contrib/propagators/jaeger"
+	"go.opentelemetry.io/contrib/propagators/autoprop"
 	"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
-	"go.opentelemetry.io/otel/propagation"
-	sdktrace "go.opentelemetry.io/otel/sdk/trace"
 
 	"github.com/fission/fission/pkg/utils/loggerfactory"
 )
 
 func TestGetPropogater(t *testing.T) {
-	if OtelPropogaters != "OTEL_PROPOGATORS" {
-		t.Errorf("Expected OTEL_PROPOGATORS to be set, got %s", OtelPropogaters)
+	if OtelPropagaters != "OTEL_PROPAGATORS" {
+		t.Errorf("Expected OTEL_PROPOGATORS to be set, got %s", OtelPropagaters)
 	}
+	// tracecontext, baggage, b3, b3multi, jaeger, xray, ottrace, and none
 	tests := []struct {
 		propogaterEnv string
-		propogaters   []propagation.TextMapPropagator
+		propogaters   []string
 	}{
 		{
-			"",
-			[]propagation.TextMapPropagator{propagation.TraceContext{}, propagation.Baggage{}},
+			"none",
+			[]string{},
 		},
 		{
 			"tracecontext,baggage",
-			[]propagation.TextMapPropagator{propagation.TraceContext{}, propagation.Baggage{}},
+			[]string{"baggage", "traceparent", "tracestate"},
 		},
 		{
 			"jaeger",
-			[]propagation.TextMapPropagator{jaeger.Jaeger{}},
+			[]string{"uber-trace-id"},
 		},
 		{
 			"baggage,tracecontext",
-			[]propagation.TextMapPropagator{propagation.Baggage{}, propagation.TraceContext{}},
+			[]string{"baggage", "traceparent", "tracestate"},
 		},
 		{
 			"jaeger,baggage",
-			[]propagation.TextMapPropagator{jaeger.Jaeger{}, propagation.Baggage{}},
+			[]string{"baggage", "uber-trace-id"},
 		},
 	}
-	logger := loggerfactory.GetLogger()
 	for _, tt := range tests {
-		os.Setenv(OtelPropogaters, tt.propogaterEnv)
-		prop := GetPropogater(logger)
-		if prop == nil {
-			t.Errorf("GetPropogater() = %#v, want %#v", prop, tt.propogaters)
-		}
-		if len(prop) != len(tt.propogaters) {
-			t.Errorf("GetPropogater() = %#v, want %#v", prop, tt.propogaters)
-		}
-		if !reflect.DeepEqual(prop, tt.propogaters) {
-			t.Errorf("GetPropogater() = %#v, want %#v", prop, tt.propogaters)
-		}
-	}
-}
-
-func TestGetSampler(t *testing.T) {
-	if OtelTracesSampler != "OTEL_TRACES_SAMPLER" {
-		t.Errorf("Expected OTEL_TRACES_SAMPLER to be set, got %s", OtelTracesSampler)
-	}
-	if OtelTracesSamplerArg != "OTEL_TRACES_SAMPLER_ARG" {
-		t.Errorf("Expected OTEL_TRACES_SAMPLER_ARG to be set, got %s", OtelTracesSamplerArg)
-	}
-	if OtelPropogaters != "OTEL_PROPOGATORS" {
-		t.Errorf("Expected OTEL_PROPOGATORS to be set, got %s", OtelPropogaters)
-	}
-	tests := []struct {
-		sampler     string
-		samplerArg  string
-		wantSampler sdktrace.Sampler
-		wantError   error
-	}{
-		{
-			"",
-			"",
-			sdktrace.ParentBased(sdktrace.AlwaysSample()),
-			nil,
-		},
-		{
-			"always_on",
-			"",
-			sdktrace.AlwaysSample(),
-			nil,
-		},
-		{
-			"always_off",
-			"",
-			sdktrace.NeverSample(),
-			nil,
-		},
-		{
-			"parentbased_always_on",
-			"",
-			sdktrace.ParentBased(sdktrace.AlwaysSample()),
-			nil,
-		},
-		{
-			"parentbased_always_off",
-			"",
-			sdktrace.ParentBased(sdktrace.NeverSample()),
-			nil,
-		},
-		{
-			"traceidratio",
-			"0.5",
-			sdktrace.TraceIDRatioBased(0.5),
-			nil,
-		},
-		{
-			"traceidratio",
-			"",
-			nil,
-			errors.New("invalid sampler arg: strconv.ParseFloat: parsing \"\": invalid syntax"),
-		},
-		{
-			"parentbased_traceidratio",
-			"",
-			nil,
-			errors.New("invalid sampler arg: strconv.ParseFloat: parsing \"\": invalid syntax"),
-		},
-		{
-			"parentbased_traceidratio",
-			"0.01",
-			sdktrace.ParentBased(sdktrace.TraceIDRatioBased(0.01)),
-			nil,
-		},
-	}
-	for _, tt := range tests {
-		os.Setenv(OtelTracesSampler, tt.sampler)
-		os.Setenv(OtelTracesSamplerArg, tt.samplerArg)
-		gotSampler, gotError := GetSampler()
-		if !reflect.DeepEqual(gotSampler, tt.wantSampler) {
-			t.Errorf("GetSampler() gotSampler = %#v, want %#v", gotSampler, tt.wantSampler)
-		}
-		if fmt.Sprintf("%s", gotError) != fmt.Sprintf("%s", tt.wantError) {
-			t.Errorf("GetSampler() gotError = %#v, want %#v", gotError, tt.wantError)
+		os.Setenv(OtelPropagaters, tt.propogaterEnv)
+		propFields := autoprop.NewTextMapPropagator().Fields()
+		sort.Strings(propFields)
+		if !reflect.DeepEqual(propFields, tt.propogaters) {
+			t.Errorf("Expected %s, got %s", tt.propogaters, propFields)
 		}
 	}
 }