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

[TT-8809]: Use custom graphql otel engine if otel is enabled #5336

Merged
merged 19 commits into from
Aug 3, 2023

Conversation

kofoworola
Copy link
Contributor

Description

Related Issue

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring or add test (improvements in base code or adds test coverage to functionality)

Checklist

  • I ensured that the documentation is up to date
  • I explained why this PR updates go.mod in detail with reasoning why it's required
  • I would like a code coverage CI quality gate exception and have explained why

@github-actions
Copy link
Contributor

💥 CI tests failed 🙈

git-state

diff --git a/gateway/custom_otel_graphql_engine.go b/gateway/custom_otel_graphql_engine.go
index 6a3d837..31fa25e 100644
--- a/gateway/custom_otel_graphql_engine.go
+++ b/gateway/custom_otel_graphql_engine.go
@@ -2,6 +2,10 @@ package gateway
 
 import (
 	"context"
+	"sync"
+
+	"github.com/sirupsen/logrus"
+
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/plan"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/resolve"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/graphql"
@@ -9,8 +13,6 @@ import (
 	"github.com/TykTechnologies/graphql-go-tools/pkg/postprocess"
 	"github.com/TykTechnologies/tyk/internal/otel"
 	tyktrace "github.com/TykTechnologies/tyk/trace"
-	"github.com/sirupsen/logrus"
-	"sync"
 )
 
 type OtelGraphqlEngineV2 struct {

Please look at the run or in the Checks tab.

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 19, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit:
Triggered by: pull_request (@kofoworola)
Execution page

@github-actions
Copy link
Contributor

💥 CI tests failed 🙈

git-state

diff --git a/gateway/custom_otel_graphql_engine.go b/gateway/custom_otel_graphql_engine.go
index 75253c4..7453b92 100644
--- a/gateway/custom_otel_graphql_engine.go
+++ b/gateway/custom_otel_graphql_engine.go
@@ -2,6 +2,10 @@ package gateway
 
 import (
 	"context"
+	"sync"
+
+	"github.com/sirupsen/logrus"
+
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/plan"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/resolve"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/graphql"
@@ -9,8 +13,6 @@ import (
 	"github.com/TykTechnologies/graphql-go-tools/pkg/postprocess"
 	"github.com/TykTechnologies/tyk/internal/otel"
 	tyktrace "github.com/TykTechnologies/tyk/trace"
-	"github.com/sirupsen/logrus"
-	"sync"
 )
 
 type OtelGraphqlEngineV2 struct {

Please look at the run or in the Checks tab.

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 20, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: 10c8a38
Triggered by: pull_request (@kofoworola)
Execution page

@github-actions
Copy link
Contributor

💥 CI tests failed 🙈

git-state

diff --git a/gateway/custom_otel_graphql_engine.go b/gateway/custom_otel_graphql_engine.go
index 1a0d79b..feef39e 100644
--- a/gateway/custom_otel_graphql_engine.go
+++ b/gateway/custom_otel_graphql_engine.go
@@ -2,14 +2,16 @@ package gateway
 
 import (
 	"context"
+	"sync"
+
+	"github.com/sirupsen/logrus"
+
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/plan"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/resolve"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/graphql"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/operationreport"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/postprocess"
 	"github.com/TykTechnologies/tyk/internal/otel"
-	"github.com/sirupsen/logrus"
-	"sync"
 )
 
 type OtelGraphqlEngineV2 struct {

Please look at the run or in the Checks tab.

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 21, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: ee411e5
Triggered by: pull_request (@kofoworola)
Execution page

@github-actions
Copy link
Contributor

💥 CI tests failed 🙈

git-state

diff --git a/gateway/custom_otel_graphql_engine.go b/gateway/custom_otel_graphql_engine.go
index 1a0d79b..feef39e 100644
--- a/gateway/custom_otel_graphql_engine.go
+++ b/gateway/custom_otel_graphql_engine.go
@@ -2,14 +2,16 @@ package gateway
 
 import (
 	"context"
+	"sync"
+
+	"github.com/sirupsen/logrus"
+
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/plan"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/resolve"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/graphql"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/operationreport"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/postprocess"
 	"github.com/TykTechnologies/tyk/internal/otel"
-	"github.com/sirupsen/logrus"
-	"sync"
 )
 
 type OtelGraphqlEngineV2 struct {

Please look at the run or in the Checks tab.

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 21, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: c9438f7
Triggered by: pull_request (@kofoworola)
Execution page

@github-actions
Copy link
Contributor

💥 CI tests failed 🙈

git-state

diff --git a/gateway/custom_otel_graphql_engine.go b/gateway/custom_otel_graphql_engine.go
index 1a0d79b..feef39e 100644
--- a/gateway/custom_otel_graphql_engine.go
+++ b/gateway/custom_otel_graphql_engine.go
@@ -2,14 +2,16 @@ package gateway
 
 import (
 	"context"
+	"sync"
+
+	"github.com/sirupsen/logrus"
+
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/plan"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/resolve"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/graphql"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/operationreport"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/postprocess"
 	"github.com/TykTechnologies/tyk/internal/otel"
-	"github.com/sirupsen/logrus"
-	"sync"
 )
 
 type OtelGraphqlEngineV2 struct {
diff --git a/go.mod b/go.mod
index 8ce3153..1fccb78 100644
--- a/go.mod
+++ b/go.mod
@@ -79,7 +79,10 @@ require (
 	gopkg.in/yaml.v3 v3.0.1
 )
 
-require github.com/TykTechnologies/opentelemetry v0.0.11
+require (
+	github.com/TykTechnologies/opentelemetry v0.0.11
+	go.opentelemetry.io/otel/trace v1.16.0
+)
 
 require (
 	github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
@@ -178,7 +181,6 @@ require (
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.16.0 // indirect
 	go.opentelemetry.io/otel/metric v1.16.0 // indirect
 	go.opentelemetry.io/otel/sdk v1.16.0 // indirect
-	go.opentelemetry.io/otel/trace v1.16.0 // indirect
 	go.opentelemetry.io/proto/otlp v0.19.0 // indirect
 	go.uber.org/atomic v1.9.0 // indirect
 	go.uber.org/multierr v1.6.0 // indirect

Please look at the run or in the Checks tab.

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 24, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: ae72dc3
Triggered by: pull_request (@kofoworola)
Execution page

@kofoworola kofoworola marked this pull request as ready for review July 24, 2023 08:35
@kofoworola kofoworola requested a review from a team as a code owner July 24, 2023 08:35
@github-actions
Copy link
Contributor

💥 CI tests failed 🙈

git-state

diff --git a/gateway/otel_graphql_engine.go b/gateway/otel_graphql_engine.go
index 1a0d79b..feef39e 100644
--- a/gateway/otel_graphql_engine.go
+++ b/gateway/otel_graphql_engine.go
@@ -2,14 +2,16 @@ package gateway
 
 import (
 	"context"
+	"sync"
+
+	"github.com/sirupsen/logrus"
+
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/plan"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/resolve"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/graphql"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/operationreport"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/postprocess"
 	"github.com/TykTechnologies/tyk/internal/otel"
-	"github.com/sirupsen/logrus"
-	"sync"
 )
 
 type OtelGraphqlEngineV2 struct {
diff --git a/go.mod b/go.mod
index 8ce3153..1fccb78 100644
--- a/go.mod
+++ b/go.mod
@@ -79,7 +79,10 @@ require (
 	gopkg.in/yaml.v3 v3.0.1
 )
 
-require github.com/TykTechnologies/opentelemetry v0.0.11
+require (
+	github.com/TykTechnologies/opentelemetry v0.0.11
+	go.opentelemetry.io/otel/trace v1.16.0
+)
 
 require (
 	github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
@@ -178,7 +181,6 @@ require (
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.16.0 // indirect
 	go.opentelemetry.io/otel/metric v1.16.0 // indirect
 	go.opentelemetry.io/otel/sdk v1.16.0 // indirect
-	go.opentelemetry.io/otel/trace v1.16.0 // indirect
 	go.opentelemetry.io/proto/otlp v0.19.0 // indirect
 	go.uber.org/atomic v1.9.0 // indirect
 	go.uber.org/multierr v1.6.0 // indirect

Please look at the run or in the Checks tab.

@github-actions
Copy link
Contributor

💥 CI tests failed 🙈

git-state

diff --git a/gateway/otel_graphql_engine.go b/gateway/otel_graphql_engine.go
index 1a0d79b..feef39e 100644
--- a/gateway/otel_graphql_engine.go
+++ b/gateway/otel_graphql_engine.go
@@ -2,14 +2,16 @@ package gateway
 
 import (
 	"context"
+	"sync"
+
+	"github.com/sirupsen/logrus"
+
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/plan"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/resolve"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/graphql"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/operationreport"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/postprocess"
 	"github.com/TykTechnologies/tyk/internal/otel"
-	"github.com/sirupsen/logrus"
-	"sync"
 )
 
 type OtelGraphqlEngineV2 struct {
diff --git a/go.mod b/go.mod
index 8ce3153..1fccb78 100644
--- a/go.mod
+++ b/go.mod
@@ -79,7 +79,10 @@ require (
 	gopkg.in/yaml.v3 v3.0.1
 )
 
-require github.com/TykTechnologies/opentelemetry v0.0.11
+require (
+	github.com/TykTechnologies/opentelemetry v0.0.11
+	go.opentelemetry.io/otel/trace v1.16.0
+)
 
 require (
 	github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
@@ -178,7 +181,6 @@ require (
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.16.0 // indirect
 	go.opentelemetry.io/otel/metric v1.16.0 // indirect
 	go.opentelemetry.io/otel/sdk v1.16.0 // indirect
-	go.opentelemetry.io/otel/trace v1.16.0 // indirect
 	go.opentelemetry.io/proto/otlp v0.19.0 // indirect
 	go.uber.org/atomic v1.9.0 // indirect
 	go.uber.org/multierr v1.6.0 // indirect

Please look at the run or in the Checks tab.

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 24, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: 804ac1c
Triggered by: pull_request (@kofoworola)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 24, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: b1ec85f
Triggered by: pull_request (@kofoworola)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 24, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: 27e7ed2
Triggered by: pull_request (@kofoworola)
Execution page

@github-actions
Copy link
Contributor

💥 CI tests failed 🙈

git-state

diff --git a/gateway/api_definition.go b/gateway/api_definition.go
index 819a496..4022bec 100644
--- a/gateway/api_definition.go
+++ b/gateway/api_definition.go
@@ -7,7 +7,6 @@ import (
 	"encoding/json"
 	"errors"
 	"fmt"
-	graphqlinternal "github.com/TykTechnologies/tyk/internal/graphql"
 	"io"
 	"io/ioutil"
 	"net/http"
@@ -20,6 +19,8 @@ import (
 	"text/template"
 	"time"
 
+	graphqlinternal "github.com/TykTechnologies/tyk/internal/graphql"
+
 	"github.com/getkin/kin-openapi/routers"
 
 	"github.com/getkin/kin-openapi/routers/gorillamux"
diff --git a/gateway/mw_graphql.go b/gateway/mw_graphql.go
index 55a8aa9..fea5091 100644
--- a/gateway/mw_graphql.go
+++ b/gateway/mw_graphql.go
@@ -4,9 +4,10 @@ import (
 	"context"
 	"encoding/json"
 	"errors"
-	"github.com/TykTechnologies/tyk/internal/graphql"
 	"net/http"
 
+	"github.com/TykTechnologies/tyk/internal/graphql"
+
 	"github.com/gorilla/websocket"
 	"github.com/jensneuse/abstractlogger"
 	"github.com/sirupsen/logrus"
diff --git a/go.mod b/go.mod
index 1fccb78..70de53b 100644
--- a/go.mod
+++ b/go.mod
@@ -81,6 +81,7 @@ require (
 
 require (
 	github.com/TykTechnologies/opentelemetry v0.0.11
+	go.opentelemetry.io/otel v1.16.0
 	go.opentelemetry.io/otel/trace v1.16.0
 )
 
@@ -174,7 +175,6 @@ require (
 	github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
 	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0 // indirect
 	go.opentelemetry.io/contrib/propagators/b3 v1.17.0 // indirect
-	go.opentelemetry.io/otel v1.16.0 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0 // indirect
diff --git a/internal/graphql/otel_graphql_engine.go b/internal/graphql/otel_graphql_engine.go
index 44db83d..069e7e8 100644
--- a/internal/graphql/otel_graphql_engine.go
+++ b/internal/graphql/otel_graphql_engine.go
@@ -2,9 +2,10 @@ package graphql
 
 import (
 	"context"
-	"go.opentelemetry.io/otel/codes"
 	"sync"
 
+	"go.opentelemetry.io/otel/codes"
+
 	"github.com/sirupsen/logrus"
 
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/plan"

Please look at the run or in the Checks tab.

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 25, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: a1d286a
Triggered by: pull_request (@kofoworola)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 25, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: c9e9dcc
Triggered by: pull_request (@kofoworola)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 25, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: 978aadd
Triggered by: pull_request (@kofoworola)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Jul 25, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: fd8b60f
Triggered by: pull_request (@kofoworola)
Execution page

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

💥 CI tests failed 🙈

git-state

all ok

Please look at the run or in the Checks tab.

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Aug 3, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: e763745
Triggered by: pull_request (@kofoworola)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Aug 3, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: 59adcd1
Triggered by: pull_request (@kofoworola)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Aug 3, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: 3c063e1
Triggered by: pull_request (@kofoworola)
Execution page

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

💥 CI tests failed 🙈

git-state

all ok

Please look at the run or in the Checks tab.

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Aug 3, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: 46a7612
Triggered by: pull_request (@kofoworola)
Execution page

@sonarcloud
Copy link

sonarcloud bot commented Aug 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

86.1% 86.1% Coverage
0.0% 0.0% Duplication

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Aug 3, 2023

API tests result: success
Branch used: refs/pull/5336/merge
Commit: 48c7dfd
Triggered by: pull_request (@kofoworola)
Execution page

@kofoworola kofoworola enabled auto-merge (squash) August 3, 2023 08:14
Copy link
Contributor

@tbuchaillot tbuchaillot left a comment

Choose a reason for hiding this comment

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

Ship it 🚀

@kofoworola kofoworola merged commit 9e9dcf1 into master Aug 3, 2023
18 of 19 checks passed
@kofoworola kofoworola deleted the feat/gql-otel branch August 3, 2023 08:41
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.

4 participants