Skip to content

Commit 2a30e87

Browse files
afharokibanamachine
andcommitted
[Telemetry] Full schema definition (#90273)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # test/api_integration/apis/telemetry/telemetry_local.ts
1 parent 4eeac3a commit 2a30e87

23 files changed

Lines changed: 988 additions & 188 deletions

File tree

.telemetryrc.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
{
33
"output": "src/plugins/telemetry/schema/oss_plugins.json",
44
"root": "src/plugins/",
5-
"exclude": [
6-
"src/plugins/kibana_react/",
7-
"src/plugins/testbed/",
8-
"src/plugins/kibana_utils/"
9-
]
10-
},
11-
{
12-
"output": "src/plugins/telemetry/schema/legacy_plugins.json",
13-
"root": "src/legacy/server/",
145
"exclude": []
156
}
167
]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Telemetry Schemas
2+
3+
This list of `.json` files describes the format of the payloads sent to the Remote Telemetry Service. All the files should follow the schema convention as defined in the `usage_collection` plugin and `@kbn/telemetry-tools`, with the addition of the type `pass_through`. This additional `type` indicates Kibana sends the payload as-is from the output of an external ES query.
4+
5+
There are currently 2 files:
6+
7+
- `oss_root.json`: Defines the schema for the payload from the root keys.
8+
Manually maintained for now because the frequency it changes should be pretty low.
9+
- `oss_plugins.json`: The schema for the content that will be nested in `stack_stats.kibana.plugins`.
10+
It is automatically generated by `@kbn/telemetry-tools` based on the `schema` property provided by all the registered Usage Collectors via the `usageCollection.makeUsageCollector` API.
11+
More details in the [Schema field](../../usage_collection/README.md#schema-field) chapter in the UsageCollection's docs.
12+
13+
NOTE: Despite its similarities to ES mappings, the intention of these files is not to define any index mappings. They should be considered as a tool to understand the format of the payload that will be sent when reporting telemetry to the Remote Service.
14+
15+
## Testing
16+
17+
Functional tests are defined at `test/api_integration/apis/telemetry/telemetry_local.ts`. They merge both files, and validates the actual output of the telemetry endpoint against the final schema.

src/plugins/telemetry/schema/legacy_plugins.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
{
2+
"properties": {
3+
"timestamp": {
4+
"type": "date"
5+
},
6+
"cluster_uuid": {
7+
"type": "keyword"
8+
},
9+
"cluster_name": {
10+
"type": "keyword"
11+
},
12+
"version": {
13+
"type": "keyword"
14+
},
15+
"collection": {
16+
"type": "keyword"
17+
},
18+
"collectionSource": {
19+
"type": "keyword"
20+
},
21+
"stack_stats": {
22+
"properties": {
23+
"data": {
24+
"type": "array",
25+
"items": {
26+
"properties": {
27+
"data_stream": {
28+
"properties": {
29+
"dataset": {
30+
"type": "keyword"
31+
},
32+
"type": {
33+
"type": "keyword"
34+
}
35+
}
36+
},
37+
"package": {
38+
"properties": {
39+
"name": {
40+
"type": "keyword"
41+
}
42+
}
43+
},
44+
"shipper": {
45+
"type": "keyword"
46+
},
47+
"pattern_name": {
48+
"type": "keyword"
49+
},
50+
"index_count": {
51+
"type": "long"
52+
},
53+
"ecs_index_count": {
54+
"type": "long"
55+
},
56+
"doc_count": {
57+
"type": "long"
58+
},
59+
"size_in_bytes": {
60+
"type": "long"
61+
}
62+
}
63+
}
64+
},
65+
"kibana": {
66+
"properties": {
67+
"timelion_sheet": {
68+
"properties": {
69+
"total": {
70+
"type": "long"
71+
}
72+
}
73+
},
74+
"visualization": {
75+
"properties": {
76+
"total": {
77+
"type": "long"
78+
}
79+
}
80+
},
81+
"search": {
82+
"properties": {
83+
"total": {
84+
"type": "long"
85+
}
86+
}
87+
},
88+
"index_pattern": {
89+
"properties": {
90+
"total": {
91+
"type": "long"
92+
}
93+
}
94+
},
95+
"dashboard": {
96+
"properties": {
97+
"total": {
98+
"type": "long"
99+
}
100+
}
101+
},
102+
"graph_workspace": {
103+
"properties": {
104+
"total": {
105+
"type": "long"
106+
}
107+
}
108+
},
109+
"count": {
110+
"type": "short"
111+
},
112+
"indices": {
113+
"type": "short"
114+
},
115+
"os": {
116+
"properties": {
117+
"platforms": {
118+
"type": "array",
119+
"items": {
120+
"properties": {
121+
"platform": {
122+
"type": "keyword"
123+
},
124+
"count": {
125+
"type": "short"
126+
}
127+
}
128+
}
129+
},
130+
"platformReleases": {
131+
"type": "array",
132+
"items": {
133+
"properties": {
134+
"platformRelease": {
135+
"type": "keyword"
136+
},
137+
"count": {
138+
"type": "short"
139+
}
140+
}
141+
}
142+
},
143+
"distros": {
144+
"type": "array",
145+
"items": {
146+
"properties": {
147+
"distro": {
148+
"type": "keyword"
149+
},
150+
"count": {
151+
"type": "short"
152+
}
153+
}
154+
}
155+
},
156+
"distroReleases": {
157+
"type": "array",
158+
"items": {
159+
"properties": {
160+
"distroRelease": {
161+
"type": "keyword"
162+
},
163+
"count": {
164+
"type": "short"
165+
}
166+
}
167+
}
168+
}
169+
}
170+
},
171+
"versions": {
172+
"type": "array",
173+
"items": {
174+
"properties": {
175+
"version": {
176+
"type": "keyword"
177+
},
178+
"count": {
179+
"type": "short"
180+
}
181+
}
182+
}
183+
},
184+
"plugins": {
185+
"properties": {
186+
"THIS_WILL_BE_REPLACED_BY_THE_PLUGINS_JSON": {
187+
"type": "text"
188+
}
189+
}
190+
}
191+
}
192+
}
193+
}
194+
},
195+
"cluster_stats": {
196+
"type": "pass_through"
197+
}
198+
}
199+
}

0 commit comments

Comments
 (0)