Openstatus www.openstatus.dev
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

🔥 improvment (#874)

authored by

Thibault Le Ouay and committed by
GitHub
f1457bb4 beabcb7c

+24 -17
+4
apps/checker/cmd/main.go
··· 260 260 if err != nil { 261 261 return fmt.Errorf("unable to ping: %w", err) 262 262 } 263 + 263 264 r.Region = flyRegion 265 + 264 266 res = r 267 + res.RequestId = req.RequestId 268 + res.WorkspaceId = req.WorkspaceId 265 269 if err := tinybirdClient.SendEvent(ctx, res, dataSourceName); err != nil { 266 270 log.Ctx(ctx).Error().Err(err).Msg("failed to send event to tinybird") 267 271 }
+11 -9
apps/checker/ping.go
··· 49 49 } 50 50 51 51 type Response struct { 52 - Status int `json:"status,omitempty"` 53 - Latency int64 `json:"latency"` 54 - Body string `json:"body,omitempty"` 55 - Headers map[string]string `json:"headers,omitempty"` 56 - Time int64 `json:"time"` 57 - Timing Timing `json:"timing"` 58 - Error string `json:"error,omitempty"` 59 - Tags []string `json:"tags,omitempty"` 60 - Region string `json:"region"` 52 + RequestId int64 `json:"requestId,omitempty"` 53 + WorkspaceId int64 `json:"workspaceId,omitempty"` 54 + Status int `json:"status,omitempty"` 55 + Latency int64 `json:"latency"` 56 + Body string `json:"body,omitempty"` 57 + Headers map[string]string `json:"headers,omitempty"` 58 + Time int64 `json:"time"` 59 + Timing Timing `json:"timing"` 60 + Error string `json:"error,omitempty"` 61 + Tags []string `json:"tags,omitempty"` 62 + Region string `json:"region"` 61 63 } 62 64 63 65 func Ping(ctx context.Context, client *http.Client, inputData request.CheckerRequest) (PingData, error) {
+6 -5
apps/checker/request/request.go
··· 59 59 } 60 60 61 61 type PingRequest struct { 62 - ID string `json:"id"` 63 - URL string `json:"url"` 64 - Method string `json:"method"` 65 - Body string `json:"body"` 66 - Headers map[string]string `json:"headers"` 62 + RequestId int64 `json:"requestId"` 63 + WorkspaceId int64 `json:"workspaceId"` 64 + URL string `json:"url"` 65 + Method string `json:"method"` 66 + Body string `json:"body"` 67 + Headers map[string]string `json:"headers"` 67 68 }
+3 -3
apps/server/src/v1/check/post.ts
··· 45 45 export function registerPostCheck(api: typeof checkAPI) { 46 46 return api.openapi(postRoute, async (c) => { 47 47 const data = c.req.valid("json"); 48 - const workspaceId = c.get("workspaceId"); 48 + const workspaceId = Number(c.get("workspaceId")); 49 49 const input = c.req.valid("json"); 50 50 51 51 const { headers, regions, runCount, aggregated, ...rest } = data; ··· 72 72 }, 73 73 method: "POST", 74 74 body: JSON.stringify({ 75 - checkId: newCheck.id, 75 + requestId: newCheck.id, 76 76 workspaceId: workspaceId, 77 77 url: input.url, 78 78 method: input.method, ··· 195 195 196 196 aggregatedResponse = AggregatedResult.parse({ 197 197 dns: aggregatedDNS, 198 - connection: aggregatedConnect, 198 + connect: aggregatedConnect, 199 199 tls: aggregatedTls, 200 200 firstByte: aggregatedFirst, 201 201 transfer: aggregatedTransfer,