Skip to content

Commit

Permalink
feat: init frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoffelen committed Aug 31, 2024
1 parent 1c5a187 commit 0c228a9
Show file tree
Hide file tree
Showing 33 changed files with 977 additions and 620 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
"packages/lambda-layer/nodejs",
"packages/*"
]
},
"devDependencies": {
"prettier": "^3.3.3"
}
}
1 change: 1 addition & 0 deletions packages/api/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ provider:
NODE_ENV: ${sls:stage}
TABLE_NAME: ${self:service}-${sls:stage}
CUSTOM_DOMAIN: ${param:CUSTOM_DOMAIN}
EDGE_ENDPOINT: !GetAtt HttpApi.ApiEndpoint
# S3_BUCKET: ${self:service}-${sls:stage}
# CLOUDFRONT_DOMAIN: !GetAtt UserMediaDistribution.DomainName
# USER_POOL_ID:
Expand Down
74 changes: 43 additions & 31 deletions packages/api/src/functions/collector/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,58 @@ export const app = async ({ body }) => {

if (span.type === "log") {
// save log span
await put({
...span,
pk: `transaction#${span.transactionId || span.transaction_id}`,
sk: `log#${span.started}#${span.id}`,
type: "log",
});
await put(
{
...span,
pk: `transaction#${span.transactionId || span.transaction_id}`,
sk: `log#${span.started}#${span.id}`,
type: "log",
},
true,
);
continue;
}

// save transaction span
await put({
...span,
pk: `transaction#${span.transactionId || span.transaction_id}`,
sk: `span#${span.started || span.sending_time}#${span.id}`,
type: "span",
spanType: span.type,
});
await put(
{
...span,
pk: `transaction#${span.transactionId || span.transaction_id}`,
sk: `span#${span.started || span.sending_time}#${span.id}`,
type: "span",
spanType: span.type,
},
true,
);

if (span.type === "function" && span.ended) {
// save function invocation details
await put({
...span,
pk: `function#${span.name}`,
sk: `invocation#${span.started}#${span.id}`,
type: "invocation",
});
await put(
{
...span,
pk: `function#${span.name}`,
sk: `invocation#${span.started}#${span.id}`,
type: "invocation",
},
true,
);

// save function meta data
await put({
pk: `function#${span.name}`,
sk: `function`,
type: "function",
lastInvocation: span.started,
runtime: span.runtime,
account: span.account,
region: span.region,
arn: span.invokedArn,
memoryAllocation: span.memoryAllocation,
timeout: span.maxFinishTime - span.started,
});
await put(
{
pk: `function#${span.name}`,
sk: `function`,
type: "function",
lastInvocation: span.started,
runtime: span.runtime,
account: span.account,
region: span.region,
arn: span.invokedArn,
memoryAllocation: span.memoryAllocation,
timeout: span.maxFinishTime - span.started,
},
true,
);
}
}
};
Expand Down
8 changes: 0 additions & 8 deletions packages/api/src/functions/media/upload/function.yml

This file was deleted.

38 changes: 0 additions & 38 deletions packages/api/src/functions/media/upload/handler.js

This file was deleted.

38 changes: 0 additions & 38 deletions packages/api/src/functions/media/upload/test.js

This file was deleted.

8 changes: 0 additions & 8 deletions packages/api/src/functions/preferences/get/function.yml

This file was deleted.

15 changes: 0 additions & 15 deletions packages/api/src/functions/preferences/get/handler.js

This file was deleted.

65 changes: 0 additions & 65 deletions packages/api/src/functions/preferences/get/test.js

This file was deleted.

8 changes: 0 additions & 8 deletions packages/api/src/functions/preferences/update/function.yml

This file was deleted.

46 changes: 0 additions & 46 deletions packages/api/src/functions/preferences/update/handler.js

This file was deleted.

Loading

0 comments on commit 0c228a9

Please sign in to comment.