Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: track the first time html is served in telemetry#16334

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugodutka merged 16 commits intomainfromhugodutka/telemetry-html-first-served
Jan 31, 2025

Conversation

hugodutka
Copy link
Contributor

@hugodutkahugodutka commentedJan 29, 2025
edited
Loading

Addresseshttps://github.com/coder/nexus/issues/175.

Changes

  • Adds thetelemetry_items database table. It's a key value store for telemetry events that don't fit any other database tables.
  • Adds a telemetry report when HTML is served for the first time insite.go.

@hugodutkahugodutkaforce-pushed thehugodutka/telemetry-html-first-served branch from24b1f2a to63246e8CompareJanuary 29, 2025 19:01
@hugodutkahugodutka changed the titlechorte: track the first time html is served in telemetrychore: track the first time html is served in telemetryJan 29, 2025
@hugodutkahugodutka marked this pull request as ready for reviewJanuary 30, 2025 16:27
Copy link
Contributor

@dannykoppingdannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Overall LGTM
Nothing major that needs fixing


accessURL := waitAccessURL(t, cfg)

ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nit:

Suggested change
ctx,cancel:=context.WithTimeout(context.Background(),testutil.WaitMedium)
ctx:=testutil.Context(t,testutil.WaitMedium)

hugodutka reacted with thumbs up emoji
@@ -1536,6 +1557,20 @@ type Organization struct {
CreatedAt time.Time `json:"created_at"`
}

//revive:disable:exported
type TelemetryItemKey string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't see why this has to be exported; can you elaborate pls?

Copy link
ContributorAuthor

@hugodutkahugodutkaJan 31, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Just a habit that when I export enum values, I export their type too. It's not strictly necessary here.

// The purpose is to track the first time the first user opens the site.
func (h *Handler) reportHTMLFirstServedAt() {
// nolint:gocritic // Manipulating telemetry items is system-restricted.
ctx := dbauthz.AsSystemRestricted(context.Background())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please add a TODO to add a telemetry context in RBAC at some point.

hugodutka reacted with thumbs up emoji
site/site.go Outdated
@@ -183,6 +187,8 @@ type Handler struct {

Entitlements *entitlements.Set
Experiments atomic.Pointer[codersdk.Experiments]

TelemetryHTMLServedOnce sync.Once
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why is this exported?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It doesn't need to be - thanks for catching it.

@hugodutkahugodutka merged commit2ace044 intomainJan 31, 2025
33 of 35 checks passed
@hugodutkahugodutka deleted the hugodutka/telemetry-html-first-served branchJanuary 31, 2025 12:55
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 31, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@dannykoppingdannykoppingdannykopping approved these changes

Assignees

@hugodutkahugodutka

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@hugodutka@dannykopping

[8]ページ先頭

©2009-2025 Movatter.jp