From 144cc06e8000b1623372f876bf82056b79eb0cc6 Mon Sep 17 00:00:00 2001 From: David Hontecillas Date: Wed, 23 Oct 2024 22:01:19 +0200 Subject: [PATCH 1/5] update to latest otel branch --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 8830c173..e7a687ed 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 require ( github.com/gin-gonic/gin v1.9.1 github.com/go-contrib/uuid v1.2.0 - github.com/krakend/krakend-otel v0.6.1 + github.com/krakend/krakend-otel v0.6.2-0.20241014134420-58cc00db2cce github.com/krakendio/bloomfilter/v2 v2.0.4 github.com/krakendio/krakend-amqp/v2 v2.1.0 github.com/krakendio/krakend-audit v0.0.7 diff --git a/go.sum b/go.sum index f64d6b33..b70586f0 100644 --- a/go.sum +++ b/go.sum @@ -475,6 +475,8 @@ github.com/krakend/go-auth0/v2 v2.0.1 h1:Ve73eo/rUo1NK/GrzOeWSuVdweGHY2sGU52NYdp github.com/krakend/go-auth0/v2 v2.0.1/go.mod h1:jaMs1/YcOmZYRUPBvk/nrhABJv/XkrUJGA2eywOUFRA= github.com/krakend/krakend-otel v0.6.1 h1:0+F/2aq/BATDUiMTSPGAJ6CwRX/xnn0OLu1V1WQfRF4= github.com/krakend/krakend-otel v0.6.1/go.mod h1:8Q6FfeY1S6RHMO/5/s0B+JJ1AEGDTJZHYtpmF1a+USA= +github.com/krakend/krakend-otel v0.6.2-0.20241014134420-58cc00db2cce h1:9sL1cibBSBw25WHBtOWryS9WbqFda7snv1HPAxCVp9E= +github.com/krakend/krakend-otel v0.6.2-0.20241014134420-58cc00db2cce/go.mod h1:8Q6FfeY1S6RHMO/5/s0B+JJ1AEGDTJZHYtpmF1a+USA= github.com/krakendio/binder v0.0.0-20230413105421-1bbe94e65f45 h1:5UbGH+Sa62LMtbBn6m3EEcaA4JFxaDd91X/X0SsZuO8= github.com/krakendio/binder v0.0.0-20230413105421-1bbe94e65f45/go.mod h1:VgJK/LM9NwyIxzYETGXQeRxdDg0IgBw4Fol58JVx2+4= github.com/krakendio/bloomfilter/v2 v2.0.4 h1:+FCe52Izx4mZgFevvifOMF+3WbbhmZT0xZnrnUE4C0U= From bad499473f2a499fe51bb865375259528f249659 Mon Sep 17 00:00:00 2001 From: David Hontecillas Date: Wed, 23 Oct 2024 22:05:05 +0200 Subject: [PATCH 2/5] fix missing go.sum updated --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index b70586f0..36ba3161 100644 --- a/go.sum +++ b/go.sum @@ -473,8 +473,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/krakend/go-auth0/v2 v2.0.1 h1:Ve73eo/rUo1NK/GrzOeWSuVdweGHY2sGU52NYdp73iU= github.com/krakend/go-auth0/v2 v2.0.1/go.mod h1:jaMs1/YcOmZYRUPBvk/nrhABJv/XkrUJGA2eywOUFRA= -github.com/krakend/krakend-otel v0.6.1 h1:0+F/2aq/BATDUiMTSPGAJ6CwRX/xnn0OLu1V1WQfRF4= -github.com/krakend/krakend-otel v0.6.1/go.mod h1:8Q6FfeY1S6RHMO/5/s0B+JJ1AEGDTJZHYtpmF1a+USA= github.com/krakend/krakend-otel v0.6.2-0.20241014134420-58cc00db2cce h1:9sL1cibBSBw25WHBtOWryS9WbqFda7snv1HPAxCVp9E= github.com/krakend/krakend-otel v0.6.2-0.20241014134420-58cc00db2cce/go.mod h1:8Q6FfeY1S6RHMO/5/s0B+JJ1AEGDTJZHYtpmF1a+USA= github.com/krakendio/binder v0.0.0-20230413105421-1bbe94e65f45 h1:5UbGH+Sa62LMtbBn6m3EEcaA4JFxaDd91X/X0SsZuO8= From 1dfd0ddd0470871d6caa4c0120d9f12421cd789c Mon Sep 17 00:00:00 2001 From: David Hontecillas Date: Thu, 24 Oct 2024 07:57:22 +0200 Subject: [PATCH 3/5] another update of otel lib --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e7a687ed..27a44440 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 require ( github.com/gin-gonic/gin v1.9.1 github.com/go-contrib/uuid v1.2.0 - github.com/krakend/krakend-otel v0.6.2-0.20241014134420-58cc00db2cce + github.com/krakend/krakend-otel v0.6.2-0.20241023204600-9304a17c92c2 github.com/krakendio/bloomfilter/v2 v2.0.4 github.com/krakendio/krakend-amqp/v2 v2.1.0 github.com/krakendio/krakend-audit v0.0.7 diff --git a/go.sum b/go.sum index 36ba3161..b2537035 100644 --- a/go.sum +++ b/go.sum @@ -473,8 +473,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/krakend/go-auth0/v2 v2.0.1 h1:Ve73eo/rUo1NK/GrzOeWSuVdweGHY2sGU52NYdp73iU= github.com/krakend/go-auth0/v2 v2.0.1/go.mod h1:jaMs1/YcOmZYRUPBvk/nrhABJv/XkrUJGA2eywOUFRA= -github.com/krakend/krakend-otel v0.6.2-0.20241014134420-58cc00db2cce h1:9sL1cibBSBw25WHBtOWryS9WbqFda7snv1HPAxCVp9E= -github.com/krakend/krakend-otel v0.6.2-0.20241014134420-58cc00db2cce/go.mod h1:8Q6FfeY1S6RHMO/5/s0B+JJ1AEGDTJZHYtpmF1a+USA= +github.com/krakend/krakend-otel v0.6.2-0.20241023204600-9304a17c92c2 h1:QFKw5BMAk1N6tE5z06WctGQKTbTefJMcKszT0JsYs8Y= +github.com/krakend/krakend-otel v0.6.2-0.20241023204600-9304a17c92c2/go.mod h1:8Q6FfeY1S6RHMO/5/s0B+JJ1AEGDTJZHYtpmF1a+USA= github.com/krakendio/binder v0.0.0-20230413105421-1bbe94e65f45 h1:5UbGH+Sa62LMtbBn6m3EEcaA4JFxaDd91X/X0SsZuO8= github.com/krakendio/binder v0.0.0-20230413105421-1bbe94e65f45/go.mod h1:VgJK/LM9NwyIxzYETGXQeRxdDg0IgBw4Fol58JVx2+4= github.com/krakendio/bloomfilter/v2 v2.0.4 h1:+FCe52Izx4mZgFevvifOMF+3WbbhmZT0xZnrnUE4C0U= From 4d5aa5e6d38e72248727903eff0122d7d2c6d105 Mon Sep 17 00:00:00 2001 From: David Hontecillas Date: Wed, 30 Oct 2024 09:52:12 +0100 Subject: [PATCH 4/5] move aplication of otel metrics wrapper to the executor instead in the proxy factory to make sure will always be wrapping all other proxy middleares --- executor.go | 4 ++++ proxy_factory.go | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/executor.go b/executor.go index bafc3417..1ce2852b 100644 --- a/executor.go +++ b/executor.go @@ -200,6 +200,10 @@ func (e *ExecutorBuilder) NewCmdExecutor(ctx context.Context) cmd.Executor { bpf := e.BackendFactory.NewBackendFactory(ctx, logger, metricCollector) pf := e.ProxyFactory.NewProxyFactory(logger, bpf, metricCollector) + // we move the proxy factory out of the default proxy factory to make + // sure that is always the outer middleware and that wraps any internal + // proxy layer middleware: + pf = otellura.ProxyFactory(pf) agentPing := make(chan string, len(cfg.AsyncAgents)) diff --git a/proxy_factory.go b/proxy_factory.go index 979cf90c..2ea6b71e 100644 --- a/proxy_factory.go +++ b/proxy_factory.go @@ -3,7 +3,6 @@ package krakend import ( "fmt" - otellura "github.com/krakend/krakend-otel/lura" cel "github.com/krakendio/krakend-cel/v2" jsonschema "github.com/krakendio/krakend-jsonschema/v2" lua "github.com/krakendio/krakend-lua/v2/proxy" @@ -24,7 +23,6 @@ func internalNewProxyFactory(logger logging.Logger, backendFactory proxy.Backend proxyFactory = lua.ProxyFactory(logger, proxyFactory) proxyFactory = metricCollector.ProxyFactory("pipe", proxyFactory) proxyFactory = opencensus.ProxyFactory(proxyFactory) - proxyFactory = otellura.ProxyFactory(proxyFactory) return proxyFactory } From 062cebe36485b9a2b463238967cb907351a8a41a Mon Sep 17 00:00:00 2001 From: David Hontecillas Date: Wed, 30 Oct 2024 20:08:58 +0100 Subject: [PATCH 5/5] update to krakend-otel v0.6.2 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 27a44440..7b2211f8 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 require ( github.com/gin-gonic/gin v1.9.1 github.com/go-contrib/uuid v1.2.0 - github.com/krakend/krakend-otel v0.6.2-0.20241023204600-9304a17c92c2 + github.com/krakend/krakend-otel v0.6.2 github.com/krakendio/bloomfilter/v2 v2.0.4 github.com/krakendio/krakend-amqp/v2 v2.1.0 github.com/krakendio/krakend-audit v0.0.7 diff --git a/go.sum b/go.sum index b2537035..9f466969 100644 --- a/go.sum +++ b/go.sum @@ -473,8 +473,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/krakend/go-auth0/v2 v2.0.1 h1:Ve73eo/rUo1NK/GrzOeWSuVdweGHY2sGU52NYdp73iU= github.com/krakend/go-auth0/v2 v2.0.1/go.mod h1:jaMs1/YcOmZYRUPBvk/nrhABJv/XkrUJGA2eywOUFRA= -github.com/krakend/krakend-otel v0.6.2-0.20241023204600-9304a17c92c2 h1:QFKw5BMAk1N6tE5z06WctGQKTbTefJMcKszT0JsYs8Y= -github.com/krakend/krakend-otel v0.6.2-0.20241023204600-9304a17c92c2/go.mod h1:8Q6FfeY1S6RHMO/5/s0B+JJ1AEGDTJZHYtpmF1a+USA= +github.com/krakend/krakend-otel v0.6.2 h1:jvSxVMo7ckPgNUQUNjOVT/+GKnw7I6QXwwWLvzFcbLQ= +github.com/krakend/krakend-otel v0.6.2/go.mod h1:8Q6FfeY1S6RHMO/5/s0B+JJ1AEGDTJZHYtpmF1a+USA= github.com/krakendio/binder v0.0.0-20230413105421-1bbe94e65f45 h1:5UbGH+Sa62LMtbBn6m3EEcaA4JFxaDd91X/X0SsZuO8= github.com/krakendio/binder v0.0.0-20230413105421-1bbe94e65f45/go.mod h1:VgJK/LM9NwyIxzYETGXQeRxdDg0IgBw4Fol58JVx2+4= github.com/krakendio/bloomfilter/v2 v2.0.4 h1:+FCe52Izx4mZgFevvifOMF+3WbbhmZT0xZnrnUE4C0U=