mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-23 11:57:50 -05:00
* Initial * CSS lint * Test CI * Add 1v1, 2v2, and 3v3 Tags (#1771) * Initial * CSS lint * Test CI * Rename step --------- Co-authored-by: xi <104683822+ximk@users.noreply.github.com>
30 lines
654 B
TypeScript
30 lines
654 B
TypeScript
const isEnabled =
|
|
process.env.NEW_RELIC_APP_NAME && process.env.NEW_RELIC_LICENSE_KEY;
|
|
|
|
import newrelic from "newrelic";
|
|
|
|
export const noticeError = (
|
|
error: Error,
|
|
attributes?: {
|
|
"enduser.id"?: number;
|
|
formData?: string;
|
|
searchParams?: string;
|
|
params?: string;
|
|
},
|
|
) =>
|
|
isEnabled &&
|
|
newrelic.noticeError(error, {
|
|
...attributes,
|
|
"tags.commit": process.env.RENDER_GIT_COMMIT!,
|
|
});
|
|
|
|
export const setTransactionName = (name: string) =>
|
|
isEnabled && newrelic.setTransactionName(name);
|
|
|
|
export const ignoreTransaction = () => {
|
|
if (!isEnabled) return;
|
|
|
|
const transactionHandle = newrelic.getTransaction();
|
|
transactionHandle.ignore();
|
|
};
|