From d20bd80315979c36ad9f15015035f5d18869379f Mon Sep 17 00:00:00 2001 From: Robert Lin Date: Fri, 24 Nov 2023 13:26:34 -0800 Subject: [PATCH] graphqlbackend/telemetry: add and export interaction ID (#58539) #58016 adds a lightweight standard for propagating interaction ID via `X-Sourcegraph-Interaction-ID` - however, clientside, the recent implementations have all centered around explicitly providing and interaction ID when recording events. This change adds an option to the GraphQL `telemetry { recordEvent }` mutation to accommodate this pattern as a first-class citizen. I'll update various client integrations in a follow-up. --- cmd/frontend/graphqlbackend/telemetry.go | 1 + cmd/frontend/graphqlbackend/telemetry.graphql | 8 +++ cmd/frontend/graphqlbackend/telemetry_test.go | 25 ++++++++ .../telemetry/resolvers/telemetrygateway.go | 59 +++++++++-------- .../telemetry/protocol.md | 1 + internal/telemetrygateway/v1/BUILD.bazel | 1 + internal/telemetrygateway/v1/event.go | 14 ++++- .../v1/telemetrygateway.pb.go | 63 +++++++++++-------- .../v1/telemetrygateway.proto | 4 +- 9 files changed, 121 insertions(+), 55 deletions(-) diff --git a/cmd/frontend/graphqlbackend/telemetry.go b/cmd/frontend/graphqlbackend/telemetry.go index da0c692883172..08ea398b7f134 100644 --- a/cmd/frontend/graphqlbackend/telemetry.go +++ b/cmd/frontend/graphqlbackend/telemetry.go @@ -36,6 +36,7 @@ type TelemetryEventParametersInput struct { Metadata *[]TelemetryEventMetadataInput `json:"metadata,omitempty"` PrivateMetadata *JSONValue `json:"privateMetadata,omitempty"` BillingMetadata *TelemetryEventBillingMetadataInput `json:"billingMetadata,omitempty"` + InteractionID *string `json:"interactionID,omitempty"` } type TelemetryEventMetadataInput struct { diff --git a/cmd/frontend/graphqlbackend/telemetry.graphql b/cmd/frontend/graphqlbackend/telemetry.graphql index 3233efa6bb3c2..8d9f36fb27212 100644 --- a/cmd/frontend/graphqlbackend/telemetry.graphql +++ b/cmd/frontend/graphqlbackend/telemetry.graphql @@ -98,6 +98,14 @@ input TelemetryEventParametersInput { Billing-related metadata. """ billingMetadata: TelemetryEventBillingMetadataInput + """ + Optional interaction ID that can be provided to indicate the interaction + this event belongs to. It overrides the X-Sourcegraph-Interaction-ID header + if one is set on the request recording the event. + + This parameter is only available in Sourcegraph 5.2.4 and later. + """ + interactionID: String } """ diff --git a/cmd/frontend/graphqlbackend/telemetry_test.go b/cmd/frontend/graphqlbackend/telemetry_test.go index 4a2fcdc3c6ad7..4795882ca045e 100644 --- a/cmd/frontend/graphqlbackend/telemetry_test.go +++ b/cmd/frontend/graphqlbackend/telemetry_test.go @@ -7,6 +7,7 @@ import ( "github.com/graph-gophers/graphql-go" gqlerrors "github.com/graph-gophers/graphql-go/errors" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/protobuf/types/known/structpb" @@ -33,6 +34,30 @@ func TestTelemetryRecordEvents(t *testing.T) { // Assertions on received events. assert func(t *testing.T, gotEvents []TelemetryEventInput) }{ + { + name: "simple event with interaction ID", + gqlEventsInput: ` + { + feature: "cody.fixup" + action: "applied" + source: { + client: "VSCode.Cody" + clientVersion: "0.14.1" + } + parameters: { + version: 0 + interactionID: "f1d1b784-c69b-4ca4-802a-4dcbca7d660f" + } + } + `, + assert: func(t *testing.T, gotEvents []TelemetryEventInput) { + require.Len(t, gotEvents, 1) + assert.NotNil(t, gotEvents[0].Parameters) + assert.NotNil(t, gotEvents[0].Parameters.InteractionID) + assert.Equal(t, "f1d1b784-c69b-4ca4-802a-4dcbca7d660f", + *gotEvents[0].Parameters.InteractionID) + }, + }, { name: "object privateMetadata", gqlEventsInput: ` diff --git a/cmd/frontend/internal/telemetry/resolvers/telemetrygateway.go b/cmd/frontend/internal/telemetry/resolvers/telemetrygateway.go index cb7e184f57912..031f734e69b8d 100644 --- a/cmd/frontend/internal/telemetry/resolvers/telemetrygateway.go +++ b/cmd/frontend/internal/telemetry/resolvers/telemetrygateway.go @@ -16,19 +16,28 @@ func newTelemetryGatewayEvents( ctx context.Context, now time.Time, newUUID func() string, - events []graphqlbackend.TelemetryEventInput, + gqlEvents []graphqlbackend.TelemetryEventInput, ) ([]*telemetrygatewayv1.Event, error) { - gatewayEvents := make([]*telemetrygatewayv1.Event, len(events)) - for i, e := range events { + gatewayEvents := make([]*telemetrygatewayv1.Event, len(gqlEvents)) + for i, gqlEvent := range gqlEvents { event := telemetrygatewayv1.NewEventWithDefaults(ctx, now, newUUID) - event.Feature = e.Feature - event.Action = e.Action + event.Feature = gqlEvent.Feature + event.Action = gqlEvent.Action + + // Override interaction ID, or just set it, if an interaction ID is + // explicitly provided as part of event data. + if gqlEvent.Parameters.InteractionID != nil && len(*gqlEvent.Parameters.InteractionID) > 0 { + if event.Interaction == nil { + event.Interaction = &telemetrygatewayv1.EventInteraction{} + } + event.Interaction.InteractionId = gqlEvent.Parameters.InteractionID + } // Parse private metadata var privateMetadata *structpb.Struct - if e.Parameters.PrivateMetadata != nil { - switch v := e.Parameters.PrivateMetadata.Value.(type) { + if gqlEvent.Parameters.PrivateMetadata != nil { + switch v := gqlEvent.Parameters.PrivateMetadata.Value.(type) { // If the input is an object, turn it into proto struct as-is case map[string]any: var err error @@ -51,25 +60,25 @@ func newTelemetryGatewayEvents( // Configure parameters event.Parameters = &telemetrygatewayv1.EventParameters{ - Version: e.Parameters.Version, + Version: gqlEvent.Parameters.Version, Metadata: func() map[string]int64 { - if e.Parameters.Metadata == nil || len(*e.Parameters.Metadata) == 0 { + if gqlEvent.Parameters.Metadata == nil || len(*gqlEvent.Parameters.Metadata) == 0 { return nil } - metadata := make(map[string]int64, len(*e.Parameters.Metadata)) - for _, kv := range *e.Parameters.Metadata { + metadata := make(map[string]int64, len(*gqlEvent.Parameters.Metadata)) + for _, kv := range *gqlEvent.Parameters.Metadata { metadata[kv.Key] = int64(kv.Value) } return metadata }(), PrivateMetadata: privateMetadata, BillingMetadata: func() *telemetrygatewayv1.EventBillingMetadata { - if e.Parameters.BillingMetadata == nil { + if gqlEvent.Parameters.BillingMetadata == nil { return nil } return &telemetrygatewayv1.EventBillingMetadata{ - Product: e.Parameters.BillingMetadata.Product, - Category: e.Parameters.BillingMetadata.Category, + Product: gqlEvent.Parameters.BillingMetadata.Product, + Category: gqlEvent.Parameters.BillingMetadata.Category, } }(), } @@ -78,21 +87,21 @@ func newTelemetryGatewayEvents( Version: version.Version(), }, Client: &telemetrygatewayv1.EventSource_Client{ - Name: e.Source.Client, - Version: e.Source.ClientVersion, + Name: gqlEvent.Source.Client, + Version: gqlEvent.Source.ClientVersion, }, } - if e.MarketingTracking != nil { + if gqlEvent.MarketingTracking != nil { event.MarketingTracking = &telemetrygatewayv1.EventMarketingTracking{ - Url: e.MarketingTracking.Url, - FirstSourceUrl: e.MarketingTracking.FirstSourceURL, - CohortId: e.MarketingTracking.CohortID, - Referrer: e.MarketingTracking.Referrer, - LastSourceUrl: e.MarketingTracking.LastSourceURL, - DeviceSessionId: e.MarketingTracking.DeviceSessionID, - SessionReferrer: e.MarketingTracking.SessionReferrer, - SessionFirstUrl: e.MarketingTracking.SessionFirstURL, + Url: gqlEvent.MarketingTracking.Url, + FirstSourceUrl: gqlEvent.MarketingTracking.FirstSourceURL, + CohortId: gqlEvent.MarketingTracking.CohortID, + Referrer: gqlEvent.MarketingTracking.Referrer, + LastSourceUrl: gqlEvent.MarketingTracking.LastSourceURL, + DeviceSessionId: gqlEvent.MarketingTracking.DeviceSessionID, + SessionReferrer: gqlEvent.MarketingTracking.SessionReferrer, + SessionFirstUrl: gqlEvent.MarketingTracking.SessionFirstURL, } } diff --git a/doc/dev/background-information/telemetry/protocol.md b/doc/dev/background-information/telemetry/protocol.md index 2949ebcca17c0..daf02f89969a4 100644 --- a/doc/dev/background-information/telemetry/protocol.md +++ b/doc/dev/background-information/telemetry/protocol.md @@ -127,6 +127,7 @@ This page contains generated documentation for telemetry event data that gets ex | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | trace_id | [string](#string) | optional |

OpenTelemetry trace ID representing the interaction associated with the event.

| +| interaction_id | [string](#string) | optional |

Custom interaction ID representing the interaction associated with the event.

| | geolocation | [EventInteraction.Geolocation](#telemetrygateway-v1-EventInteraction-Geolocation) | optional |

Geolocation associated with the interaction, typically inferred from the

originating client's IP address (which we do not collect).

| diff --git a/internal/telemetrygateway/v1/BUILD.bazel b/internal/telemetrygateway/v1/BUILD.bazel index 773ab6e2a35ed..dffb80c8ffd5d 100644 --- a/internal/telemetrygateway/v1/BUILD.bazel +++ b/internal/telemetrygateway/v1/BUILD.bazel @@ -55,6 +55,7 @@ go_library( "//internal/actor", "//internal/featureflag", "//internal/requestclient", + "//internal/requestinteraction", "//internal/trace", "//lib/pointers", "@com_github_google_uuid//:uuid", diff --git a/internal/telemetrygateway/v1/event.go b/internal/telemetrygateway/v1/event.go index 29a93bd19e034..174ac84c8c7a4 100644 --- a/internal/telemetrygateway/v1/event.go +++ b/internal/telemetrygateway/v1/event.go @@ -11,6 +11,7 @@ import ( "github.com/sourcegraph/sourcegraph/internal/actor" "github.com/sourcegraph/sourcegraph/internal/featureflag" "github.com/sourcegraph/sourcegraph/internal/requestclient" + "github.com/sourcegraph/sourcegraph/internal/requestinteraction" "github.com/sourcegraph/sourcegraph/internal/trace" "github.com/sourcegraph/sourcegraph/lib/pointers" ) @@ -35,6 +36,12 @@ func NewEventWithDefaults(ctx context.Context, now time.Time, newEventID func() traceID = pointers.Ptr(eventTrace.TraceID().String()) } + // Get the interaction ID if provided + var interactionID *string + if it := requestinteraction.FromContext(ctx); it != nil { + interactionID = pointers.Ptr(it.ID) + } + // Get geolocation of request client, if there is one. var geolocation *EventInteraction_Geolocation if rc := requestclient.FromContext(ctx); rc != nil { @@ -47,13 +54,14 @@ func NewEventWithDefaults(ctx context.Context, now time.Time, newEventID func() // If we have nothing interesting to show, leave out Interaction // entirely. - if traceID == nil && geolocation == nil { + if traceID == nil && interactionID == nil && geolocation == nil { return nil } return &EventInteraction{ - TraceId: traceID, - Geolocation: geolocation, + TraceId: traceID, + InteractionId: interactionID, + Geolocation: geolocation, } }(), User: func() *EventUser { diff --git a/internal/telemetrygateway/v1/telemetrygateway.pb.go b/internal/telemetrygateway/v1/telemetrygateway.pb.go index b89664c6017bc..09659081087e3 100644 --- a/internal/telemetrygateway/v1/telemetrygateway.pb.go +++ b/internal/telemetrygateway/v1/telemetrygateway.pb.go @@ -881,6 +881,8 @@ type EventInteraction struct { // OpenTelemetry trace ID representing the interaction associated with the event. TraceId *string `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,oneof" json:"trace_id,omitempty"` + // Custom interaction ID representing the interaction associated with the event. + InteractionId *string `protobuf:"bytes,2,opt,name=interaction_id,json=interactionId,proto3,oneof" json:"interaction_id,omitempty"` // Geolocation associated with the interaction, typically inferred from the // originating client's IP address (which we do not collect). Geolocation *EventInteraction_Geolocation `protobuf:"bytes,3,opt,name=geolocation,proto3,oneof" json:"geolocation,omitempty"` @@ -925,6 +927,13 @@ func (x *EventInteraction) GetTraceId() string { return "" } +func (x *EventInteraction) GetInteractionId() string { + if x != nil && x.InteractionId != nil { + return *x.InteractionId + } + return "" +} + func (x *EventInteraction) GetGeolocation() *EventInteraction_Geolocation { if x != nil { return x.Geolocation @@ -1436,34 +1445,38 @@ var file_telemetrygateway_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x75, 0x72, - 0x6c, 0x22, 0xe1, 0x01, 0x0a, 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, + 0x6c, 0x22, 0x9a, 0x02, 0x0a, 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, - 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x58, 0x0a, 0x0b, 0x67, 0x65, 0x6f, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x74, 0x65, + 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, + 0x52, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, + 0x01, 0x01, 0x12, 0x58, 0x0a, 0x0b, 0x67, 0x65, 0x6f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x74, 0x72, 0x79, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, + 0x65, 0x6f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x02, 0x52, 0x0b, 0x67, 0x65, + 0x6f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x1a, 0x30, 0x0a, 0x0b, + 0x47, 0x65, 0x6f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x0b, + 0x0a, 0x09, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x42, 0x11, 0x0a, 0x0f, 0x5f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x0e, + 0x0a, 0x0c, 0x5f, 0x67, 0x65, 0x6f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x85, + 0x01, 0x0a, 0x18, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x79, 0x47, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, 0x0c, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x28, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, - 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x6f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x01, - 0x52, 0x0b, 0x67, 0x65, 0x6f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, - 0x1a, 0x30, 0x0a, 0x0b, 0x47, 0x65, 0x6f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x43, 0x6f, - 0x64, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x42, - 0x0e, 0x0a, 0x0c, 0x5f, 0x67, 0x65, 0x6f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4a, - 0x04, 0x08, 0x02, 0x10, 0x03, 0x32, 0x85, 0x01, 0x0a, 0x18, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x69, 0x0a, 0x0c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x28, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x67, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x74, - 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, - 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x41, 0x5a, - 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, - 0x61, 0x70, 0x68, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x6c, - 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, + 0x79, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/internal/telemetrygateway/v1/telemetrygateway.proto b/internal/telemetrygateway/v1/telemetrygateway.proto index 527aaabd09f2f..9cc6ff0d9edec 100644 --- a/internal/telemetrygateway/v1/telemetrygateway.proto +++ b/internal/telemetrygateway/v1/telemetrygateway.proto @@ -204,8 +204,8 @@ message EventMarketingTracking { message EventInteraction { // OpenTelemetry trace ID representing the interaction associated with the event. optional string trace_id = 1; - // Reserve entry for client-provided interaction ID in follow-up change. - reserved 2; + // Custom interaction ID representing the interaction associated with the event. + optional string interaction_id = 2; message Geolocation { // Inferred ISO 3166-1 alpha-2 or alpha-3 country code