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

[Dashboard] [Telemetry] Report panels in dashboards by type #130166

Merged
merged 5 commits into from
Apr 19, 2022

Conversation

Heenawter
Copy link
Contributor

@Heenawter Heenawter commented Apr 13, 2022

Summary

This PR adjusts the old dashboard panel telemetry to have the following structure:

"dashboard": {
  "panels": {
    "total": 35,
    "by_reference": 30,
    "by_value": 5,
    "by_type": {
      "lens": {
        "total": 16,
        "by_reference": 13,
        "by_value": 3,
        "details": {}
      },
      "visualization": {
        "total": 16,
        "by_reference": 14,
        "by_value": 2,
        "details": {
          "dynamic_actions_count": 1,
          "dynamic_actions_actions_dashboard_to_dashboard_drilldown_count": 1,
          "dynamic_actions_triggers_filter_trigger_count": 1,
          "dynamic_actions_action_triggers_dashboard_to_dashboard_drilldown_filter_trigger_count": 1
        }
      },
      "search": {
        "total": 2,
        "by_reference": 2,
        "by_value": 0,
        "details": {}
      },
      "map": {
        "total": 1,
        "by_reference": 1,
        "by_value": 0,
        "details": {}
      }
    }
  }
}

Checklist

Delete any items that are not applicable to this PR.

@Heenawter Heenawter added release_note:enhancement Feature:Dashboard Dashboard related features Feature:Telemetry Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:small Small Level of Effort impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. backport:skip This commit does not require backporting labels Apr 13, 2022
@Heenawter Heenawter self-assigned this Apr 13, 2022
@Heenawter Heenawter force-pushed the fix-panel-telemetry_2022-04-13 branch from 5a29844 to b4a78e1 Compare April 13, 2022 23:09
@Heenawter Heenawter force-pushed the fix-panel-telemetry_2022-04-13 branch from 6038c76 to 00bc5e1 Compare April 14, 2022 15:42
@Heenawter Heenawter marked this pull request as ready for review April 14, 2022 15:48
@Heenawter Heenawter requested review from a team as code owners April 14, 2022 15:48
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

This re-structure looks good to me, and fits perfectly with how I was planning on doing the controls telemetry! Just left one nit about the typings.

by_reference: number;
by_value: number;
details: {
[key: string]: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

The one nit I have here is that the details mapping is maybe too specific. If Lens for example, wanted to track something else, we'd be narrowing the type down too far. The schema would also need to be updated.

Copy link
Contributor Author

@Heenawter Heenawter Apr 14, 2022

Choose a reason for hiding this comment

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

Looked in to that, and it doesn't seem like it's possible with the current limitations on the schema object. Basically, the only types that are supported are:

image

I thought about making it details: { [key: string]: unknown; } and giving the schema { type: object } but that doesn't seem to be supported. @elastic/kibana-telemetry might be able to help us out here, but for now I think we have to stick to a flat JSON object for details 🤷

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for looking into this! Strange that only a subset of types are supported, but I suppose it makes sense if things are expected to mostly be counters. Leaving it as is sounds good to me!

// the following "details" need a follow-up that will actually properly consolidate
// the data from all embeddables - right now, the only data that is kept is the
// telemetry for the **final** embeddable of that type
collectorData.panels.by_type[type].details = embeddableService.telemetry(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is awesome 🔥

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @Heenawter

@Heenawter Heenawter merged commit 64d7bcc into elastic:main Apr 19, 2022
@Heenawter Heenawter deleted the fix-panel-telemetry_2022-04-13 branch April 19, 2022 21:40
@ThomThomson ThomThomson mentioned this pull request Apr 21, 2022
2 tasks
@Heenawter Heenawter added auto-backport Deprecated: Automatically backport this PR after it's merged and removed backport:skip This commit does not require backporting labels Apr 21, 2022
kibanamachine pushed a commit that referenced this pull request Apr 21, 2022
* Add new panel telemetry

* Restructure panel data to sort by type first

* Fix jest tests + slight restructure

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 64d7bcc)
kibanamachine pushed a commit that referenced this pull request Apr 21, 2022
* Add new panel telemetry

* Restructure panel data to sort by type first

* Fix jest tests + slight restructure

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 64d7bcc)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.2
7.17

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Apr 21, 2022
…30166) (#130804)

* [Dashboard] [Telemetry] Report panels in dashboards by type (#130166)

* Add new panel telemetry

* Restructure panel data to sort by type first

* Fix jest tests + slight restructure

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 64d7bcc)

* Fix conflicts

Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
Co-authored-by: heenawter <hannah.wright@elastic.co>
kibanamachine added a commit that referenced this pull request Apr 21, 2022
…130166) (#130805)

* [Dashboard] [Telemetry] Report panels in dashboards by type (#130166)

* Add new panel telemetry

* Restructure panel data to sort by type first

* Fix jest tests + slight restructure

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 64d7bcc)

* Fix conflicts

Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
Co-authored-by: heenawter <hannah.wright@elastic.co>
dmlemeshko pushed a commit to dmlemeshko/kibana that referenced this pull request May 5, 2022
…130166)

* Add new panel telemetry

* Restructure panel data to sort by type first

* Fix jest tests + slight restructure

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
kertal pushed a commit to kertal/kibana that referenced this pull request May 24, 2022
…130166)

* Add new panel telemetry

* Restructure panel data to sort by type first

* Fix jest tests + slight restructure

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated: Automatically backport this PR after it's merged Feature:Dashboard Dashboard related features Feature:Telemetry impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort release_note:enhancement Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.2.1 v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants