mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-11-18 01:54:23 +01:00
Merge pull request #956 from tdurieux/t3/oss-logging-infrastructure
feat: add private structured logging and investigation dashboards
This commit is contained in:
40 files changed
+1835
-75
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { jobTrace } from "../../core/log-context";
|
||||
import { cacheMetricsReport } from "../../core/cache-observability";
|
||||
import { sharedBlobCache, resultBlobCache } from "../../core/blob-cache";
|
||||
import { AsyncCache } from "../../core/async-cache";
|
||||
@@ -985,7 +986,7 @@ router.delete(
|
||||
const repo = await getRepo(req, res, { nocheck: true });
|
||||
if (!repo) return;
|
||||
try {
|
||||
await cacheQueue.add(repo.repoId, { repoId: repo.repoId }, { jobId: `repo-${repo.repoId}` });
|
||||
await cacheQueue.add(repo.repoId, { repoId: repo.repoId, ...jobTrace() }, { jobId: `repo-${repo.repoId}` });
|
||||
return res.json({ status: repo.status });
|
||||
} catch (error) {
|
||||
handleError(error, res, req);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { jobTrace } from "../../core/log-context";
|
||||
import Repository from "../../core/Repository";
|
||||
import { sourceStorageSize } from "../../core/source/Source";
|
||||
import { maximumExpiration, neverExpirationDeadline, validateBillingExpiration } from "../../core/billing/expiration";
|
||||
@@ -42,7 +43,7 @@ router.use(ensureAuthenticated);
|
||||
|
||||
async function enqueueSavedSnapshot(model: IAnonymizedRepositoryDocument) {
|
||||
try {
|
||||
await downloadQueue.add(model.repoId, { repoId: model.repoId }, {
|
||||
await downloadQueue.add(model.repoId, { repoId: model.repoId, ...jobTrace() }, {
|
||||
jobId: `repo-${model.repoId}`, attempts: 3,
|
||||
});
|
||||
} catch (error) {
|
||||
@@ -878,7 +879,7 @@ router.post("/", async (req, res) => {
|
||||
}
|
||||
|
||||
res.send({ status: repo.status });
|
||||
downloadQueue.add(repo.repoId, { repoId: repo.repoId }, {
|
||||
downloadQueue.add(repo.repoId, { repoId: repo.repoId, ...jobTrace() }, {
|
||||
jobId: `repo-${repo.repoId}`,
|
||||
attempts: 3,
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { jobTrace } from "../../core/log-context";
|
||||
import { hasVisibleSubmodules } from "../../core/file-submodules";
|
||||
import { FILE_LISTING_LIMIT } from "../../core/file-tree";
|
||||
import { folderCounts as scopedFolderCounts } from "../../core/folder-counts";
|
||||
@@ -342,7 +343,7 @@ router.get(
|
||||
repo.statusActivityDate < fiveMinuteAgo
|
||||
) {
|
||||
await repo.updateStatus(RepositoryStatus.PREPARING);
|
||||
await downloadQueue.add(repo.repoId, { repoId: repo.repoId }, {
|
||||
await downloadQueue.add(repo.repoId, { repoId: repo.repoId, ...jobTrace() }, {
|
||||
jobId: `repo-${repo.repoId}`,
|
||||
attempts: 3,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user