-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[TT-7902] Detailed Tracing #5294
Conversation
API tests result: failure 🚫 |
API tests result: failure 🚫 |
💥 CI tests failed 🙈git-stateall ok Please look at the run or in the Checks tab. |
API tests result: failure 🚫 |
💥 CI tests failed 🙈git-stateall ok Please look at the run or in the Checks tab. |
💥 CI tests failed 🙈git-stateall ok Please look at the run or in the Checks tab. |
💥 CI tests failed 🙈git-stateall ok Please look at the run or in the Checks tab. |
API tests result: success ✅ |
API tests result: success ✅ |
API tests result: success ✅ |
💥 CI tests failed 🙈git-stateall ok Please look at the run or in the Checks tab. |
💥 CI tests failed 🙈git-statediff --git a/go.sum b/go.sum
index bc9b573..1f8e02e 100644
--- a/go.sum
+++ b/go.sum
@@ -99,8 +99,6 @@ github.com/TykTechnologies/murmur3 v0.0.0-20230310161213-aad17efd5632 h1:T5NWziF
github.com/TykTechnologies/murmur3 v0.0.0-20230310161213-aad17efd5632/go.mod h1:UsPYgOFBpNzDXLEti7MKOwHLpVSqdzuNGkVFPspQmnQ=
github.com/TykTechnologies/openid2go v0.1.2 h1:WXctksOahA/epTVVvbn9iNUuMXKRr0ksrF4dY9KW8o8=
github.com/TykTechnologies/openid2go v0.1.2/go.mod h1:gYfkqeWa+lY3Xz/Z2xYtIzmYXynlgKZaBIbPCqdcdMA=
-github.com/TykTechnologies/opentelemetry v0.0.5 h1:oH21VUJJ4wW9RlyaXIIL2Av139qRKAkUahaozSkZURg=
-github.com/TykTechnologies/opentelemetry v0.0.5/go.mod h1:bltWc1OyxnIyiado+XTl85g4EbMiCUjH52W12rbW194=
github.com/TykTechnologies/opentelemetry v0.0.6-0.20230710132847-4d8b5d5a0515 h1:gz5nvYPmSWS186uQPrLHFhXDhjxDoyUoz3dc1sqdad0=
github.com/TykTechnologies/opentelemetry v0.0.6-0.20230710132847-4d8b5d5a0515/go.mod h1:bltWc1OyxnIyiado+XTl85g4EbMiCUjH52W12rbW194=
github.com/TykTechnologies/storage v1.0.5 h1:lfMljPueySAW7Mpc70g1/qC5n2LKNcKgQs+Xw30apP8= Please look at the run or in the Checks tab. |
1 similar comment
💥 CI tests failed 🙈git-statediff --git a/go.sum b/go.sum
index bc9b573..1f8e02e 100644
--- a/go.sum
+++ b/go.sum
@@ -99,8 +99,6 @@ github.com/TykTechnologies/murmur3 v0.0.0-20230310161213-aad17efd5632 h1:T5NWziF
github.com/TykTechnologies/murmur3 v0.0.0-20230310161213-aad17efd5632/go.mod h1:UsPYgOFBpNzDXLEti7MKOwHLpVSqdzuNGkVFPspQmnQ=
github.com/TykTechnologies/openid2go v0.1.2 h1:WXctksOahA/epTVVvbn9iNUuMXKRr0ksrF4dY9KW8o8=
github.com/TykTechnologies/openid2go v0.1.2/go.mod h1:gYfkqeWa+lY3Xz/Z2xYtIzmYXynlgKZaBIbPCqdcdMA=
-github.com/TykTechnologies/opentelemetry v0.0.5 h1:oH21VUJJ4wW9RlyaXIIL2Av139qRKAkUahaozSkZURg=
-github.com/TykTechnologies/opentelemetry v0.0.5/go.mod h1:bltWc1OyxnIyiado+XTl85g4EbMiCUjH52W12rbW194=
github.com/TykTechnologies/opentelemetry v0.0.6-0.20230710132847-4d8b5d5a0515 h1:gz5nvYPmSWS186uQPrLHFhXDhjxDoyUoz3dc1sqdad0=
github.com/TykTechnologies/opentelemetry v0.0.6-0.20230710132847-4d8b5d5a0515/go.mod h1:bltWc1OyxnIyiado+XTl85g4EbMiCUjH52W12rbW194=
github.com/TykTechnologies/storage v1.0.5 h1:lfMljPueySAW7Mpc70g1/qC5n2LKNcKgQs+Xw30apP8= Please look at the run or in the Checks tab. |
💥 CI tests failed 🙈git-stateall ok Please look at the run or in the Checks tab. |
💥 CI tests failed 🙈git-stateall ok Please look at the run or in the Checks tab. |
API tests result: success ✅ |
API tests result: success ✅ |
API tests result: success ✅ |
@@ -13,8 +13,7 @@ tasks: | |||
sources: | |||
- go.mod | |||
- go.sum | |||
- './**/*.go' | |||
|
|||
- "./**/*.go" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change made by the linter
set -e | ||
task test:opentelemetry:setup | ||
trap 'task test:opentelemetry:teardown' EXIT | ||
task test:opentelemetry:test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ensuring teardown is executed no matter if the test failed or not
API tests result: success ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test case here with detailed spans https://github.com/TykTechnologies/tyk/blob/master/gateway/api_loader_test.go#L434
Also, please check with OAS API defs
gateway/middleware.go
Outdated
defer span.End() | ||
setContext(r, ctx) | ||
} else { | ||
span = tyktrace.SpanFromContext(r.Context()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this function to otel internal pkg, so we don't have to import /opentelemetry/trace here
@@ -724,7 +724,10 @@ const Schema = `{ | |||
}, | |||
"is_oas": { | |||
"type": "boolean" | |||
} | |||
}, | |||
"detailed_tracing": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this linted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ lgtm! only fix what Tom suggested
API tests result: success ✅ |
💥 CI tests failed 🙈git-statediff --git a/apidef/oas/schema/x-tyk-gateway.md b/apidef/oas/schema/x-tyk-gateway.md
index 9228f5e..89aac77 100644
--- a/apidef/oas/schema/x-tyk-gateway.md
+++ b/apidef/oas/schema/x-tyk-gateway.md
@@ -306,6 +306,9 @@ CustomDomain is the domain to bind this API to.
Tyk classic API definition: `domain`.
+**Field: `detailedTracing` ([DetailedTracing](#detailedtracing))**
+DetailedTracing enables detailed tracing for this API.
+
### **ListenPath**
@@ -617,6 +620,12 @@ Enabled allow/disallow the usage of the domain.
Name is the name of the domain.
+### **DetailedTracing**
+
+**Field: `enabled` (`boolean`)**
+Enabled enables detailed tracing.
+
+
### **Middleware**
**Field: `global` ([Global](#global))** Please look at the run or in the Checks tab. |
💥 CI tests failed 🙈git-statediff --git a/apidef/oas/schema/x-tyk-gateway.md b/apidef/oas/schema/x-tyk-gateway.md
index 9228f5e..89aac77 100644
--- a/apidef/oas/schema/x-tyk-gateway.md
+++ b/apidef/oas/schema/x-tyk-gateway.md
@@ -306,6 +306,9 @@ CustomDomain is the domain to bind this API to.
Tyk classic API definition: `domain`.
+**Field: `detailedTracing` ([DetailedTracing](#detailedtracing))**
+DetailedTracing enables detailed tracing for this API.
+
### **ListenPath**
@@ -617,6 +620,12 @@ Enabled allow/disallow the usage of the domain.
Name is the name of the domain.
+### **DetailedTracing**
+
+**Field: `enabled` (`boolean`)**
+Enabled enables detailed tracing.
+
+
### **Middleware**
**Field: `global` ([Global](#global))** Please look at the run or in the Checks tab. |
API tests result: success ✅ |
API tests result: success ✅ |
API tests result: success ✅ |
API tests result: success ✅ |
b3e4a60
to
6b84656
Compare
API tests result: success ✅ |
Kudos, SonarCloud Quality Gate passed! |
API tests result: success ✅ |
API tests result: success ✅ |
Description
Adding
detailed_tracing
field to API Definition. If this is set to true, then each OpenTelemetry trace will propagate the context and multiple spans will be shown. Otherwise, only the main span and a span showing the request to the upstream service will be present.Related Issue
https://tyktech.atlassian.net/browse/TT-7902?atlOrigin=eyJpIjoiMjgwMDY3YTQ5Nzk0NDAyODlkODUxOTUzMzc5NTZhZDgiLCJwIjoiaiJ9
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist