Conversation
| func resolveAnalyticsProjectID() (string, error) { | ||
| if project != nil && project.ProjectId != "" { | ||
| return project.ProjectId, nil | ||
| } | ||
|
|
||
| if project == nil { | ||
| return "", fmt.Errorf("%s; %s", analyticsProjectIDRequirement, analyticsProjectSelectHint) | ||
| } | ||
|
|
||
| projectName := project.Name | ||
| if strings.TrimSpace(projectName) == "" { | ||
| projectName = "<selected>" | ||
| } | ||
|
|
||
| return "", fmt.Errorf( | ||
| "selected project [%s] is missing project_id; %s. %s", | ||
| projectName, | ||
| analyticsProjectIDRequirement, | ||
| analyticsProjectSelectHint, | ||
| ) | ||
| } |
There was a problem hiding this comment.
Urf, I would love a better solution than this...it basically mandates the user either remove and re-auth the legacy project, or go and edit ~/.livekit/cli-config.yaml to manually add it. We've only started storing the project ID in the last ~5 months.
Let me see if there's an easy way to maybe install a startup hook that will backfill old projects with their ID.
There was a problem hiding this comment.
Yeah this is a bummer. I only noticed this since I fell into that older case, but it wasn't a big deal for me to re-auth (or just manually add it back in).
I couldn't find any endpoint/way of fetching the ID, otherwise I'd be happy to take a stab at a backfill. Let me know what you find.
|
This looks great so far! I will take a closer look and play around with it this evening. To answer your question, no -- analytics service is not implemented in LiveKit OSS. But neither are the |
Adds a new
lk analyticscommand group to query LiveKit Cloud Analytics sessions.lk analytics listandlk analytics get SESSION_ID.--json/-joutput for both commands.--limit,--page,--start,--endwith validation.--project/ default project) and requires storedproject_id(no--project-idoverride).--curlsupport for analytics REST requests (prints equivalent curl command).go test ./cmd/lk.Mostly generated with Codex with manual code review.
Biggest thing I assumed was this is tightly coupled to LiveKit Cloud. Does this endpoint work for self hosted instances? I think the way this is built works for custom server URLs, but maybe some of the messages need to be tweaked