Skip to content

Commit

Permalink
[7.x] [Lens] Rename "telemetry" to "stats" (#78125) (#78275)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Sep 23, 2020
1 parent fb80e69 commit d02d08a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
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

0 comments on commit d02d08a

Please sign in to comment.