Welcome to senselogs Discussions! #1
Replies: 2 comments
-
Just curious a bit confused about how the metrics work and wanted to see if this was correct. Let's say I have an ecommerce store and I want to track total sales, total revenue, and be able to filter this down by how much each product generates. Would the following work for that case? // Sold a product (123) for $20.00 (2000 cents)
log.metrics('metrics', 'My App', 'Sales', { Count: 1, Revenue: 2000 }, ['productId'], null, { productId: '123' }) |
Beta Was this translation helpful? Give feedback.
-
That will emit revenue and sales by product (non aggregated over products). That looks right. If in doubt, past the actual log EMF message here to check from CloudWatch or SenseDeep if using that. So 'My App' would be the log message prefix. Sales would be your CWL namespace and you are emitting 2 metrics: 'Count' and 'Revenue'. Your dimension is productId |
Beta Was this translation helpful? Give feedback.
-
Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
If you have general questions, please ask here. If they resolve to an issue, then open a bug ticket under issues.
Beta Was this translation helpful? Give feedback.
All reactions