Add integration enroll usage event (#26880)

* Add integration enroll usage event

* Add new events to the frontend
This commit is contained in:
Lisa Kim 2023-05-25 09:51:04 -07:00 committed by GitHub
parent 83a64c1eec
commit 4d8f2d20e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 3185 additions and 820 deletions

File diff suppressed because it is too large Load diff

View file

@ -316,6 +316,47 @@ message AssistCompletionEvent {
int64 completion_tokens = 4;
}
// IntegrationEnrollKind represents the types of integration that
// can be enrolled.
enum IntegrationEnrollKind {
INTEGRATION_ENROLL_KIND_UNSPECIFIED = 0;
INTEGRATION_ENROLL_KIND_SLACK = 1;
INTEGRATION_ENROLL_KIND_AWS_OIDC = 2;
INTEGRATION_ENROLL_KIND_PAGERDUTY = 3;
INTEGRATION_ENROLL_KIND_EMAIL = 4;
INTEGRATION_ENROLL_KIND_JIRA = 5;
INTEGRATION_ENROLL_KIND_DISCORD = 6;
INTEGRATION_ENROLL_KIND_MATTERMOST = 7;
INTEGRATION_ENROLL_KIND_MS_TEAMS = 8;
INTEGRATION_ENROLL_KIND_OPSGENIE = 9;
INTEGRATION_ENROLL_KIND_OKTA = 10;
INTEGRATION_ENROLL_KIND_JAMF = 11;
}
// IntegrationEnrollMetadata contains common metadata
// for Integration Enroll related events.
message IntegrationEnrollMetadata {
// id is used as a unique identifier to correlate events within the
// same enroll wizard run.
string id = 1;
// kind identifies what type of integration the user clicked on to enroll.
IntegrationEnrollKind kind = 2;
// user_name is anonymized.
string user_name = 3;
}
// UIIntegrationEnrollEvent is an event that is emitted when a user
// clicks on a integration to enroll.
message UIIntegrationEnrollStartEvent {
IntegrationEnrollMetadata metadata = 1;
}
// UIIntegrationEnrollEvent is an event that is emitted when a user
// completed enrolling an integration.
message UIIntegrationEnrollCompleteEvent {
IntegrationEnrollMetadata metadata = 1;
}
// UsageEventOneOf is a message that can accept a oneof of any supported
// external usage event.
message UsageEventOneOf {
@ -349,6 +390,8 @@ message UsageEventOneOf {
UIDiscoverDatabaseRDSEnrollEvent ui_discover_database_rds_enroll_event = 28;
UICallToActionClickEvent ui_call_to_action_click_event = 29;
AssistCompletionEvent assist_completion = 30;
UIIntegrationEnrollStartEvent ui_integration_enroll_start_event = 31;
UIIntegrationEnrollCompleteEvent ui_integration_enroll_complete_event = 32;
}
reserved 2; //UIOnboardGetStartedClickEvent
reserved "ui_onboard_get_started_click";

File diff suppressed because it is too large Load diff

View file

@ -1274,6 +1274,83 @@ export namespace AssistCompletionEvent {
}
}
export class IntegrationEnrollMetadata extends jspb.Message {
getId(): string;
setId(value: string): IntegrationEnrollMetadata;
getKind(): IntegrationEnrollKind;
setKind(value: IntegrationEnrollKind): IntegrationEnrollMetadata;
getUserName(): string;
setUserName(value: string): IntegrationEnrollMetadata;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): IntegrationEnrollMetadata.AsObject;
static toObject(includeInstance: boolean, msg: IntegrationEnrollMetadata): IntegrationEnrollMetadata.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: IntegrationEnrollMetadata, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): IntegrationEnrollMetadata;
static deserializeBinaryFromReader(message: IntegrationEnrollMetadata, reader: jspb.BinaryReader): IntegrationEnrollMetadata;
}
export namespace IntegrationEnrollMetadata {
export type AsObject = {
id: string,
kind: IntegrationEnrollKind,
userName: string,
}
}
export class UIIntegrationEnrollStartEvent extends jspb.Message {
hasMetadata(): boolean;
clearMetadata(): void;
getMetadata(): IntegrationEnrollMetadata | undefined;
setMetadata(value?: IntegrationEnrollMetadata): UIIntegrationEnrollStartEvent;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UIIntegrationEnrollStartEvent.AsObject;
static toObject(includeInstance: boolean, msg: UIIntegrationEnrollStartEvent): UIIntegrationEnrollStartEvent.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: UIIntegrationEnrollStartEvent, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): UIIntegrationEnrollStartEvent;
static deserializeBinaryFromReader(message: UIIntegrationEnrollStartEvent, reader: jspb.BinaryReader): UIIntegrationEnrollStartEvent;
}
export namespace UIIntegrationEnrollStartEvent {
export type AsObject = {
metadata?: IntegrationEnrollMetadata.AsObject,
}
}
export class UIIntegrationEnrollCompleteEvent extends jspb.Message {
hasMetadata(): boolean;
clearMetadata(): void;
getMetadata(): IntegrationEnrollMetadata | undefined;
setMetadata(value?: IntegrationEnrollMetadata): UIIntegrationEnrollCompleteEvent;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UIIntegrationEnrollCompleteEvent.AsObject;
static toObject(includeInstance: boolean, msg: UIIntegrationEnrollCompleteEvent): UIIntegrationEnrollCompleteEvent.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: UIIntegrationEnrollCompleteEvent, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): UIIntegrationEnrollCompleteEvent;
static deserializeBinaryFromReader(message: UIIntegrationEnrollCompleteEvent, reader: jspb.BinaryReader): UIIntegrationEnrollCompleteEvent;
}
export namespace UIIntegrationEnrollCompleteEvent {
export type AsObject = {
metadata?: IntegrationEnrollMetadata.AsObject,
}
}
export class SubmitEventRequest extends jspb.Message {
getClusterName(): string;
setClusterName(value: string): SubmitEventRequest;
@ -1525,6 +1602,18 @@ export class SubmitEventRequest extends jspb.Message {
setAssistCompletion(value?: AssistCompletionEvent): SubmitEventRequest;
hasUiIntegrationEnrollStartEvent(): boolean;
clearUiIntegrationEnrollStartEvent(): void;
getUiIntegrationEnrollStartEvent(): UIIntegrationEnrollStartEvent | undefined;
setUiIntegrationEnrollStartEvent(value?: UIIntegrationEnrollStartEvent): SubmitEventRequest;
hasUiIntegrationEnrollCompleteEvent(): boolean;
clearUiIntegrationEnrollCompleteEvent(): void;
getUiIntegrationEnrollCompleteEvent(): UIIntegrationEnrollCompleteEvent | undefined;
setUiIntegrationEnrollCompleteEvent(value?: UIIntegrationEnrollCompleteEvent): SubmitEventRequest;
getEventCase(): SubmitEventRequest.EventCase;
serializeBinary(): Uint8Array;
@ -1581,6 +1670,8 @@ export namespace SubmitEventRequest {
uiDiscoverDatabaseRdsEnrollEvent?: UIDiscoverDatabaseRDSEnrollEvent.AsObject,
uiCallToActionClickEvent?: UICallToActionClickEvent.AsObject,
assistCompletion?: AssistCompletionEvent.AsObject,
uiIntegrationEnrollStartEvent?: UIIntegrationEnrollStartEvent.AsObject,
uiIntegrationEnrollCompleteEvent?: UIIntegrationEnrollCompleteEvent.AsObject,
}
export enum EventCase {
@ -1666,6 +1757,10 @@ export namespace SubmitEventRequest {
ASSIST_COMPLETION = 43,
UI_INTEGRATION_ENROLL_START_EVENT = 44,
UI_INTEGRATION_ENROLL_COMPLETE_EVENT = 45,
}
}
@ -1828,3 +1923,18 @@ export enum CTA {
CTA_TRUSTED_DEVICES = 5,
CTA_UPGRADE_BANNER = 6,
}
export enum IntegrationEnrollKind {
INTEGRATION_ENROLL_KIND_UNSPECIFIED = 0,
INTEGRATION_ENROLL_KIND_SLACK = 1,
INTEGRATION_ENROLL_KIND_AWS_OIDC = 2,
INTEGRATION_ENROLL_KIND_PAGERDUTY = 3,
INTEGRATION_ENROLL_KIND_EMAIL = 4,
INTEGRATION_ENROLL_KIND_JIRA = 5,
INTEGRATION_ENROLL_KIND_DISCORD = 6,
INTEGRATION_ENROLL_KIND_MATTERMOST = 7,
INTEGRATION_ENROLL_KIND_MS_TEAMS = 8,
INTEGRATION_ENROLL_KIND_OPSGENIE = 9,
INTEGRATION_ENROLL_KIND_OKTA = 10,
INTEGRATION_ENROLL_KIND_JAMF = 11,
}

View file

@ -29,6 +29,8 @@ goog.exportSymbol('proto.prehog.v1alpha.DiscoverStatus', null, global);
goog.exportSymbol('proto.prehog.v1alpha.DiscoverStepStatus', null, global);
goog.exportSymbol('proto.prehog.v1alpha.HelloTeleportRequest', null, global);
goog.exportSymbol('proto.prehog.v1alpha.HelloTeleportResponse', null, global);
goog.exportSymbol('proto.prehog.v1alpha.IntegrationEnrollKind', null, global);
goog.exportSymbol('proto.prehog.v1alpha.IntegrationEnrollMetadata', null, global);
goog.exportSymbol('proto.prehog.v1alpha.KubeRequestEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.ResourceCreateEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.ResourceHeartbeatEvent', null, global);
@ -62,6 +64,8 @@ goog.exportSymbol('proto.prehog.v1alpha.UIDiscoverPrincipalsConfigureEvent', nul
goog.exportSymbol('proto.prehog.v1alpha.UIDiscoverResourceSelectionEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.UIDiscoverStartedEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.UIDiscoverTestConnectionEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.UIIntegrationEnrollStartEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.UIOnboardAddFirstResourceClickEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.UIOnboardAddFirstResourceLaterClickEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.UIOnboardCompleteGoToDashboardClickEvent', null, global);
@ -954,6 +958,69 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.prehog.v1alpha.AssistCompletionEvent.displayName = 'proto.prehog.v1alpha.AssistCompletionEvent';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.prehog.v1alpha.IntegrationEnrollMetadata, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.displayName = 'proto.prehog.v1alpha.IntegrationEnrollMetadata';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.prehog.v1alpha.UIIntegrationEnrollStartEvent, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.displayName = 'proto.prehog.v1alpha.UIIntegrationEnrollStartEvent';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.displayName = 'proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@ -9382,6 +9449,498 @@ proto.prehog.v1alpha.AssistCompletionEvent.prototype.setCompletionTokens = funct
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.prototype.toObject = function(opt_includeInstance) {
return proto.prehog.v1alpha.IntegrationEnrollMetadata.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.prehog.v1alpha.IntegrationEnrollMetadata} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
kind: jspb.Message.getFieldWithDefault(msg, 2, 0),
userName: jspb.Message.getFieldWithDefault(msg, 3, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.prehog.v1alpha.IntegrationEnrollMetadata}
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.prehog.v1alpha.IntegrationEnrollMetadata;
return proto.prehog.v1alpha.IntegrationEnrollMetadata.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.prehog.v1alpha.IntegrationEnrollMetadata} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.prehog.v1alpha.IntegrationEnrollMetadata}
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setId(value);
break;
case 2:
var value = /** @type {!proto.prehog.v1alpha.IntegrationEnrollKind} */ (reader.readEnum());
msg.setKind(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setUserName(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.prehog.v1alpha.IntegrationEnrollMetadata.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.prehog.v1alpha.IntegrationEnrollMetadata} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getKind();
if (f !== 0.0) {
writer.writeEnum(
2,
f
);
}
f = message.getUserName();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.prehog.v1alpha.IntegrationEnrollMetadata} returns this
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.prototype.setId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional IntegrationEnrollKind kind = 2;
* @return {!proto.prehog.v1alpha.IntegrationEnrollKind}
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.prototype.getKind = function() {
return /** @type {!proto.prehog.v1alpha.IntegrationEnrollKind} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {!proto.prehog.v1alpha.IntegrationEnrollKind} value
* @return {!proto.prehog.v1alpha.IntegrationEnrollMetadata} returns this
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.prototype.setKind = function(value) {
return jspb.Message.setProto3EnumField(this, 2, value);
};
/**
* optional string user_name = 3;
* @return {string}
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.prototype.getUserName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.prehog.v1alpha.IntegrationEnrollMetadata} returns this
*/
proto.prehog.v1alpha.IntegrationEnrollMetadata.prototype.setUserName = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.prototype.toObject = function(opt_includeInstance) {
return proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.prehog.v1alpha.UIIntegrationEnrollStartEvent} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.toObject = function(includeInstance, msg) {
var f, obj = {
metadata: (f = msg.getMetadata()) && proto.prehog.v1alpha.IntegrationEnrollMetadata.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.prehog.v1alpha.UIIntegrationEnrollStartEvent}
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.prehog.v1alpha.UIIntegrationEnrollStartEvent;
return proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.prehog.v1alpha.UIIntegrationEnrollStartEvent} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.prehog.v1alpha.UIIntegrationEnrollStartEvent}
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.prehog.v1alpha.IntegrationEnrollMetadata;
reader.readMessage(value,proto.prehog.v1alpha.IntegrationEnrollMetadata.deserializeBinaryFromReader);
msg.setMetadata(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.prehog.v1alpha.UIIntegrationEnrollStartEvent} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getMetadata();
if (f != null) {
writer.writeMessage(
1,
f,
proto.prehog.v1alpha.IntegrationEnrollMetadata.serializeBinaryToWriter
);
}
};
/**
* optional IntegrationEnrollMetadata metadata = 1;
* @return {?proto.prehog.v1alpha.IntegrationEnrollMetadata}
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.prototype.getMetadata = function() {
return /** @type{?proto.prehog.v1alpha.IntegrationEnrollMetadata} */ (
jspb.Message.getWrapperField(this, proto.prehog.v1alpha.IntegrationEnrollMetadata, 1));
};
/**
* @param {?proto.prehog.v1alpha.IntegrationEnrollMetadata|undefined} value
* @return {!proto.prehog.v1alpha.UIIntegrationEnrollStartEvent} returns this
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.prototype.setMetadata = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.prehog.v1alpha.UIIntegrationEnrollStartEvent} returns this
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.prototype.clearMetadata = function() {
return this.setMetadata(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.prototype.hasMetadata = function() {
return jspb.Message.getField(this, 1) != null;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.prototype.toObject = function(opt_includeInstance) {
return proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.toObject = function(includeInstance, msg) {
var f, obj = {
metadata: (f = msg.getMetadata()) && proto.prehog.v1alpha.IntegrationEnrollMetadata.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent}
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent;
return proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent}
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.prehog.v1alpha.IntegrationEnrollMetadata;
reader.readMessage(value,proto.prehog.v1alpha.IntegrationEnrollMetadata.deserializeBinaryFromReader);
msg.setMetadata(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getMetadata();
if (f != null) {
writer.writeMessage(
1,
f,
proto.prehog.v1alpha.IntegrationEnrollMetadata.serializeBinaryToWriter
);
}
};
/**
* optional IntegrationEnrollMetadata metadata = 1;
* @return {?proto.prehog.v1alpha.IntegrationEnrollMetadata}
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.prototype.getMetadata = function() {
return /** @type{?proto.prehog.v1alpha.IntegrationEnrollMetadata} */ (
jspb.Message.getWrapperField(this, proto.prehog.v1alpha.IntegrationEnrollMetadata, 1));
};
/**
* @param {?proto.prehog.v1alpha.IntegrationEnrollMetadata|undefined} value
* @return {!proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent} returns this
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.prototype.setMetadata = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent} returns this
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.prototype.clearMetadata = function() {
return this.setMetadata(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.prototype.hasMetadata = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* Oneof group definitions for this message. Each group defines the field
* numbers belonging to that group. When of these fields' value is set, all
@ -9390,7 +9949,7 @@ proto.prehog.v1alpha.AssistCompletionEvent.prototype.setCompletionTokens = funct
* @private {!Array<!Array<number>>}
* @const
*/
proto.prehog.v1alpha.SubmitEventRequest.oneofGroups_ = [[3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]];
proto.prehog.v1alpha.SubmitEventRequest.oneofGroups_ = [[3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]];
/**
* @enum {number}
@ -9436,7 +9995,9 @@ proto.prehog.v1alpha.SubmitEventRequest.EventCase = {
UI_DISCOVER_INTEGRATION_AWS_OIDC_CONNECT_EVENT: 40,
UI_DISCOVER_DATABASE_RDS_ENROLL_EVENT: 41,
UI_CALL_TO_ACTION_CLICK_EVENT: 42,
ASSIST_COMPLETION: 43
ASSIST_COMPLETION: 43,
UI_INTEGRATION_ENROLL_START_EVENT: 44,
UI_INTEGRATION_ENROLL_COMPLETE_EVENT: 45
};
/**
@ -9518,7 +10079,9 @@ proto.prehog.v1alpha.SubmitEventRequest.toObject = function(includeInstance, msg
uiDiscoverIntegrationAwsOidcConnectEvent: (f = msg.getUiDiscoverIntegrationAwsOidcConnectEvent()) && proto.prehog.v1alpha.UIDiscoverIntegrationAWSOIDCConnectEvent.toObject(includeInstance, f),
uiDiscoverDatabaseRdsEnrollEvent: (f = msg.getUiDiscoverDatabaseRdsEnrollEvent()) && proto.prehog.v1alpha.UIDiscoverDatabaseRDSEnrollEvent.toObject(includeInstance, f),
uiCallToActionClickEvent: (f = msg.getUiCallToActionClickEvent()) && proto.prehog.v1alpha.UICallToActionClickEvent.toObject(includeInstance, f),
assistCompletion: (f = msg.getAssistCompletion()) && proto.prehog.v1alpha.AssistCompletionEvent.toObject(includeInstance, f)
assistCompletion: (f = msg.getAssistCompletion()) && proto.prehog.v1alpha.AssistCompletionEvent.toObject(includeInstance, f),
uiIntegrationEnrollStartEvent: (f = msg.getUiIntegrationEnrollStartEvent()) && proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.toObject(includeInstance, f),
uiIntegrationEnrollCompleteEvent: (f = msg.getUiIntegrationEnrollCompleteEvent()) && proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.toObject(includeInstance, f)
};
if (includeInstance) {
@ -9764,6 +10327,16 @@ proto.prehog.v1alpha.SubmitEventRequest.deserializeBinaryFromReader = function(m
reader.readMessage(value,proto.prehog.v1alpha.AssistCompletionEvent.deserializeBinaryFromReader);
msg.setAssistCompletion(value);
break;
case 44:
var value = new proto.prehog.v1alpha.UIIntegrationEnrollStartEvent;
reader.readMessage(value,proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.deserializeBinaryFromReader);
msg.setUiIntegrationEnrollStartEvent(value);
break;
case 45:
var value = new proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent;
reader.readMessage(value,proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.deserializeBinaryFromReader);
msg.setUiIntegrationEnrollCompleteEvent(value);
break;
default:
reader.skipField();
break;
@ -10128,6 +10701,22 @@ proto.prehog.v1alpha.SubmitEventRequest.serializeBinaryToWriter = function(messa
proto.prehog.v1alpha.AssistCompletionEvent.serializeBinaryToWriter
);
}
f = message.getUiIntegrationEnrollStartEvent();
if (f != null) {
writer.writeMessage(
44,
f,
proto.prehog.v1alpha.UIIntegrationEnrollStartEvent.serializeBinaryToWriter
);
}
f = message.getUiIntegrationEnrollCompleteEvent();
if (f != null) {
writer.writeMessage(
45,
f,
proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent.serializeBinaryToWriter
);
}
};
@ -11666,6 +12255,80 @@ proto.prehog.v1alpha.SubmitEventRequest.prototype.hasAssistCompletion = function
};
/**
* optional UIIntegrationEnrollStartEvent ui_integration_enroll_start_event = 44;
* @return {?proto.prehog.v1alpha.UIIntegrationEnrollStartEvent}
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.getUiIntegrationEnrollStartEvent = function() {
return /** @type{?proto.prehog.v1alpha.UIIntegrationEnrollStartEvent} */ (
jspb.Message.getWrapperField(this, proto.prehog.v1alpha.UIIntegrationEnrollStartEvent, 44));
};
/**
* @param {?proto.prehog.v1alpha.UIIntegrationEnrollStartEvent|undefined} value
* @return {!proto.prehog.v1alpha.SubmitEventRequest} returns this
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.setUiIntegrationEnrollStartEvent = function(value) {
return jspb.Message.setOneofWrapperField(this, 44, proto.prehog.v1alpha.SubmitEventRequest.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.prehog.v1alpha.SubmitEventRequest} returns this
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.clearUiIntegrationEnrollStartEvent = function() {
return this.setUiIntegrationEnrollStartEvent(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.hasUiIntegrationEnrollStartEvent = function() {
return jspb.Message.getField(this, 44) != null;
};
/**
* optional UIIntegrationEnrollCompleteEvent ui_integration_enroll_complete_event = 45;
* @return {?proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent}
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.getUiIntegrationEnrollCompleteEvent = function() {
return /** @type{?proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent} */ (
jspb.Message.getWrapperField(this, proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent, 45));
};
/**
* @param {?proto.prehog.v1alpha.UIIntegrationEnrollCompleteEvent|undefined} value
* @return {!proto.prehog.v1alpha.SubmitEventRequest} returns this
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.setUiIntegrationEnrollCompleteEvent = function(value) {
return jspb.Message.setOneofWrapperField(this, 45, proto.prehog.v1alpha.SubmitEventRequest.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.prehog.v1alpha.SubmitEventRequest} returns this
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.clearUiIntegrationEnrollCompleteEvent = function() {
return this.setUiIntegrationEnrollCompleteEvent(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.hasUiIntegrationEnrollCompleteEvent = function() {
return jspb.Message.getField(this, 45) != null;
};
@ -12310,4 +12973,22 @@ proto.prehog.v1alpha.CTA = {
CTA_UPGRADE_BANNER: 6
};
/**
* @enum {number}
*/
proto.prehog.v1alpha.IntegrationEnrollKind = {
INTEGRATION_ENROLL_KIND_UNSPECIFIED: 0,
INTEGRATION_ENROLL_KIND_SLACK: 1,
INTEGRATION_ENROLL_KIND_AWS_OIDC: 2,
INTEGRATION_ENROLL_KIND_PAGERDUTY: 3,
INTEGRATION_ENROLL_KIND_EMAIL: 4,
INTEGRATION_ENROLL_KIND_JIRA: 5,
INTEGRATION_ENROLL_KIND_DISCORD: 6,
INTEGRATION_ENROLL_KIND_MATTERMOST: 7,
INTEGRATION_ENROLL_KIND_MS_TEAMS: 8,
INTEGRATION_ENROLL_KIND_OPSGENIE: 9,
INTEGRATION_ENROLL_KIND_OKTA: 10,
INTEGRATION_ENROLL_KIND_JAMF: 11
};
goog.object.extend(exports, proto.prehog.v1alpha);

View file

@ -96,6 +96,76 @@ func (u *ResourceCreateEvent) Anonymize(a utils.Anonymizer) prehogv1a.SubmitEven
}
}
func integrationEnrollMetadataToPrehog(u *usageeventsv1.IntegrationEnrollMetadata, userMD UserMetadata) *prehogv1a.IntegrationEnrollMetadata {
return &prehogv1a.IntegrationEnrollMetadata{
Id: u.Id,
Kind: prehogv1a.IntegrationEnrollKind(u.Kind),
UserName: userMD.Username,
}
}
func validateIntegrationEnrollMetadata(u *prehogv1a.IntegrationEnrollMetadata) error {
if u == nil {
return trace.BadParameter("metadata is required")
}
if len(u.UserName) == 0 {
return trace.BadParameter("metadata.user_name is required")
}
if len(u.Id) == 0 {
return trace.BadParameter("metadata.id is required")
}
if u.Kind == prehogv1a.IntegrationEnrollKind_INTEGRATION_ENROLL_KIND_UNSPECIFIED {
return trace.BadParameter("metadata.kind is required")
}
return nil
}
// UIIntegrationEnrollStartEvent is a UI event sent when a user starts enrolling a integration.
type UIIntegrationEnrollStartEvent prehogv1a.UIIntegrationEnrollStartEvent
func (u *UIIntegrationEnrollStartEvent) CheckAndSetDefaults() error {
return trace.Wrap(validateIntegrationEnrollMetadata(u.Metadata))
}
func (u *UIIntegrationEnrollStartEvent) Anonymize(a utils.Anonymizer) prehogv1a.SubmitEventRequest {
return prehogv1a.SubmitEventRequest{
Event: &prehogv1a.SubmitEventRequest_UiIntegrationEnrollStartEvent{
UiIntegrationEnrollStartEvent: &prehogv1a.UIIntegrationEnrollStartEvent{
Metadata: &prehogv1a.IntegrationEnrollMetadata{
Id: u.Metadata.Id,
Kind: u.Metadata.Kind,
UserName: a.AnonymizeString(u.Metadata.UserName),
},
},
},
}
}
// UIIntegrationEnrollCompleteEvent is a UI event sent when a user completes enrolling an integration.
type UIIntegrationEnrollCompleteEvent prehogv1a.UIIntegrationEnrollCompleteEvent
func (u *UIIntegrationEnrollCompleteEvent) CheckAndSetDefaults() error {
return trace.Wrap(validateIntegrationEnrollMetadata(u.Metadata))
}
func (u *UIIntegrationEnrollCompleteEvent) Anonymize(a utils.Anonymizer) prehogv1a.SubmitEventRequest {
return prehogv1a.SubmitEventRequest{
Event: &prehogv1a.SubmitEventRequest_UiIntegrationEnrollCompleteEvent{
UiIntegrationEnrollCompleteEvent: &prehogv1a.UIIntegrationEnrollCompleteEvent{
Metadata: &prehogv1a.IntegrationEnrollMetadata{
Id: u.Metadata.Id,
Kind: u.Metadata.Kind,
UserName: a.AnonymizeString(u.Metadata.UserName),
},
},
},
}
}
// UIBannerClickEvent is a UI event sent when a banner is clicked.
type UIBannerClickEvent prehogv1a.UIBannerClickEvent
@ -511,6 +581,24 @@ func ConvertUsageEvent(event *usageeventsv1.UsageEventOneOf, userMD UserMetadata
return &UICreateNewRoleViewDocumentationClickEvent{
UserName: userMD.Username,
}, nil
case *usageeventsv1.UsageEventOneOf_UiIntegrationEnrollStartEvent:
ret := &UIIntegrationEnrollStartEvent{
Metadata: integrationEnrollMetadataToPrehog(e.UiIntegrationEnrollStartEvent.Metadata, userMD),
}
if err := ret.CheckAndSetDefaults(); err != nil {
return nil, trace.Wrap(err)
}
return ret, nil
case *usageeventsv1.UsageEventOneOf_UiIntegrationEnrollCompleteEvent:
ret := &UIIntegrationEnrollCompleteEvent{
Metadata: integrationEnrollMetadataToPrehog(e.UiIntegrationEnrollCompleteEvent.Metadata, userMD),
}
if err := ret.CheckAndSetDefaults(); err != nil {
return nil, trace.Wrap(err)
}
return ret, nil
case *usageeventsv1.UsageEventOneOf_UiDiscoverStartedEvent:
ret := &UIDiscoverStartedEvent{
Metadata: discoverMetadataToPrehog(e.UiDiscoverStartedEvent.Metadata, userMD),

View file

@ -212,6 +212,25 @@ func TestConvertUsageEvent(t *testing.T) {
},
}},
},
{
name: "integration enroll started event",
event: &usageeventsv1.UsageEventOneOf{Event: &usageeventsv1.UsageEventOneOf_UiIntegrationEnrollStartEvent{
UiIntegrationEnrollStartEvent: &usageeventsv1.UIIntegrationEnrollStartEvent{
Metadata: &usageeventsv1.IntegrationEnrollMetadata{Id: "someid", Kind: usageeventsv1.IntegrationEnrollKind_INTEGRATION_ENROLL_KIND_AWS_OIDC},
},
}},
identityUsername: "myuser",
errCheck: require.NoError,
expected: &prehogv1a.SubmitEventRequest{Event: &prehogv1a.SubmitEventRequest_UiIntegrationEnrollStartEvent{
UiIntegrationEnrollStartEvent: &prehogv1a.UIIntegrationEnrollStartEvent{
Metadata: &prehogv1a.IntegrationEnrollMetadata{
Id: "someid",
UserName: expectedAnonymizedUserString,
Kind: prehogv1a.IntegrationEnrollKind_INTEGRATION_ENROLL_KIND_AWS_OIDC,
},
},
}},
},
} {
t.Run(tt.name, func(t *testing.T) {
tt := tt

View file

@ -57,6 +57,9 @@ const (
uiDiscoverTestConnectionEvent = "tp.ui.discover.testConnection"
uiDiscoverCompletedEvent = "tp.ui.discover.completed"
uiIntegrationEnrollStartEvent = "tp.ui.integrationEnroll.start"
uiIntegrationEnrollCompleteEvent = "tp.ui.integrationEnroll.complete"
uiCallToActionClickEvent = "tp.ui.callToAction.click"
)
@ -74,6 +77,10 @@ var eventsWithDataRequired = []string{
uiDiscoverPrincipalsConfigureEvent,
uiDiscoverTestConnectionEvent,
uiDiscoverCompletedEvent,
uiDiscoverIntegrationAWSOIDCConnectEvent,
uiDiscoverDatabaseRDSEnrollEvent,
uiIntegrationEnrollStartEvent,
uiIntegrationEnrollCompleteEvent,
}
// CreatePreUserEventRequest contains the event and properties associated with a user event
@ -172,6 +179,19 @@ type CreateUserEventRequest struct {
EventData *json.RawMessage `json:"eventData"`
}
// IntegrationEnrollEventData contains the required properties
// to create a IntegrationEnroll UsageEvent.
type IntegrationEnrollEventData struct {
// ID is a unique ID per wizard session
ID string `json:"id"`
// Kind is the integration type that the user selected to enroll.
// Values should be the string version of the enum names as found
// in usageevents.IntegrationEnrollKind.
// Example: "INTEGRATION_ENROLL_KIND_AWS_OIDC"
Kind string `json:"kind"`
}
// CheckAndSetDefaults validates the Request has the required fields.
func (r *CreateUserEventRequest) CheckAndSetDefaults() error {
if r.Event == "" {
@ -211,6 +231,40 @@ func ConvertUserEventRequestToUsageEvent(req CreateUserEventRequest) (*usageeven
}},
nil
case uiIntegrationEnrollStartEvent,
uiIntegrationEnrollCompleteEvent:
var event IntegrationEnrollEventData
if err := json.Unmarshal([]byte(*req.EventData), &event); err != nil {
return nil, trace.BadParameter("eventData is invalid: %v", err)
}
kindEnum, ok := usageeventsv1.IntegrationEnrollKind_value[event.Kind]
if !ok {
return nil, trace.BadParameter("invalid integration enroll kind %s", event.Kind)
}
switch req.Event {
case uiIntegrationEnrollStartEvent:
return &usageeventsv1.UsageEventOneOf{Event: &usageeventsv1.UsageEventOneOf_UiIntegrationEnrollStartEvent{
UiIntegrationEnrollStartEvent: &usageeventsv1.UIIntegrationEnrollStartEvent{
Metadata: &usageeventsv1.IntegrationEnrollMetadata{
Id: event.ID,
Kind: usageeventsv1.IntegrationEnrollKind(kindEnum),
},
},
}}, nil
case uiIntegrationEnrollCompleteEvent:
return &usageeventsv1.UsageEventOneOf{Event: &usageeventsv1.UsageEventOneOf_UiIntegrationEnrollCompleteEvent{
UiIntegrationEnrollCompleteEvent: &usageeventsv1.UIIntegrationEnrollCompleteEvent{
Metadata: &usageeventsv1.IntegrationEnrollMetadata{
Id: event.ID,
Kind: usageeventsv1.IntegrationEnrollKind(kindEnum),
},
},
}}, nil
}
case uiDiscoverStartedEvent,
uiDiscoverResourceSelectionEvent,
uiDiscoverIntegrationAWSOIDCConnectEvent,

View file

@ -423,6 +423,47 @@ message AssistCompletionEvent {
int64 completion_tokens = 5;
}
// IntegrationEnrollKind represents the types of integration that
// can be enrolled.
enum IntegrationEnrollKind {
INTEGRATION_ENROLL_KIND_UNSPECIFIED = 0;
INTEGRATION_ENROLL_KIND_SLACK = 1;
INTEGRATION_ENROLL_KIND_AWS_OIDC = 2;
INTEGRATION_ENROLL_KIND_PAGERDUTY = 3;
INTEGRATION_ENROLL_KIND_EMAIL = 4;
INTEGRATION_ENROLL_KIND_JIRA = 5;
INTEGRATION_ENROLL_KIND_DISCORD = 6;
INTEGRATION_ENROLL_KIND_MATTERMOST = 7;
INTEGRATION_ENROLL_KIND_MS_TEAMS = 8;
INTEGRATION_ENROLL_KIND_OPSGENIE = 9;
INTEGRATION_ENROLL_KIND_OKTA = 10;
INTEGRATION_ENROLL_KIND_JAMF = 11;
}
// IntegrationEnrollMetadata contains common metadata
// for Integration Enroll related events.
message IntegrationEnrollMetadata {
// id is used as a unique identifier to correlate events within the
// same enroll wizard run.
string id = 1;
// kind identifies what type of integration the user clicked on to enroll.
IntegrationEnrollKind kind = 2;
// user_name is anonymized.
string user_name = 3;
}
// UIIntegrationEnrollEvent is an event that is emitted when a user
// clicks on a integration to enroll.
message UIIntegrationEnrollStartEvent {
IntegrationEnrollMetadata metadata = 1;
}
// UIIntegrationEnrollEvent is an event that is emitted when a user
// completed enrolling an integration.
message UIIntegrationEnrollCompleteEvent {
IntegrationEnrollMetadata metadata = 1;
}
message SubmitEventRequest {
// anonymized
string cluster_name = 1;
@ -488,6 +529,9 @@ message SubmitEventRequest {
UICallToActionClickEvent ui_call_to_action_click_event = 42;
AssistCompletionEvent assist_completion = 43;
UIIntegrationEnrollStartEvent ui_integration_enroll_start_event = 44;
UIIntegrationEnrollCompleteEvent ui_integration_enroll_complete_event = 45;
}
reserved 8; // UIOnboardGetStartedClickEvent

View file

@ -40,6 +40,27 @@ export enum CaptureEvent {
PreUserRecoveryCodesPrintClickEvent = 'tp.ui.recoveryCodesPrint.click',
}
export enum IntegrationEnrollEvent {
Started = 'tp.ui.integrationEnroll.start',
Complete = 'tp.ui.integrationEnroll.complete',
}
// IntegrationEnrollKind represents a integration type.
export enum IntegrationEnrollKind {
Unspecified = 'INTEGRATION_ENROLL_KIND_UNSPECIFIED',
Slack = 'INTEGRATION_ENROLL_KIND_SLACK',
AwsOidc = 'INTEGRATION_ENROLL_KIND_AWS_OIDC',
PagerDuty = 'INTEGRATION_ENROLL_KIND_PAGERDUTY',
Email = 'INTEGRATION_ENROLL_KIND_EMAIL',
Jira = 'INTEGRATION_ENROLL_KIND_JIRA',
Discord = 'INTEGRATION_ENROLL_KIND_DISCORD',
Mattermost = 'INTEGRATION_ENROLL_KIND_MATTERMOST',
MsTeams = 'INTEGRATION_ENROLL_KIND_MS_TEAMS',
OpsGenie = 'INTEGRATION_ENROLL_KIND_OPSGENIE',
Okta = 'INTEGRATION_ENROLL_KIND_OKTA',
Jamf = 'INTEGRATION_ENROLL_KIND_JAMF',
}
export enum DiscoverEvent {
Started = 'tp.ui.discover.started',
ResourceSelection = 'tp.ui.discover.resourceSelection',
@ -124,6 +145,16 @@ export type EventMeta = {
export type PreUserEvent = UserEvent & EventMeta;
export type IntegrationEnrollEventData = {
id: string;
kind: IntegrationEnrollKind;
};
export type IntegrationEnrollEventRequest = {
event: IntegrationEnrollEvent;
eventData: IntegrationEnrollEventData;
};
export type DiscoverEventRequest = Omit<UserEvent, 'event'> & {
event: DiscoverEvent;
eventData: DiscoverEventData;

View file

@ -23,6 +23,7 @@ import {
DiscoverEventRequest,
CtaEvent,
CaptureEvent,
IntegrationEnrollEventRequest,
} from './types';
export const userEventService = {
@ -53,6 +54,15 @@ export const userEventService = {
});
},
captureIntegrationEnrollEvent(event: IntegrationEnrollEventRequest) {
// using api.fetch instead of api.fetchJSON
// because we are not expecting a JSON response
void api.fetch(cfg.api.captureUserEventPath, {
method: 'POST',
body: JSON.stringify(event),
});
},
captureCtaEvent(event: CtaEvent) {
// using api.fetch instead of api.fetchJSON
// because we are not expecting a JSON response