This repository was archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathtelemetry.graphql
More file actions
177 lines (158 loc) · 4.48 KB
/
telemetry.graphql
File metadata and controls
177 lines (158 loc) · 4.48 KB
1
2
3
4
5
6
7
8
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
extend type Mutation {
"""
Telemetry mutations for "Event Logging Everywhere", aka a version 2 of
existing event-logging/event-recording APIs.
"""
telemetry: TelemetryMutation
}
"""
Mutations for recording events from clients.
"""
type TelemetryMutation {
"""
Record a batch of telemetry events.
❗ Do not use this directly when recording events in-product - use the
@sourcegraph/telemetry package, or equivalent, instead.
"""
recordEvents(events: [TelemetryEventInput!]!): EmptyResponse
}
"""
Properties comprising a telemetry V2 event that can be reported by a client.
"""
input TelemetryEventInput {
"""
Feature associated with the event in camelCase, e.g. 'myFeature'.
Feature names must come from a static set of values in libraries - it is
left as a string in the API to allow some flexibility.
"""
feature: String!
"""
Action associated with the event in camelCase, e.g. 'pageView'.
Action names must come from a static set of values in libraries - it is
left as a string in the API to allow some flexibility.
"""
action: String!
"""
Information about where this event came from.
"""
source: TelemetryEventSourceInput!
"""
Parameters of the event.
"""
parameters: TelemetryEventParametersInput!
"""
Optional marketing campaign tracking parameters.
🚨 SECURITY: This metadata is NEVER exported from private Sourcegraph instances,
and is only exported for events tracked in the public Sourcegraph.com instance.
"""
marketingTracking: TelemetryEventMarketingTrackingInput
}
"""
Properties comprising the source of a telemetry V2 event reported by a client.
"""
input TelemetryEventSourceInput {
"""
Source client of the event.
"""
client: String!
"""
Version of the source client of the event.
"""
clientVersion: String
}
"""
Properties of a telemetry V2 event.
"""
input TelemetryEventParametersInput {
"""
Version of the event parameters, used for indicating the "shape" of this
event's metadata.
"""
version: Int!
"""
Strictly typed metadata that must not contain any sensitive data or PII.
"""
metadata: [TelemetryEventMetadataInput!]
"""
Private metadata in JSON format. Unlike metadata, values can be of any type,
not just numeric.
🚨 SECURITY: This metadata is NOT exported from instances by default, as it
can contain arbitrarily-shaped data that may accidentally contain sensitive
or private contents.
"""
privateMetadata: JSONValue
"""
Billing-related metadata.
"""
billingMetadata: TelemetryEventBillingMetadataInput
}
"""
A single, PII-free metadata item for telemetry V2 events.
"""
input TelemetryEventMetadataInput {
"""
The key identifying this metadata entry.
"""
key: String!
"""
Numeric value associated with the key. Enforcing numeric values eliminates
risks of accidentally shipping sensitive or private data.
"""
value: Int!
}
"""
Billing-related metadata for a telemetry event.
"""
input TelemetryEventBillingMetadataInput {
"""
Billing product ID associated with the event.
IDs must come from a static set of values in libraries - it is left as a
string in the API to allow some flexibility.
"""
product: String!
"""
Billing category ID the event falls into.
IDs must come from a static set of values in libraries - it is left as a
string in the API to allow some flexibility.
"""
category: String!
}
"""
Marketing campaign tracking parameters for a telemetry V2 event.
🚨 SECURITY: This metadata is NEVER exported from private Sourcegraph instances,
and is only exported for events tracked in the public Sourcegraph.com instance.
"""
input TelemetryEventMarketingTrackingInput {
"""
URL the event occurred on.
"""
url: String
"""
Initial URL the user landed on.
"""
firstSourceURL: String
"""
Cohort ID to identify the user as part of a specific A/B test.
"""
cohortID: String
"""
Referrer URL that refers the user to Sourcegraph.
"""
referrer: String
"""
Last source URL visited by the user.
"""
lastSourceURL: String
"""
Device session ID to identify the user's session.
"""
deviceSessionID: String
"""
Session referrer URL for the user.
"""
sessionReferrer: String
"""
First URL the user visited in their current session.
"""
sessionFirstURL: String
}