From e5081dab7e980954f27284f0d1b424440d41bc59 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 8 Aug 2021 00:14:55 -0700 Subject: [PATCH] Disable honeycomb auto instrumentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Huh, well, I can't figure out what in our production env stopped working with Honeycomb's automatic instrumentation… so, oh well! Let's try disabling it for now and see if it works. This means our Honeycomb logs will no longer include _super helpful_ visualizations of how HTTP requests and MySQL queries create a request dependency waterfall… but I haven't opened Honeycomb in a while, and this bug is blocking all of prod, so if this fixes the site then I'm okay with that as a stopgap! Btw the error message was: ``` Unhandled rejection: TypeError: Cannot read property 'id' of undefined at exports.instrumentLoad (/var/task/node_modules/honeycomb-beeline/lib/instrumentation.js:80:14) at Function._load (/var/task/node_modules/honeycomb-beeline/lib/instrumentation.js:164:16) at ModuleWrap. (internal/modules/esm/translators.js:199:29) at ModuleJob.run (internal/modules/esm/module_job.js:169:25) at Loader.import (internal/modules/esm/loader.js:177:24) ``` Oh also, this is the first time eslint has looked at scripts/build-cached-data.js I guess, so I fixed some lint errors in there. --- api/allWakaValues.js | 1 + api/assetImage.js | 1 + api/graphql.js | 1 + api/outfitImage.js | 1 + api/outfitPageSSR.js | 1 + api/sendFeedback.js | 1 + api/uploadLayerImage.js | 1 + api/validPetPoses.js | 1 + scripts/build-cached-data.js | 4 ++-- 9 files changed, 10 insertions(+), 2 deletions(-) diff --git a/api/allWakaValues.js b/api/allWakaValues.js index 56ad430..ec97e6e 100644 --- a/api/allWakaValues.js +++ b/api/allWakaValues.js @@ -5,6 +5,7 @@ const beeline = require("honeycomb-beeline")({ ? "Dress to Impress (2020)" : "Dress to Impress (2020, dev)", serviceName: "impress-2020-gql-server", + enabledInstrumentations: [], }); import fetch from "node-fetch"; diff --git a/api/assetImage.js b/api/assetImage.js index 6aaa1fc..4a2e1bc 100644 --- a/api/assetImage.js +++ b/api/assetImage.js @@ -15,6 +15,7 @@ const beeline = require("honeycomb-beeline")({ ? "Dress to Impress (2020)" : "Dress to Impress (2020, dev)", serviceName: "impress-2020-gql-server", + enabledInstrumentations: [], }); const { chromium } = require("playwright"); diff --git a/api/graphql.js b/api/graphql.js index 07a8b23..08d9baa 100644 --- a/api/graphql.js +++ b/api/graphql.js @@ -5,6 +5,7 @@ const beeline = require("honeycomb-beeline")({ ? "Dress to Impress (2020)" : "Dress to Impress (2020, dev)", serviceName: "impress-2020-gql-server", + enabledInstrumentations: [], samplerHook, }); diff --git a/api/outfitImage.js b/api/outfitImage.js index e267633..e68e790 100644 --- a/api/outfitImage.js +++ b/api/outfitImage.js @@ -31,6 +31,7 @@ const beeline = require("honeycomb-beeline")({ ? "Dress to Impress (2020)" : "Dress to Impress (2020, dev)", serviceName: "impress-2020-gql-server", + enabledInstrumentations: [], sampleRate: 10, }); diff --git a/api/outfitPageSSR.js b/api/outfitPageSSR.js index 68a2898..b0808b7 100644 --- a/api/outfitPageSSR.js +++ b/api/outfitPageSSR.js @@ -19,6 +19,7 @@ const beeline = require("honeycomb-beeline")({ ? "Dress to Impress (2020)" : "Dress to Impress (2020, dev)", serviceName: "impress-2020-gql-server", + enabledInstrumentations: [], }); import escapeHtml from "escape-html"; diff --git a/api/sendFeedback.js b/api/sendFeedback.js index 3349c8b..239e2e3 100644 --- a/api/sendFeedback.js +++ b/api/sendFeedback.js @@ -5,6 +5,7 @@ const beeline = require("honeycomb-beeline")({ ? "Dress to Impress (2020)" : "Dress to Impress (2020, dev)", serviceName: "impress-2020-gql-server", + enabledInstrumentations: [], }); import sendgridMail from "@sendgrid/mail"; diff --git a/api/uploadLayerImage.js b/api/uploadLayerImage.js index 6eb472a..997d93e 100644 --- a/api/uploadLayerImage.js +++ b/api/uploadLayerImage.js @@ -5,6 +5,7 @@ const beeline = require("honeycomb-beeline")({ ? "Dress to Impress (2020)" : "Dress to Impress (2020, dev)", serviceName: "impress-2020-gql-server", + enabledInstrumentations: [], }); const AWS = require("aws-sdk"); const Jimp = require("jimp"); diff --git a/api/validPetPoses.js b/api/validPetPoses.js index c788054..89fe654 100644 --- a/api/validPetPoses.js +++ b/api/validPetPoses.js @@ -5,6 +5,7 @@ const beeline = require("honeycomb-beeline")({ ? "Dress to Impress (2020)" : "Dress to Impress (2020, dev)", serviceName: "impress-2020-gql-server", + enabledInstrumentations: [], }); import connectToDb from "../src/server/db"; import { getPoseFromPetState, normalizeRow } from "../src/server/util"; diff --git a/scripts/build-cached-data.js b/scripts/build-cached-data.js index 3955faa..f72f4f9 100644 --- a/scripts/build-cached-data.js +++ b/scripts/build-cached-data.js @@ -7,6 +7,7 @@ require("honeycomb-beeline")({ ? "Dress to Impress (2020)" : "Dress to Impress (2020, dev)", serviceName: "impress-2020-build-process", + enabledInstrumentations: [], }); const fs = require("fs").promises; const path = require("path"); @@ -15,7 +16,6 @@ const { ApolloServer } = require("apollo-server"); const { createTestClient } = require("apollo-server-testing"); const gql = require("graphql-tag"); -const connectToDb = require("../src/server/db"); const { config } = require("../src/server"); const cachedDataPath = path.join(__dirname, "..", "src", "app", "cached-data"); @@ -51,7 +51,7 @@ async function main() { "utf8" ); - console.log(`📚 Wrote zones to ${path.relative(process.cwd(), filePath)}`); + console.info(`📚 Wrote zones to ${path.relative(process.cwd(), filePath)}`); } main()