godspeedsystems / gs-node-service

Godspeed microservice framework
https://godspeed.systems/
Other
623 stars 15 forks source link

User Tracing Spec #774

Open rohitgodspeed opened 11 months ago

rohitgodspeed commented 11 months ago

PART 1: managing user and org setup

Registration of ORg

When org is created the supplied email

Single User Registration

Use the current form as it is.

Creating or Linking Users with an Org

Forced Linking a project with an org

Microservice Used for User and Departments

Supabase

PART 2: Tracking

Permission to run godspeed commands

By developer usage (local environment)

Whenever a dev runs a command then send the following event details to the tracking backend

  1. gs_user_id: User will have to set an environment variable in his shell or the project’s .env file.
  2. Command: Name of the Godspeed command.
  3. Args: A string specifying the remaining args as user typed when initiating the command.
  4. MacId (sensitive)
  5. IpAddress (sensitive): To be extracted from the headers of the request.
  6. Plugins: To be added in future.
  7. Environment (sensitive): A JSON Object with key value. This must include in V1: Node version, OS.
  8. Git_url: (sensitive) The projects git remote url (needed for all commands except godspeed create and help). If this is not set, generate error without running the command. Say “Please set your github remote repository”.
  9. Timestamp in ddMMyyhh:mm:ss in UTC.

The endpoint to which it will send POST request is: godspeed.systems/usage/dev

By service (in hosted environment)

Whenever godspeed dev, start or serve is run from any environment then send the uptime pings for tracking of uptime. (Not for godspeed dev command).

  1. Timestamp in ddMMyyhh:mm:ss in UTC
  2. Uptime: in seconds
  3. Cmd: dev|start|serve ENUM
  4. gs_user_id: User will have to set an environment variable in his shell or the project’s .env file.
  5. Git_url: The projects git remote url (needed for all commands except godspeed create and help). If this is not set, generate error without running the command. Say “Please set your github remote repository”.
  6. IpAddress
  7. MacId (if available)
  8. K8s podId, nodeId, clusterId (if available) Ask Avtar how to uniquely identify an instance of a microservice with and without K8s.

NOTE: P1

kushal-godspeed commented 11 months ago

In this sprint, just create tasks.

Figure out if we can use Prometheus or Open Telemetry to track new godspeed user.
Error reporting.
Track all the CLI function invocation.
Figure out rate limiting on call based on ORG key.
No of unique services.
siddarthvader commented 11 months ago

not in favour of using supabase for the user flow because we will eventually hit the end wall or vendor lockin.

We should probably use a custom setup for example postgres+lucia+drizzle or something else.