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

chore: Improve metrics format #117

Merged
merged 1 commit into from
Jan 30, 2025
Merged

chore: Improve metrics format #117

merged 1 commit into from
Jan 30, 2025

Conversation

just-boris
Copy link
Member

Issue #, if available: AWSUI-60324

Description of changes:

Fixing metrics according to the guidance from the Panorama API owners

  • remove eventName as it is a legacy field
  • always set eventType: 'awsui' for everything we emit to make it more discoverable among other entries
  • set metric name as eventContext

The final hierarchy of the fields is the following:

eventType (always "awsui" for us) -> eventContext (event in our system, typically a component usage) -> eventDetail (all metadata)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.30%. Comparing base (3c08c6f) to head (81162de).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #117      +/-   ##
==========================================
- Coverage   99.30%   99.30%   -0.01%     
==========================================
  Files          29       29              
  Lines         721      715       -6     
  Branches      193      186       -7     
==========================================
- Hits          716      710       -6     
  Misses          5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@just-boris just-boris marked this pull request as ready for review January 30, 2025 13:42
@just-boris just-boris requested a review from a team as a code owner January 30, 2025 13:42
@just-boris just-boris requested review from dpitcock and removed request for a team January 30, 2025 13:42

expect(window.panorama).toHaveBeenCalledWith(
'trackCustomEvent',
expect.objectContaining({ eventType: 'custom', eventValue: '{"test":"value"}', eventDetail: '{"test":"detail"}' })
expect.objectContaining({ eventValue: '{"test":"value"}', eventDetail: '{"test":"detail"}' })
Copy link
Member

@dpitcock dpitcock Jan 30, 2025

Choose a reason for hiding this comment

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

should this also contain a eventType: 'awsui'?

Copy link
Member Author

Choose a reason for hiding this comment

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

Since it uses expect.objectContaining, it passes regardless.

I decided to skip, because testing this field is not a subject of this test. We have many others to do this check

@just-boris just-boris added this pull request to the merge queue Jan 30, 2025
Merged via the queue into main with commit 9b48c5e Jan 30, 2025
36 checks passed
@just-boris just-boris deleted the metric-improvements branch January 30, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants