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

Content Analytics: Distinguish the source of stored events #30443

Closed
john-thomas-dotcms opened this issue Oct 24, 2024 · 6 comments · Fixed by #30516
Closed

Content Analytics: Distinguish the source of stored events #30443

john-thomas-dotcms opened this issue Oct 24, 2024 · 6 comments · Fixed by #30516

Comments

@john-thomas-dotcms
Copy link
Contributor

Parent Issue

No response

User Story

As a developer, I want to be able to distinguish among events fired by the dotCMS code, API calls, workflow actionlets, and Rules actionlets, so I can:

  1. Perform queries that distinguish between events generated by dotCMS, headless apps, and user-defined config (workflows and rules).
  2. Troubleshoot when events are either being fired or not being fired as expected.

Acceptance Criteria

  • A new Event Source field in each event identifies the source of the event.
    • This field contains one of an enumerated list of values.
    • For example DOTCMS, API, WORKFLOW, and RULE.
  • A new Event Source Detail field in each event provides additional details about the source of the event.
    • For example, the collector name (for DOTCMS), the endpoint URL (for API0, the Workflow action ID, or the Rule ID

Proposed Objective

Technical User Experience

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

Copy link

@jdotcms
Copy link
Contributor

jdotcms commented Oct 31, 2024

the core part is done, but the changes on clickhouse and so are not, @freddyDOTCMS will take care later

jdotcms added a commit that referenced this issue Nov 18, 2024
jdotcms added a commit that referenced this issue Nov 19, 2024
jdotcms added a commit that referenced this issue Nov 19, 2024
@jdotcms jdotcms moved this from In Progress to In Review in dotCMS - Product Planning Nov 19, 2024
jdotcms added a commit that referenced this issue Nov 20, 2024
github-merge-queue bot pushed a commit that referenced this issue Nov 20, 2024
Adding the event source + some minor refactoring
@github-project-automation github-project-automation bot moved this from In Review to Internal QA in dotCMS - Product Planning Nov 20, 2024
@jdotcms
Copy link
Contributor

jdotcms commented Nov 20, 2024

This wont be testable by QA until the new column is created into the clickhouse, the core changes are done but we have to wait until it.

Now in order to test it we have 4 sources:
DOT_CMS any server side hit, such as pages, file asset etc,
REST_API if you call the endpoint to create an event,
WORKFLOW if the event is created workflow actionlet,
RULE if the event is created by rules

@jcastro-dotcms jcastro-dotcms self-assigned this Nov 20, 2024
@jcastro-dotcms
Copy link
Contributor

INTERNAL QA: FAILED ❌

  • Docker Image: trunk_913c82b

When debugging the source from both Docker and the source code, the new expected event_source attribute is not making it to the Payload object.

@github-project-automation github-project-automation bot moved this from Internal QA to Current Sprint Backlog in dotCMS - Product Planning Nov 20, 2024
@jcastro-dotcms jcastro-dotcms moved this from Current Sprint Backlog to In Progress in dotCMS - Product Planning Nov 20, 2024
@jcastro-dotcms jcastro-dotcms moved this from In Progress to Internal QA in dotCMS - Product Planning Nov 22, 2024
@jcastro-dotcms
Copy link
Contributor

INTERNAL QA: PASSED ✅

  • Docker Image: trunk_68612b9

Content Analytics events include what dotCMS system triggered them now. A new column named event_source lets you know what feature created the event:

  • The DOT_CMS event source indicates that the event was created by dotCMS in general; i.e.; accessing the object form the front-end or the back-end.
  • The REST_API event source indicates that the event was created via the REST Endpoint. You can test it by creating an /index page, and calling this CURL command:
curl -u [email protected]:admin --location 'http://localhost:8080/api/v1/analytics/content/event' \
--header 'Content-Type: application/json' \
--data '{
    "event_type":"PAGE_REQUEST",
    "url":"/index",
    "screen_resolution":"1280x720"
}'
  • The WORKFLOW event source indicates that the event was created when running a Workflow Action on a Contentlet. You can set the Workflow Action like this:
Screenshot 2024-11-23 at 12 30 52 PM
  • The RULE event source indicates that the event was created by a Rule. You can set it up like this:
Screenshot 2024-11-23 at 12 30 29 PM

@jcastro-dotcms jcastro-dotcms removed their assignment Nov 23, 2024
@jcastro-dotcms jcastro-dotcms moved this from Internal QA to QA - Backlog in dotCMS - Product Planning Nov 23, 2024
@josemejias11
Copy link
Contributor

Approved: Tested on ** trunk_66e3b91**, Docker, macOS 14.5, FF v126.0.1

@josemejias11 josemejias11 moved this from QA - In Progress to Done in dotCMS - Product Planning Nov 26, 2024
@dsilvam dsilvam closed this as completed Nov 27, 2024
@github-project-automation github-project-automation bot moved this from Done to Internal QA in dotCMS - Product Planning Nov 27, 2024
@dsilvam dsilvam moved this from Internal QA to Done in dotCMS - Product Planning Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants