From cfe06f3010bf88b652192370e928ab90f4496f36 Mon Sep 17 00:00:00 2001 From: Yaroslav Grebnov Date: Thu, 8 Oct 2026 15:05:30 +0200 Subject: [PATCH 1/3] Use instrumentation --- execute/runtime/router/grpc/router.go | 34 ++++++--------- execute/runtime/router/grpc/router_test.go | 44 ++++++++++--------- execute/runtime/router/http/request.go | 8 ++-- execute/runtime/router/http/request_test.go | 17 +++----- execute/runtime/router/http/router.go | 3 +- execute/runtime/router/http/router_test.go | 23 ++++------ execute/worker/grpc/executor.go | 6 +-- execute/worker/grpc/executor_test.go | 15 ++----- execute/worker/http/executor.go | 5 ++- execute/worker/http/executor_test.go | 48 ++++++++------------- go.mod | 3 ++ go.sum | 16 +++---- pkg/keys/keys.go | 34 ++++++--------- 13 files changed, 108 insertions(+), 148 deletions(-) diff --git a/execute/runtime/router/grpc/router.go b/execute/runtime/router/grpc/router.go index 39989ad..0fe4b96 100644 --- a/execute/runtime/router/grpc/router.go +++ b/execute/runtime/router/grpc/router.go @@ -6,6 +6,8 @@ import ( "fmt" "net" + e2engine "github.com/e2engine/instrumentation-go" + e2enginegrpc "github.com/e2engine/instrumentation-go/grpc" "github.com/ygrebnov/errorc" grpcpkg "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -266,25 +268,19 @@ func (r *Router) newHandler( ) } - incomingMetadata, _ := - metadata.FromIncomingContext( - stream.Context(), - ) + ctx := e2enginegrpc.Extract(stream.Context()) + testExecutionID := e2engine.TestExecutionID(ctx) - var testExecutionID string - if values := incomingMetadata.Get( - string(keys.E2EngineTestExecutionID), - ); len(values) > 0 { - testExecutionID = values[0] - } + incomingMetadata, _ := metadata.FromIncomingContext( + stream.Context(), + ) - outgoingMetadata := incomingMetadata.Copy() - outgoingMetadata.Delete( - string(keys.E2EngineTestExecutionID), + outgoingMetadata := e2enginegrpc.WithoutTestExecutionID( + incomingMetadata, ) outgoingContext := metadata.NewOutgoingContext( - stream.Context(), + ctx, outgoingMetadata, ) @@ -354,19 +350,15 @@ func (r *Router) newHandler( } } -func cloneMetadata( - source metadata.MD, -) map[string][]string { +func cloneMetadata(source metadata.MD) map[string][]string { + source = e2enginegrpc.WithoutTestExecutionID(source) + result := make( map[string][]string, len(source), ) for key, values := range source { - if key == string(keys.E2EngineTestExecutionID) { - continue - } - result[key] = append( []string(nil), values..., diff --git a/execute/runtime/router/grpc/router_test.go b/execute/runtime/router/grpc/router_test.go index 6130e52..252179a 100644 --- a/execute/runtime/router/grpc/router_test.go +++ b/execute/runtime/router/grpc/router_test.go @@ -6,6 +6,7 @@ import ( "net" "testing" + e2enginegrpc "github.com/e2engine/instrumentation-go/grpc" grpcpkg "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials/insecure" @@ -14,7 +15,6 @@ import ( "github.com/e2engine/core/execute/call" "github.com/e2engine/core/execute/runtime" - "github.com/e2engine/core/pkg/keys" "github.com/e2engine/core/pkg/log" ) @@ -85,10 +85,12 @@ func TestRawCodec(t *testing.T) { } func TestCloneMetadata(t *testing.T) { - source := metadata.Pairs( - "x-test", "first", - "x-test", "second", - string(keys.E2EngineTestExecutionID), "execution-1", + source := e2enginegrpc.WithTestExecutionID( + metadata.Pairs( + "x-test", "first", + "x-test", "second", + ), + "execution-1", ) got := cloneMetadata(source) @@ -103,9 +105,10 @@ func TestCloneMetadata(t *testing.T) { ) } - if _, ok := got[string(keys.E2EngineTestExecutionID)]; ok { - t.Fatal( - "expected execution ID metadata to be excluded", + if len(got) != 1 { + t.Fatalf( + "expected execution ID metadata to be excluded, got %#v", + got, ) } @@ -259,9 +262,11 @@ func TestRouter(t *testing.T) { ctx := metadata.NewOutgoingContext( context.Background(), - metadata.Pairs( - "x-request", "request-value", - string(keys.E2EngineTestExecutionID), + e2enginegrpc.WithTestExecutionID( + metadata.Pairs( + "x-request", + "request-value", + ), "execution-1", ), ) @@ -305,11 +310,7 @@ func TestRouter(t *testing.T) { ) } - if len( - upstreamMetadata.Get( - string(keys.E2EngineTestExecutionID), - ), - ) != 0 { + if id := e2enginegrpc.TestExecutionID(upstreamMetadata); id != "" { t.Fatal( "expected execution ID not to be forwarded upstream", ) @@ -366,9 +367,10 @@ func TestRouter(t *testing.T) { ) } - if _, ok := got.GRPC.Request.Metadata[string(keys.E2EngineTestExecutionID)]; ok { - t.Fatal( - "expected execution ID to be excluded from recorded metadata", + if id := e2enginegrpc.TestExecutionID(got.GRPC.Request.Metadata); id != "" { + t.Fatalf( + "expected execution ID to be excluded from recorded metadata, got %q", + id, ) } @@ -467,8 +469,8 @@ func TestRouterUpstreamError(t *testing.T) { ctx := metadata.NewOutgoingContext( context.Background(), - metadata.Pairs( - string(keys.E2EngineTestExecutionID), + e2enginegrpc.WithTestExecutionID( + nil, "execution-1", ), ) diff --git a/execute/runtime/router/http/request.go b/execute/runtime/router/http/request.go index 07836d7..123fb37 100644 --- a/execute/runtime/router/http/request.go +++ b/execute/runtime/router/http/request.go @@ -5,14 +5,16 @@ import ( "io" "net/http" + e2enginehttp "github.com/e2engine/instrumentation-go/http" + "github.com/e2engine/core/execute/call" "github.com/e2engine/core/internal/util" - "github.com/e2engine/core/pkg/keys" ) func captureRequest(req *http.Request) (call.HTTPRequest, error) { - header := util.CloneHTTPHeader(req.Header) - header.Del(string(keys.E2EngineTestExecutionID)) + header := e2enginehttp.WithoutTestExecutionID( + req.Header, + ) query := util.CloneQuery(req.URL.Query()) diff --git a/execute/runtime/router/http/request_test.go b/execute/runtime/router/http/request_test.go index 2f0f351..5afc91c 100644 --- a/execute/runtime/router/http/request_test.go +++ b/execute/runtime/router/http/request_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/e2engine/core/pkg/keys" + e2enginehttp "github.com/e2engine/instrumentation-go/http" ) func TestCaptureRequest(t *testing.T) { @@ -22,10 +22,8 @@ func TestCaptureRequest(t *testing.T) { req.Header.Set("Content-Type", "application/json") req.Header.Set("X-Test", "test") - req.Header.Set( - string(keys.E2EngineTestExecutionID), - "execution-1", - ) + + req.Header = e2enginehttp.WithTestExecutionID(req.Header, "execution-1") got, err := captureRequest(req) if err != nil { @@ -61,11 +59,10 @@ func TestCaptureRequest(t *testing.T) { ) } - if got.Headers.Get( - string(keys.E2EngineTestExecutionID), - ) != "" { - t.Fatal( - "expected execution ID header to be removed", + if id := e2enginehttp.TestExecutionID(got.Headers); id != "" { + t.Errorf( + "expected execution ID header to be removed, got %q", + id, ) } diff --git a/execute/runtime/router/http/router.go b/execute/runtime/router/http/router.go index 30accfa..4085505 100644 --- a/execute/runtime/router/http/router.go +++ b/execute/runtime/router/http/router.go @@ -8,6 +8,7 @@ import ( "net/http/httputil" "net/url" + e2enginehttp "github.com/e2engine/instrumentation-go/http" "github.com/ygrebnov/errorc" "github.com/e2engine/core/execute/call" @@ -133,7 +134,7 @@ func (r *Router) Mount(ctx context.Context) error { proxy.ServeHTTP(responseRecorder, req) r.calls.Record(call.Call{ - TestExecutionID: req.Header.Get(string(keys.E2EngineTestExecutionID)), + TestExecutionID: e2enginehttp.TestExecutionID(req.Header), ServiceID: route.ServiceID, HTTP: &call.HTTPCall{ Request: request, diff --git a/execute/runtime/router/http/router_test.go b/execute/runtime/router/http/router_test.go index 47a9fbd..31ca64f 100644 --- a/execute/runtime/router/http/router_test.go +++ b/execute/runtime/router/http/router_test.go @@ -10,9 +10,10 @@ import ( "strings" "testing" + e2enginehttp "github.com/e2engine/instrumentation-go/http" + "github.com/e2engine/core/execute/call" "github.com/e2engine/core/execute/runtime" - "github.com/e2engine/core/pkg/keys" "github.com/e2engine/core/pkg/log" ) @@ -83,10 +84,8 @@ func TestRouter(t *testing.T) { } req.Header.Set("X-Test", "value") - req.Header.Set( - string(keys.E2EngineTestExecutionID), - "execution-1", - ) + + req.Header = e2enginehttp.WithTestExecutionID(req.Header, "execution-1") resp, err := http.DefaultClient.Do(req) if err != nil { @@ -188,11 +187,10 @@ func TestRouter(t *testing.T) { ) } - if got.HTTP.Request.Headers.Get( - string(keys.E2EngineTestExecutionID), - ) != "" { - t.Fatal( - "expected execution ID header to be excluded from recorded request", + if id := e2enginehttp.TestExecutionID(got.HTTP.Request.Headers); id != "" { + t.Errorf( + "expected execution ID header to be removed, got %q", + id, ) } @@ -274,10 +272,7 @@ func TestRouterProxyError(t *testing.T) { if err != nil { t.Fatalf("cannot create request: %v", err) } - req.Header.Set( - string(keys.E2EngineTestExecutionID), - "execution-1", - ) + req.Header = e2enginehttp.WithTestExecutionID(req.Header, "execution-1") resp, err := http.DefaultClient.Do(req) if err != nil { diff --git a/execute/worker/grpc/executor.go b/execute/worker/grpc/executor.go index e4d51f0..0c0f6ae 100644 --- a/execute/worker/grpc/executor.go +++ b/execute/worker/grpc/executor.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" + e2enginegrpc "github.com/e2engine/instrumentation-go/grpc" "github.com/ygrebnov/errorc" ggrpc "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -83,10 +84,7 @@ func (e *TestExecutor) Execute( defer connection.Close() callMetadata := metadata.MD(spec.Metadata).Copy() - callMetadata.Set( - string(keys.E2EngineTestExecutionID), - job.ExecutionID, - ) + callMetadata = e2enginegrpc.WithTestExecutionID(callMetadata, job.ExecutionID) callCtx := metadata.NewOutgoingContext( ctx, diff --git a/execute/worker/grpc/executor_test.go b/execute/worker/grpc/executor_test.go index 1516e16..83a1137 100644 --- a/execute/worker/grpc/executor_test.go +++ b/execute/worker/grpc/executor_test.go @@ -7,6 +7,7 @@ import ( "reflect" "testing" + e2enginegrpc "github.com/e2engine/instrumentation-go/grpc" ggrpc "google.golang.org/grpc" "google.golang.org/grpc/metadata" "google.golang.org/protobuf/reflect/protodesc" @@ -18,7 +19,6 @@ import ( servicegrpc "github.com/e2engine/core/execute/runtime/service/grpc" "github.com/e2engine/core/model" coreerrors "github.com/e2engine/core/pkg/errors" - "github.com/e2engine/core/pkg/keys" ) func TestFindService(t *testing.T) { @@ -325,17 +325,10 @@ func TestExecutorExecute(t *testing.T) { t.Error("expected request metadata") } - executionIDs := md.Get( - string(keys.E2EngineTestExecutionID), - ) - - if !reflect.DeepEqual( - executionIDs, - []string{"execution-123"}, - ) { + if id := e2enginegrpc.TestExecutionID(md); id != "execution-123" { t.Errorf( - "unexpected execution ID metadata: %#v", - executionIDs, + "unexpected execution ID metadata: %s", + id, ) } diff --git a/execute/worker/http/executor.go b/execute/worker/http/executor.go index ff5b637..e62a915 100644 --- a/execute/worker/http/executor.go +++ b/execute/worker/http/executor.go @@ -6,9 +6,10 @@ import ( "io" "net/http" + e2enginehttp "github.com/e2engine/instrumentation-go/http" + "github.com/e2engine/core/execute" "github.com/e2engine/core/model" - "github.com/e2engine/core/pkg/keys" ) type TestExecutor struct { @@ -94,7 +95,7 @@ func buildHTTPRequest( } } - req.Header.Set(string(keys.E2EngineTestExecutionID), testExecutionID) + req.Header = e2enginehttp.WithTestExecutionID(req.Header, testExecutionID) if spec.Body != "" && req.Header.Get("Content-Type") == "" { diff --git a/execute/worker/http/executor_test.go b/execute/worker/http/executor_test.go index a3de675..5865670 100644 --- a/execute/worker/http/executor_test.go +++ b/execute/worker/http/executor_test.go @@ -9,9 +9,10 @@ import ( "reflect" "testing" + e2enginehttp "github.com/e2engine/instrumentation-go/http" + "github.com/e2engine/core/execute" "github.com/e2engine/core/model" - "github.com/e2engine/core/pkg/keys" ) func TestBuildHTTPRequest(t *testing.T) { @@ -112,15 +113,11 @@ func TestBuildHTTPRequest(t *testing.T) { ) } - if req.Header.Get( - string(keys.E2EngineTestExecutionID), - ) != "execution-123" { + if id := e2enginehttp.TestExecutionID(req.Header); id != "execution-123" { t.Errorf( "expected execution ID header %q, got %q", "execution-123", - req.Header.Get( - string(keys.E2EngineTestExecutionID), - ), + id, ) } @@ -222,15 +219,15 @@ func TestBuildHTTPRequestHeaders(t *testing.T) { spec := &model.HTTPRequestSpec{ Method: nethttp.MethodGet, URL: "https://example.com/users", - Headers: nethttp.Header{ - "X-Test": { - "value-1", - "value-2", - }, - string(keys.E2EngineTestExecutionID): { - "user-value", + Headers: e2enginehttp.WithTestExecutionID( + nethttp.Header{ + "X-Test": { + "value-1", + "value-2", + }, }, - }, + "user-value", + ), } req, err := buildHTTPRequest( @@ -255,17 +252,10 @@ func TestBuildHTTPRequestHeaders(t *testing.T) { ) } - values := req.Header.Values( - string(keys.E2EngineTestExecutionID), - ) - - if !reflect.DeepEqual( - values, - []string{"execution-123"}, - ) { + if id := e2enginehttp.TestExecutionID(req.Header); id != "execution-123" { t.Errorf( - "expected execution header to be overridden, got %#v", - values, + "expected execution header to be overridden, got %s", + id, ) } } @@ -413,15 +403,11 @@ func TestExecutorExecute(t *testing.T) { w nethttp.ResponseWriter, r *nethttp.Request, ) { - if r.Header.Get( - string(keys.E2EngineTestExecutionID), - ) != "execution-123" { + if id := e2enginehttp.TestExecutionID(r.Header); id != "execution-123" { t.Errorf( "expected execution ID %q, got %q", "execution-123", - r.Header.Get( - string(keys.E2EngineTestExecutionID), - ), + id, ) } diff --git a/go.mod b/go.mod index 161d938..df9067e 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,9 @@ go 1.27 require ( github.com/bufbuild/protocompile v0.14.1 + github.com/e2engine/instrumentation-go v0.1.0 + github.com/e2engine/instrumentation-go/grpc v0.1.0 + github.com/e2engine/instrumentation-go/http v0.1.0 github.com/ygrebnov/errorc v0.6.1 github.com/ygrebnov/keys v0.2.0 github.com/ygrebnov/log v0.4.4 diff --git a/go.sum b/go.sum index 8a74eb2..d92a7ca 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,12 @@ github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/ github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/e2engine/instrumentation-go v0.1.0 h1:2vp9pen83xfcQPhGTRcGMD86m6Tvhq7HB9GcahttGqM= +github.com/e2engine/instrumentation-go v0.1.0/go.mod h1:zpWF7koAp+vFqYAfOx3mOJFn4GpLtzetguAs8n7+wIE= +github.com/e2engine/instrumentation-go/grpc v0.1.0 h1:zSU2eIL2gA/0n7HjQh4LTA3vI5u5hK7g63Psi+HP4EU= +github.com/e2engine/instrumentation-go/grpc v0.1.0/go.mod h1:b9oDN/J5Pdv8Ny/qeHfFjZ7UwF7KHesKSm//p2b1upw= +github.com/e2engine/instrumentation-go/http v0.1.0 h1:16VY0vkSqgSNJcYUT+tE3vn1uPEBcgL8bHLjKugnOvo= +github.com/e2engine/instrumentation-go/http v0.1.0/go.mod h1:IPrXs81CHYPSn2NeKInAqZGFgfvHXOF1KsESVMxJegs= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= @@ -20,26 +26,16 @@ github.com/ygrebnov/model v0.7.5 h1:9i7Xz5vxYQXeJW06gTE9/In49f0lEDhulmsBKhsQxWw= github.com/ygrebnov/model v0.7.5/go.mod h1:qYRz8F/yrt01bPyANAlN0Oqi1fwpgvvl21hjW/NK6N0= go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= -golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= -golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= golang.org/x/net v0.59.0 h1:5zfYln+w5XCxwrnMMJPufRgNoXEaGxl0wo5GqPXyues= golang.org/x/net v0.59.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= -golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= -golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= -golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= -golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= -golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= -golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260706201446-f0a921348800 h1:qEHAMpSaUhtD0p3NbEEI83HwNGFxEwaSJ1G9PLnCBZE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260706201446-f0a921348800/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc h1:4bNTbnb44EqGVy9HaQxSY2jnafSUdgV3qHtedvNpDKg= google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= google.golang.org/grpc v1.84.0 h1:soMyaPJ8pAak5PIQ0DGBUir0XRo2fRoMqhNWMLlLxO0= diff --git a/pkg/keys/keys.go b/pkg/keys/keys.go index 77e40c3..6327dfd 100644 --- a/pkg/keys/keys.go +++ b/pkg/keys/keys.go @@ -3,24 +3,20 @@ package keys import "github.com/ygrebnov/keys" var ( - file = keys.Factory(keys.WithSegments("file")) - entity = keys.Factory(keys.WithSegments("entity")) - cursor = keys.Factory(keys.WithSegments("cursor")) - spec = keys.Factory(keys.WithSegments("spec")) - environment = keys.Factory(keys.WithSegments("environment")) - environmentService = keys.Factory(keys.WithSegments("environment", "service")) - request = keys.Factory(keys.WithSegments("request")) - execution = keys.Factory(keys.WithSegments("execution")) - test = keys.Factory(keys.WithSegments("test")) - testsuite = keys.Factory(keys.WithSegments("testsuite")) - http = keys.Factory(keys.WithSegments("http")) - grpc = keys.Factory(keys.WithSegments("grpc")) - e2engineTestExecution = keys.Factory( - keys.WithSegments("e2engine", "test", "execution"), - keys.WithSeparator('-'), - ) - message = keys.Factory(keys.WithSegments("message")) - socket = keys.Factory(keys.WithSegments("socket")) + file = keys.Factory(keys.WithSegments("file")) + entity = keys.Factory(keys.WithSegments("entity")) + cursor = keys.Factory(keys.WithSegments("cursor")) + spec = keys.Factory(keys.WithSegments("spec")) + environment = keys.Factory(keys.WithSegments("environment")) + environmentService = keys.Factory(keys.WithSegments("environment", "service")) + request = keys.Factory(keys.WithSegments("request")) + execution = keys.Factory(keys.WithSegments("execution")) + test = keys.Factory(keys.WithSegments("test")) + testsuite = keys.Factory(keys.WithSegments("testsuite")) + http = keys.Factory(keys.WithSegments("http")) + grpc = keys.Factory(keys.WithSegments("grpc")) + message = keys.Factory(keys.WithSegments("message")) + socket = keys.Factory(keys.WithSegments("socket")) ) var ( @@ -65,8 +61,6 @@ var ( TestSuiteMaxTestsNumber = testsuite("max.tests.number") TestSuiteResolvedTestsNumber = testsuite("resolved.tests.number") - E2EngineTestExecutionID = e2engineTestExecution("id") - MessageType = message("type") SocketAddress = socket("address") SocketReadDeadline = socket("read.deadline") From 19792677317cb87f126b5f15e58efee442e99a9b Mon Sep 17 00:00:00 2001 From: Yaroslav Grebnov Date: Fri, 9 Oct 2026 00:07:09 +0200 Subject: [PATCH 2/3] Update README --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5c31bdc..839a519 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Core domain model, execution logic, and public APIs for E2Engine. +Part of [E2Engine](https://e2engine.dev), an open-source platform for declarative end-to-end testing. + This module provides the shared models and execution components used across E2Engine, including test and environment definitions, test execution, runtime service management, scheduling, persistence interfaces, and transport primitives. ## Installation @@ -22,7 +24,7 @@ Core E2Engine domain models, validation, and shared types. **repository** -E2Engine repositories contracts for persistence of environments, tests, test suites, and execution state. +E2Engine repository contracts for persistence of environments, tests, test suites, and execution state. **execute** @@ -71,8 +73,9 @@ This repository is part of E2Engine. - [runner-local](https://github.com/e2engine/runner-local) — local test execution - [cli](https://github.com/e2engine/cli) — command-line interface - [tests](https://github.com/e2engine/tests) — end-to-end tests for E2Engine -- demo — executable demonstration system and E2Engine usage examples +- [demo](https://github.com/e2engine/demo) — executable demonstration system and E2Engine usage examples +- [instrumentation-go](https://github.com/e2engine/instrumentation-go) — Go instrumentation library for E2Engine ## License -Licensed under the Apache License, Version 2.0. \ No newline at end of file +Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE). \ No newline at end of file From 23d4c13485e27105835613f8d628d55fd0db3245 Mon Sep 17 00:00:00 2001 From: Yaroslav Grebnov Date: Fri, 9 Oct 2026 00:09:22 +0200 Subject: [PATCH 3/3] Update dependabot config --- .github/dependabot.yml | 5 ++++- .github/workflows/build.yml | 3 +++ go.mod | 6 +++--- go.sum | 6 ++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4af6a77..757eb95 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,10 @@ version: 2 + updates: - package-ecosystem: "gomod" - directory: "/" + directories: + - "/" + - "/tools" schedule: interval: "weekly" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03202d9..831d86f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,3 +20,6 @@ jobs: - name: Verify run: make verify + + - name: Verify + run: make verify diff --git a/go.mod b/go.mod index df9067e..49f00ea 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.27 require ( github.com/bufbuild/protocompile v0.14.1 - github.com/e2engine/instrumentation-go v0.1.0 - github.com/e2engine/instrumentation-go/grpc v0.1.0 - github.com/e2engine/instrumentation-go/http v0.1.0 + github.com/e2engine/instrumentation-go v0.1.1 + github.com/e2engine/instrumentation-go/grpc v0.1.1 + github.com/e2engine/instrumentation-go/http v0.1.1 github.com/ygrebnov/errorc v0.6.1 github.com/ygrebnov/keys v0.2.0 github.com/ygrebnov/log v0.4.4 diff --git a/go.sum b/go.sum index d92a7ca..718d54d 100644 --- a/go.sum +++ b/go.sum @@ -4,10 +4,16 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/e2engine/instrumentation-go v0.1.0 h1:2vp9pen83xfcQPhGTRcGMD86m6Tvhq7HB9GcahttGqM= github.com/e2engine/instrumentation-go v0.1.0/go.mod h1:zpWF7koAp+vFqYAfOx3mOJFn4GpLtzetguAs8n7+wIE= +github.com/e2engine/instrumentation-go v0.1.1 h1:pkOQIQWWkGqHdU1F/b0tCtpFyNDc09kKebYZElHZS9k= +github.com/e2engine/instrumentation-go v0.1.1/go.mod h1:zpWF7koAp+vFqYAfOx3mOJFn4GpLtzetguAs8n7+wIE= github.com/e2engine/instrumentation-go/grpc v0.1.0 h1:zSU2eIL2gA/0n7HjQh4LTA3vI5u5hK7g63Psi+HP4EU= github.com/e2engine/instrumentation-go/grpc v0.1.0/go.mod h1:b9oDN/J5Pdv8Ny/qeHfFjZ7UwF7KHesKSm//p2b1upw= +github.com/e2engine/instrumentation-go/grpc v0.1.1 h1:0sqxF3oCdxdVaJwzTshaf79VMXglVHJQ1bLte7vnH14= +github.com/e2engine/instrumentation-go/grpc v0.1.1/go.mod h1:l74IeAGD1lOKbrc/rqQJ3qHvrQF1rvefC50v8unCo1U= github.com/e2engine/instrumentation-go/http v0.1.0 h1:16VY0vkSqgSNJcYUT+tE3vn1uPEBcgL8bHLjKugnOvo= github.com/e2engine/instrumentation-go/http v0.1.0/go.mod h1:IPrXs81CHYPSn2NeKInAqZGFgfvHXOF1KsESVMxJegs= +github.com/e2engine/instrumentation-go/http v0.1.1 h1:Xu+yRVgv6jsq7eBLzeOeccwM0dyNz2ga1ybaXNUFhTk= +github.com/e2engine/instrumentation-go/http v0.1.1/go.mod h1:dFgPXV8kq17HHTecABNLaAio8td8LtdiNj9cZYS6Kng= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=