* fix: improve user telemetry
- move GetEmailFromJwt to common function
- update AttachJwtToContext() to use standard way of attaching value to context
- update userEmail in every possible sendEvent call
- send groupId in sendEvent call for SaaS operator analytics
* chore: added DEFAULT_CLOUD_EMAIL const
* chore: add AttachJwtToContext to analytics middleware
* test: added AttachJwtToContext to logs pipelines
From the Go specification [1]:
"1. For a nil slice, the number of iterations is 0."
"3. If the map is nil, the number of iterations is 0."
Therefore, an additional nil check for before the loop is unnecessary.
[1]: https://go.dev/ref/spec#For_range
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
*feat: Update query-service Go version to 1.17 #911
*chore: Upgrade to clickhouse versions v2 #751
*feat: Duration sorting in events table of Trace-filter page #826
*feat: Add grpc status code to traces view #975
*feat: added filtering by resource attributes #881
* chore: changed lib
* chore: changed lib
* chore: changed lib
* chore: changed lib
* chore: changes in params
* chore: changes in params
* chore: moving telemetry to a separate package
* feat: enabling telemetry via env var
* chore: removing posthog api_key
* feat: send heartbeat every 6hr
* feat: enabled version in application
* feat: added getter and setter apis and struct for user preferences
* feat: added version to properties to event
* feat: added apis to set and get user preferences and get version
* chore: refactored get and set userPreferences apis to dao pattern
* chore: added checks for telemetry enabled and anonymous during initialization
* chore: changed anonymous user functionality
* chore: sanitization
* chore: added uuid for userPreferences to send when user is anonymous