chore: Move tracing decorators into the codebase (#4623)
* Vendorize tracing, finally fix service name issues * Upgrade datadaog-metrics, rename decorators -> tracing * lint
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
InvalidAuthenticationError,
|
||||
AuthenticationProviderDisabledError,
|
||||
} from "@server/errors";
|
||||
import { APM } from "@server/logging/tracing";
|
||||
import { traceFunction } from "@server/logging/tracing";
|
||||
import { AuthenticationProvider, Collection, Team, User } from "@server/models";
|
||||
import teamProvisioner from "./teamProvisioner";
|
||||
import userProvisioner from "./userProvisioner";
|
||||
@@ -184,6 +184,6 @@ async function accountProvisioner({
|
||||
}
|
||||
}
|
||||
|
||||
export default APM.traceFunction({
|
||||
export default traceFunction({
|
||||
spanName: "accountProvisioner",
|
||||
})(accountProvisioner);
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
FileOperationType,
|
||||
FileOperationState,
|
||||
} from "@shared/types";
|
||||
import { APM } from "@server/logging/tracing";
|
||||
import { traceFunction } from "@server/logging/tracing";
|
||||
import { Collection, Event, Team, User, FileOperation } from "@server/models";
|
||||
import { getAWSKeyForFileOp } from "@server/utils/s3";
|
||||
|
||||
@@ -71,6 +71,6 @@ async function collectionExporter({
|
||||
return fileOperation;
|
||||
}
|
||||
|
||||
export default APM.traceFunction({
|
||||
export default traceFunction({
|
||||
spanName: "collectionExporter",
|
||||
})(collectionExporter);
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Transaction } from "sequelize";
|
||||
import utf8 from "utf8";
|
||||
import parseTitle from "@shared/utils/parseTitle";
|
||||
import { DocumentValidation } from "@shared/validations";
|
||||
import { APM } from "@server/logging/tracing";
|
||||
import { traceFunction } from "@server/logging/tracing";
|
||||
import { User } from "@server/models";
|
||||
import dataURItoBuffer from "@server/utils/dataURItoBuffer";
|
||||
import parseImages from "@server/utils/parseImages";
|
||||
@@ -229,6 +229,6 @@ async function documentImporter({
|
||||
};
|
||||
}
|
||||
|
||||
export default APM.traceFunction({
|
||||
export default traceFunction({
|
||||
spanName: "documentImporter",
|
||||
})(documentImporter);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import invariant from "invariant";
|
||||
import { Transaction } from "sequelize";
|
||||
import { ValidationError } from "@server/errors";
|
||||
import { APM } from "@server/logging/tracing";
|
||||
import { traceFunction } from "@server/logging/tracing";
|
||||
import { User, Document, Collection, Pin, Event } from "@server/models";
|
||||
import pinDestroyer from "./pinDestroyer";
|
||||
|
||||
@@ -203,6 +203,6 @@ async function documentMover({
|
||||
return result;
|
||||
}
|
||||
|
||||
export default APM.traceFunction({
|
||||
export default traceFunction({
|
||||
spanName: "documentMover",
|
||||
})(documentMover);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Transaction } from "sequelize";
|
||||
import slugify from "slugify";
|
||||
import { RESERVED_SUBDOMAINS } from "@shared/utils/domains";
|
||||
import { APM } from "@server/logging/tracing";
|
||||
import { traceFunction } from "@server/logging/tracing";
|
||||
import { Team, Event } from "@server/models";
|
||||
import { generateAvatarUrl } from "@server/utils/avatars";
|
||||
|
||||
@@ -103,6 +103,6 @@ async function findAvailableSubdomain(team: Team, requestedSubdomain: string) {
|
||||
return subdomain;
|
||||
}
|
||||
|
||||
export default APM.traceFunction({
|
||||
export default traceFunction({
|
||||
spanName: "teamCreator",
|
||||
})(teamCreator);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Transaction } from "sequelize";
|
||||
import { sequelize } from "@server/database/sequelize";
|
||||
import Logger from "@server/logging/Logger";
|
||||
import { APM } from "@server/logging/tracing";
|
||||
import { traceFunction } from "@server/logging/tracing";
|
||||
import {
|
||||
ApiKey,
|
||||
Attachment,
|
||||
@@ -198,6 +198,6 @@ async function teamPermanentDeleter(team: Team) {
|
||||
}
|
||||
}
|
||||
|
||||
export default APM.traceFunction({
|
||||
export default traceFunction({
|
||||
spanName: "teamPermanentDeleter",
|
||||
})(teamPermanentDeleter);
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
InvalidAuthenticationError,
|
||||
MaximumTeamsError,
|
||||
} from "@server/errors";
|
||||
import { APM } from "@server/logging/tracing";
|
||||
import { traceFunction } from "@server/logging/tracing";
|
||||
import { Team, AuthenticationProvider } from "@server/models";
|
||||
|
||||
type TeamProvisionerResult = {
|
||||
@@ -125,6 +125,6 @@ async function teamProvisioner({
|
||||
};
|
||||
}
|
||||
|
||||
export default APM.traceFunction({
|
||||
export default traceFunction({
|
||||
spanName: "teamProvisioner",
|
||||
})(teamProvisioner);
|
||||
|
||||
Reference in New Issue
Block a user