-
Notifications
You must be signed in to change notification settings - Fork 244
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
Fetch locale information for Telemetry #5066
Fetch locale information for Telemetry #5066
Conversation
Not sure why, but I don't see any locale data in segment console. In order to have this as one of the traits you should it to following function as well https://github.com/openshift/odo/blob/44c35d5390ff0979310df44680619475cec9a871/pkg/segment/segment.go#L144-L147 |
Did you check in the "Raw" tab? Even the time zone data that's added via #5067 shows in the "Raw" tab in // This type provides the representation of the `context` object as defined in
// https://segment.com/docs/spec/common/#context
type Context struct {
App AppInfo `json:"app,omitempty"`
Campaign CampaignInfo `json:"campaign,omitempty"`
Device DeviceInfo `json:"device,omitempty"`
Library LibraryInfo `json:"library,omitempty"`
Location LocationInfo `json:"location,omitempty"`
Network NetworkInfo `json:"network,omitempty"`
OS OSInfo `json:"os,omitempty"` <------------------------------
Page PageInfo `json:"page,omitempty"`
Referrer ReferrerInfo `json:"referrer,omitempty"`
Screen ScreenInfo `json:"screen,omitempty"`
IP net.IP `json:"ip,omitempty"`
Locale string `json:"locale,omitempty"` <------------------------------
Timezone string `json:"timezone,omitempty"` <------------------------------
UserAgent string `json:"userAgent,omitempty"`
Traits Traits `json:"traits,omitempty"`
// This map is used to allow extensions to the context specifications that
// may not be documented or could be introduced in the future.
// The fields of this map are inlined in the serialized context object,
// there is no actual "extra" field in the JSON representation.
Extra map[string]interface{} `json:"-"`
} |
Have you been able to get to the If you check how vscode telemetry does it, they send locale and timezone info in both context and traits. I assume that the reason is that you can't see the all the context data in Woopra. Location might be a different story, that one is send only in context and it shows up in Woopra. I think that it might be because Woopra has a "native" location field, but no standard fieds for timezone and locale |
Woopra is not making much sense to me, tbh. In the sense, I'm not good at using it, yet.
Yeah, I assumed the same that adding it to |
yes please |
pkg/segment/segment.go
Outdated
// get the locale information | ||
tag, err := locale.Detect() | ||
if err != nil { | ||
return nil, err |
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.
If locale detection fails, the whole telemetry will fail, and nothing will be send, do we want that?
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.
Snap. I did it correctly when I added locale info in traits
. Fixed now.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feloy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
Co-authored-by: Philippe Martin <[email protected]>
Co-authored-by: Philippe Martin <[email protected]>
@dharmit It seems that
|
I think I should revert it to the way it was, that is, use |
Yes, and also using %s instead of %w I think |
Kudos, SonarCloud Quality Gate passed!
|
@dharmit: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/lgtm |
What type of PR is this?
/kind feature
What does this PR do / why we need it:
$subject
Which issue(s) this PR fixes:
Fixes part of #4994
PR acceptance criteria:
Unit test
Integration test
Documentation
I have read the test guidelines
How to test changes / Special notes to the reviewer:
Look at the data being captured in Segment. You should see "locale" information in the "Raw" data.