Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] Rename "telemetry" to "stats" #78125

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('Lens UI telemetry', () => {

jest.runOnlyPendingTimers();

expect(http.post).toHaveBeenCalledWith(`/api/lens/telemetry`, {
expect(http.post).toHaveBeenCalledWith(`/api/lens/stats`, {
body: JSON.stringify({
events: {
'2019-10-23': {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/lens/public/lens_ui_telemetry/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class LensReportManager {
this.readFromStorage();
if (Object.keys(this.events).length || Object.keys(this.suggestionEvents).length) {
try {
await this.http.post(`${BASE_API_URL}/telemetry`, {
await this.http.post(`${BASE_API_URL}/stats`, {
body: JSON.stringify({
events: this.events,
suggestionEvents: this.suggestionEvents,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/lens/server/routes/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function initLensUsageRoute(setup: CoreSetup) {
const router = setup.http.createRouter();
router.post(
{
path: `${BASE_API_URL}/telemetry`,
path: `${BASE_API_URL}/stats`,
validate: {
body: schema.object({
events: schema.mapOf(schema.string(), schema.mapOf(schema.string(), schema.number())),
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/api_integration/apis/lens/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default ({ getService }: FtrProviderContext) => {

it('should do nothing on empty post', async () => {
await supertest
.post('/api/lens/telemetry')
.post('/api/lens/stats')
.set(COMMON_HEADERS)
.send({
events: {},
Expand All @@ -73,7 +73,7 @@ export default ({ getService }: FtrProviderContext) => {

it('should write a document per results', async () => {
await supertest
.post('/api/lens/telemetry')
.post('/api/lens/stats')
.set(COMMON_HEADERS)
.send({
events: {
Expand Down