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

Instrument Index Management with user action telemetry #32595

Merged
merged 7 commits into from
Mar 11, 2019

Conversation

cjcenizal
Copy link
Contributor

@cjcenizal cjcenizal commented Mar 6, 2019

Actions tracked:

  • "Load app" action
  • "Clear cache" action (both individual and in bulk)
  • "Delete index" action (both individual and in bulk)
  • "Flush index" action (both individual and in bulk)
  • "Force merge index" action (both individual and in bulk)
  • "Close index" action (both individual and in bulk)
  • "Open index" action (both individual and in bulk)
  • "Freeze index" action (both individual and in bulk)
  • "Unfreeze index" action (both individual and in bulk)
  • "Refresh index" action (both individual and in bulk)
  • "Update settings" action (in details panel)
  • "Open details panel" action
  • "View summary tab" action
  • "View mappings tab" action
  • "View stats tab" action
  • "View settings tab" action
  • "View edit settings tab" action

Telemetry shape as reported by http://localhost:5601/api/stats?extended=true:

{  
  "user_actions":[  
    {  
      "key":"app_load",
      "value":1
    },
    {  
      "key":"index_clear_cache",
      "value":1
    },
    {  
      "key":"index_clear_cache_many",
      "value":1
    },
    {  
      "key":"index_close",
      "value":1
    },
    {  
      "key":"index_close_many",
      "value":1
    },
    {  
      "key":"index_delete",
      "value":1
    },
    {  
      "key":"index_delete_many",
      "value":1
    },
    {  
      "key":"index_flush",
      "value":1
    },
    {  
      "key":"index_flush_many",
      "value":1
    },
    {  
      "key":"index_force_merge",
      "value":1
    },
    {  
      "key":"index_force_merge_many",
      "value":1
    },
    {  
      "key":"index_freeze",
      "value":1
    },
    {  
      "key":"index_freeze_many",
      "value":1
    },
    {  
      "key":"index_open",
      "value":2
    },
    {  
      "key":"index_open_many",
      "value":1
    },
    {  
      "key":"index_refresh",
      "value":1
    },
    {  
      "key":"index_refresh_many",
      "value":1
    },
    {  
      "key":"index_unfreeze",
      "value":1
    },
    {  
      "key":"index_unfreeze_many",
      "value":1
    },
    {  
      "key":"show_details_click",
      "value":3
    },
    {  
      "key":"detail_panel_edit_settings_tab",
      "value":3
    },
    {  
      "key":"detail_panel_mapping_tab",
      "value":1
    },
    {  
      "key":"detail_panel_settings_tab",
      "value":2
    },
    {  
      "key":"detail_panel_stats_tab",
      "value":1
    },
    {  
      "key":"detail_panel_summary_tab",
      "value":1
    }
  ]
}

@cjcenizal cjcenizal added Feature:Index Management Index and index templates UI v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.2.0 labels Mar 6, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

- Track refresh action.
- Rename 'bulk' action type to 'many' for clarity.
@cjcenizal
Copy link
Contributor Author

@bmcconaghy I've updated the PR per our discussion by removing the trackUserRequest helper and moving this logic into api.js. I've also added tracking for when the app is first loaded by the user, and for the "refresh index" action which I missed the first time around. Could you please take another look?

Copy link
Contributor

@bmcconaghy bmcconaghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think the code is clear now in what is happening when. Thanks for working through this.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@cjcenizal
Copy link
Contributor Author

Retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@cjcenizal cjcenizal merged commit 54ebfc1 into elastic:master Mar 11, 2019
@cjcenizal cjcenizal deleted the user-action-index-management branch March 11, 2019 22:55
cjcenizal added a commit to cjcenizal/kibana that referenced this pull request Mar 11, 2019
* Fix API endpoint typo indices/clear_caches -> indices/clear_cache.
* Track Index Management index actions.
* Track user actions for opening detail tab and viewing various tabs.
  - Use constants instead of hard-coded strings to identify tabs.
  - Internationalize tab labels.
* Track update settings action.
* Track refresh action.
* Track app load.
cjcenizal added a commit that referenced this pull request Mar 12, 2019
* Fix API endpoint typo indices/clear_caches -> indices/clear_cache.
* Track Index Management index actions.
* Track user actions for opening detail tab and viewing various tabs.
  - Use constants instead of hard-coded strings to identify tabs.
  - Internationalize tab labels.
* Track update settings action.
* Track refresh action.
* Track app load.
Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cjcenizal Although this has been merged I think we should address the 2 comments I made. One is about React component lifecycle deprecated and the other is to maintain consistency across our apps. We can discuss over zoom if you want. Thanks!

</div>
);
export class App extends Component {
componentWillMount() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lifecycle is deprecated (https://reactjs.org/blog/2018/03/29/react-v-16-3.html). We should use componentDidMount()

@@ -32,6 +66,9 @@ export async function closeIndices(indices) {
indices
};
const response = await httpClient.post(`${apiPrefix}/indices/close`, body);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, I think it would have been better:

const actionType = indices.length > 1 ? UA_INDEX_CLOSE_MANY : UA_INDEX_CLOSE;
const request = httpClient.post(`${apiPrefix}/indices/close`, body);
const response = await trackUserRequest(request, actionType);
...

You know, I'm all about consistency 😊 Aside, the trackUserRequest() (that will come as a public method from the userAction plugin in the new platform) being an abstraction, we could easily extend it's behaviour in in a single place whenever needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this, found some ways to make trackUserRequest easier to understand, and agreed it's OK to have different implementations from app-to-app for now, with an eye towards unifying them in the future once the New Platform is in a state that supports this effort.

@cjcenizal cjcenizal added the non-issue Indicates to automation that a pull request should not appear in the release notes label May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Index Management Index and index templates UI Feature:Telemetry non-issue Indicates to automation that a pull request should not appear in the release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.2.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants