-
Notifications
You must be signed in to change notification settings - Fork 117
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
Custom dimensions in Log Analytics to replace custom variables #214
base: 3.x-dev
Are you sure you want to change the base?
Conversation
Hi @mattab, this is really WIP, completely untested, but to get to see if am kind of implementing what you had in mind. I tried to keep the code backward compatible, albeit making clear that custom variables are being deprecated. |
* Integrate Custom dimensions, as a replacement for Custom Variables. (Closes matomo-org#188) Signed-off-by: Samuele Kaplun <[email protected]>
So, I am currently running this on production 🎉 |
Thanks for the PR @kaplun 👍 In general, will you continue working on the PR until all of custom variables stuff is removed & converted to use custom dimensions? For example still seeing I think we may want to wait for Matomo 4 for merging this (although maybe not?) when we also close matomo-org/matomo#11524 |
I kept support for I think all implicit usage of custom variables have disappeared in this PR, in favor of custom dimensions. Have I missed something? |
(Note that this PR contains a first commit where I just improve the code style and fix some quick issues. So the real implementation is in the second commit). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks great, nothing to say there (except there is some code redundancy, but not super important right now). Some larger issues around the feature itself:
- Removing the Bot/Not-Bot/Http-Code custom variables is a BC break. If existing users depend on them they will be forced to immediately move over to custom dimensions, which I think will be a problem. I think it would be better to have a parameter that switches from custom variables => custom dimensions.
- Same for the --regex-group-to-...-cvar options. If someone's depending on them, this will cause problems for them.
- I haven't tested, but will this change result in errors if the CustomDimensions plugin is disabled? If so, that could cause problems for users.
- Looks like the code will always try and create a custom dimension for Http-Code/Bot/Not-Bot if one doesn't exist. I can't imagine everyone will want custom dimension slots taken up for those when there could be other more valuable (to them at least) dimensions they could be recording. This would also be an annoying surprise to someone who wasn't expecting it. I think this functionality should be off by default and enabled via CLI option.
👍 for the tests
CC @mattab / @tsteur (In fact, I wouldn't make changes based on these review comments until these two have weighed in.)
One other thing: before merging we should add system tests to |
Sure! Would you have some specs of which parameters you'd expect to choose between custom vars Vs. custom dims?
Note that these are still supported. I just amended the documentation with
👍 indeed I would need to gracefully communicate the error to the user. Also I haven't figured out a way to discover when Dimensions are exhausted.
There I mimicked the custom variables behavior. Before this PR custom variables were implicitly consumed to store Bot/Not-Bot/HTTP-Code/HTTP-Method. So there is probably a need to further amend the CLI, and make things more explicit. I can take care of amending it you can come up with exact specs of the CLI you think would be the most correct. Re: tests in PHP, I am currently slower on PHP than Python, so I'd appreciate help on that side 😄 |
Since no one else commented, I'll put my opinions:
Since the default behavior before was to always add them as custom variables, I think that should be retained. Then there could be a new option like
Gotcha, 👍
Here are some ideas:
Thoughts?
No worries, the system tests in matomo are particularly unfun to newcomers, and I wouldn't want you to stop contributing :) |
Integrate Custom dimensions, as a replacement for Custom
Variables. (Closes Use Custom Dimensions instead of Custom Variables (for Bots/Http-Status tracking and the feature --w3c-field-regex and --track-http-method) #188)
Signed-off-by: Samuele Kaplun [email protected]