diff --git a/buf.lock b/buf.lock index c6b7e8e3b3a..5e8e6b51fb8 100644 --- a/buf.lock +++ b/buf.lock @@ -8,5 +8,5 @@ deps: commit: 62f35d8aed1149c291d606d958a7ce32 digest: b5:d66bf04adc77a0870bdc9328aaf887c7188a36fb02b83a480dc45ef9dc031b4d39fc6e9dc6435120ccf4fe5bfd5c6cb6592533c6c316595571f9a31420ab47fe - name: buf.build/grpc-ecosystem/grpc-gateway - commit: 6467306b4f624747aaf6266762ee7a1c - digest: b5:c2caa61467d992749812c909f93c07e9a667da33c758a7c1973d63136c23b3cafcc079985b12cdf54a10049ed3297418f1eda42cdffdcf34113792dcc3a990af + commit: 4836b6d552304e1bbe47e66a523f0daa + digest: b5:c3fefd4d3dfa9b0478bbb1a4ad87d7b38146e3ce6eff4214e32f2c5834c2e4afc3be218316f0fbd53e925a001c3ed1e2fc99fb76b3121ede642989f0d0d7c71c diff --git a/flytestdlib/contextutils/context.go b/flytestdlib/contextutils/context.go index 504ce767e9b..b613acd67a4 100644 --- a/flytestdlib/contextutils/context.go +++ b/flytestdlib/contextutils/context.go @@ -29,6 +29,9 @@ const ( ResourceVersionKey Key = "res_ver" SignalIDKey Key = "signal" RequestIDKey Key = "x-request-id" + OrganizationKey Key = "org" + ServiceNameKey Key = "service_name" + ClusterNameKey Key = "cluster_id" ) func (k Key) String() string { @@ -39,6 +42,7 @@ var logKeys = []Key{ AppNameKey, JobIDKey, NamespaceKey, + OrganizationKey, ExecIDKey, NodeIDKey, WorkflowIDKey, @@ -48,6 +52,10 @@ var logKeys = []Key{ LaunchPlanIDKey, ResourceVersionKey, RequestIDKey, + ProjectKey, + DomainKey, + ServiceNameKey, + ClusterNameKey, } // MetricKeysFromStrings is a convenience method to convert a slice of strings into a slice of Keys diff --git a/flytestdlib/contextutils/context_test.go b/flytestdlib/contextutils/context_test.go index 976a2184bea..89aafe62425 100644 --- a/flytestdlib/contextutils/context_test.go +++ b/flytestdlib/contextutils/context_test.go @@ -112,10 +112,19 @@ func TestWithSignalID(t *testing.T) { func TestGetFields(t *testing.T) { ctx := context.Background() ctx = WithRequestID(WithJobID(WithNamespace(ctx, "ns123"), "job123"), "req123") + ctx = WithProjectDomain(ctx, "proj1", "dev") + ctx = context.WithValue(ctx, OrganizationKey, "org1") + ctx = context.WithValue(ctx, ServiceNameKey, "svc1") + ctx = context.WithValue(ctx, ClusterNameKey, "cluster1") m := GetLogFields(ctx) assert.Equal(t, "ns123", m[NamespaceKey.String()]) assert.Equal(t, "job123", m[JobIDKey.String()]) assert.Equal(t, "req123", m[RequestIDKey.String()]) + assert.Equal(t, "proj1", m[ProjectKey.String()]) + assert.Equal(t, "dev", m[DomainKey.String()]) + assert.Equal(t, "org1", m[OrganizationKey.String()]) + assert.Equal(t, "svc1", m[ServiceNameKey.String()]) + assert.Equal(t, "cluster1", m[ClusterNameKey.String()]) } func TestValues(t *testing.T) {