Skip to content
Snippets Groups Projects

Additional internal event properties handling

Merged Michał Wielich requested to merge michold-internal-extras into master
All threads resolved!

What does this MR do and why?

Related to #434504 (closed)

Make it possible to pass property, value & label to InternalEvents.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Enable snowplow micro
  2. Trigger an event that has the new attributes: for example, open the console and perform Gitlab::InternalEvents.track_event('user_viewed_dashboard_list', user: User.first, additional_properties: { label: 'event_label', property: 'event_prop', value: 123 })
  3. Check if a new event with that includes the sent property, label and value has been registered at localhost:9090/micro/good
  4. Add an event with mapping: following the new instructions in the internal_event_instrumentation/quick_start.md file, add a properties section to a new or an existing event file. For example, add this segment into the user_viewed_dashboard_list.yml file:
properties:
  user_role:
    external_key: label
  1. Clean up the memoized events library by running reload! in the console
  2. Trigger this event using the mapped keys, for example: Gitlab::InternalEvents.track_event('user_viewed_dashboard_list', user: User.first, additional_properties: { user_role: 'admin', value: 14 })
  3. Check if a new event with that includes the sent property, label and/or value has been registered at localhost:9090/micro/good
Edited by Michał Wielich

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • A deleted user added backend label

    added backend label

  • Contributor
    1 Message
    :book: This MR contains docs in the /development directory. Any Maintainer, other than the author, can merge. You do not need tech writer review.

    Reviewer roulette

    Category Reviewer Maintainer
    backend @tyleramos profile link current availability (UTC-5, 6 hours behind author) @jwoodwardgl profile link current availability (UTC+0, 1 hour behind author)

    Please check reviewer's status!

    • available Reviewer is available!
    • unavailable Reviewer is unavailable!

    Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.

    If needed, you can retry the :repeat: danger-review job that generated this comment.

    Generated by :no_entry_sign: Danger

  • Michał Wielich
  • Contributor

    E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for 7f14713c

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Govern      | 3      | 0      | 0       | 0     | 3     | ✅     |
    | Monitor     | 7      | 0      | 0       | 0     | 7     | ✅     |
    | Plan        | 4      | 0      | 0       | 0     | 4     | ✅     |
    | Data Stores | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Create      | 8      | 0      | 3       | 0     | 11    | ✅     |
    | Package     | 0      | 0      | 1       | 0     | 1     | ➖     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 24     | 0      | 4       | 0     | 28    | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-package-and-test: :white_check_mark: test report for 7f14713c

    expand test summary
    +---------------------------------------------------------------------+
    |                           suites summary                            |
    +----------------+--------+--------+---------+-------+-------+--------+
    |                | passed | failed | skipped | flaky | total | result |
    +----------------+--------+--------+---------+-------+-------+--------+
    | Monitor        | 36     | 0      | 13      | 0     | 49    | ✅     |
    | GitLab Metrics | 2      | 0      | 1       | 0     | 3     | ✅     |
    | Create         | 153    | 0      | 19      | 4     | 172   | ✅     |
    | Govern         | 6      | 0      | 0       | 0     | 6     | ✅     |
    | Plan           | 8      | 0      | 0       | 0     | 8     | ✅     |
    | Package        | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Data Stores    | 4      | 0      | 0       | 0     | 4     | ✅     |
    +----------------+--------+--------+---------+-------+-------+--------+
    | Total          | 209    | 0      | 35      | 4     | 244   | ✅     |
    +----------------+--------+--------+---------+-------+-------+--------+
  • Michał Wielich added 1 commit

    added 1 commit

    • 888fa11a - Additional internal event properties handling

    Compare with previous version

  • Michał Wielich changed the description

    changed the description

  • Michał Wielich added 1 commit

    added 1 commit

    • ecb15c5f - Additional internal event properties handling

    Compare with previous version

  • Michał Wielich requested review from @syasonik

    requested review from @syasonik

    • Resolved by Michał Wielich

      @michold I'm a bit confused here: #434504 (closed) and the accompanying epic &12212 (closed) both call out a method signature that's different. Specifically, the idea was that the signature should clearly signify that label, properties etc. are additional properties that are not pseudo-required such as user or namespace (which always should be passed if available), and which makes it easy to transition to fully custom properties with different names without having to change the signature, e.g.

      Gitlab::InternalEvents.track_event(
              "push_package_to_repository",
              user: user,
              namespace: namespace,
              project: project
              additionalProperties: { label: "nuget"}
      )

      could become

      Gitlab::InternalEvents.track_event(
              "push_package_to_repository",
              user: user,
              namespace: namespace,
              project: project
              additionalProperties: { repository_type: "nuget"}
      )

      in a later iteration.

      Is there a specific reason why you put label etc on the same level as user?

  • Michał Wielich removed review request for @syasonik

    removed review request for @syasonik

  • mentioned in issue #434504 (closed)

  • mentioned in issue #440450 (closed)

  • Michał Wielich added 1 commit

    added 1 commit

    • 7a9c41dc - Additional internal event properties handling

    Compare with previous version

  • Michał Wielich added 2477 commits

    added 2477 commits

    Compare with previous version

  • Michał Wielich added 1 commit

    added 1 commit

    • ad35a336 - Additional internal event properties handling

    Compare with previous version

  • Michał Wielich changed the description

    changed the description

  • Michał Wielich requested review from @syasonik

    requested review from @syasonik

  • Sarah Yasonik
  • Sarah Yasonik removed review request for @syasonik

    removed review request for @syasonik

  • 🤖 GitLab Bot 🤖 changed milestone to %16.10

    changed milestone to %16.10

  • Michał Wielich added 1 commit

    added 1 commit

    • 13f37721 - Rewrite the add_prop documentation

    Compare with previous version

  • Michał Wielich requested review from @syasonik

    requested review from @syasonik

  • Sarah Yasonik removed review request for @syasonik

    removed review request for @syasonik

  • Michał Wielich mentioned in issue #442452

    mentioned in issue #442452

  • Michał Wielich added 1 commit

    added 1 commit

    • 36e9c805 - Add ruby SDK tracking of additional properties

    Compare with previous version

  • Michał Wielich requested review from @syasonik

    requested review from @syasonik

  • Sarah Yasonik approved this merge request

    approved this merge request

  • Sarah Yasonik removed review request for @syasonik

    removed review request for @syasonik

  • Michał Wielich requested review from @furkanayhan

    requested review from @furkanayhan

  • Furkan Ayhan removed review request for @furkanayhan

    removed review request for @furkanayhan

  • requested review from @suraj_tripathy

  • Suraj Tripathi
  • Michał Wielich added 1 commit

    added 1 commit

    • 79b78d8e - Refactor InternalEvents & fix external_key bug

    Compare with previous version

  • Author Maintainer

    Rebasing cause CI fails seem unrelated.

  • Michał Wielich added 3345 commits

    added 3345 commits

    • 79b78d8e...aa5c69c6 - 3341 commits from branch master
    • 229de163 - Additional internal event properties handling
    • e071e0b4 - Rewrite the add_prop documentation
    • 0d5320a9 - Add ruby SDK tracking of additional properties
    • 791b7ee3 - Refactor InternalEvents & fix external_key bug

    Compare with previous version

  • Suraj Tripathi approved this merge request

    approved this merge request

  • Suraj Tripathi resolved all threads

    resolved all threads

  • Suraj Tripathi enabled an automatic merge when the pipeline for a6bf6be9 succeeds

    enabled an automatic merge when the pipeline for a6bf6be9 succeeds

  • Michał Wielich aborted the automatic merge because source branch was updated

    aborted the automatic merge because source branch was updated

  • Michał Wielich added 222 commits

    added 222 commits

    • 791b7ee3...f379c859 - 218 commits from branch master
    • e8f234c1 - Additional internal event properties handling
    • 48e1b962 - Rewrite the add_prop documentation
    • 22cae5a3 - Add ruby SDK tracking of additional properties
    • 7f14713c - Refactor InternalEvents & fix external_key bug

    Compare with previous version

  • Michał Wielich resolved all threads

    resolved all threads

  • Suraj Tripathi enabled an automatic merge when the pipeline for abd743cd succeeds

    enabled an automatic merge when the pipeline for abd743cd succeeds

  • merged

  • Suraj Tripathi mentioned in commit 30a6b01b

    mentioned in commit 30a6b01b

  • Michał Wielich mentioned in merge request !146209 (merged)

    mentioned in merge request !146209 (merged)

  • added workflowstaging label and removed workflowcanary label

  • Ankit Panchal mentioned in merge request !146481 (merged)

    mentioned in merge request !146481 (merged)

  • mentioned in issue #462378 (closed)

  • Sarah Yasonik mentioned in merge request !169685 (closed)

    mentioned in merge request !169685 (closed)

  • Please register or sign in to reply
    Loading