Add support for dimensions to metrics#1447
Conversation
application/src/main/java/org/togetherjava/tjbot/features/analytics/Metrics.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/analytics/Metrics.java
Show resolved
Hide resolved
|
Looking good at a first glance. What I am about to ask shouldn't really
affect the functionality of what you created, but wouldn't the term
"metadata" be a more fitting name than "dimensions"?
It took me some time to figure out what "dimensions" stands for here,
though this could just be me that has never seen it named that way.
Just my two cents.
~Chris
|
See CloudWatch for example, it also uses the term dimension for metrics: |
|
its the idiomatic name. ive worked with google analytics and matomo for tracking stuff, they all called it dimensions. but yeah, the code should have some javadoc to explain what it is, such as "to track additional info, e.g. metadata" |
|
On 3/23/26 22:28, Connor Schweighöfer wrote:
See CloudWatch for example, it also uses the term **dimension** for metrics:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Dimension
Thank you for the resource Squid, I didn't know about that. :)
~Chris
|
|
Hi @Zabuzard, this is ready for another review. I have tested including tested in Grafana and we'll need to update the queries for some of the graphs e.g. for the Before: After: for the Before: After: The key thing here is that we're just using |
9037354 to
4dfd331
Compare
application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadCommand.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/tags/TagCommand.java
Outdated
Show resolved
Hide resolved
d4ffc67 to
d951c7d
Compare
application/src/main/java/org/togetherjava/tjbot/features/analytics/EmojiTrackerListener.java
Outdated
Show resolved
Hide resolved
|



Add custom dimension support to the Metrics class.
Changes:
TEXTcolumn tometric_events& migrates all the postfixed metrics with dimensionscount(String event, Map<String, String> dimensions)overload which serializes dimensions as JSON into the newdimensionscolumncount(String event)is unchanged (delegates to the new overload with an empty map)Example usage:
Migration:
local database before:

local database after:
