From 33107576ab345a2c3d3de5fefe0a7fc796b31c99 Mon Sep 17 00:00:00 2001 From: Yongseok Date: Mon, 23 Dec 2024 19:56:33 +0900 Subject: [PATCH] [#251] Fix SQL-ID not found sqlId:1 bug --- lib/agent.js | 5 ++--- test/client/data-sender.test.js | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/agent.js b/lib/agent.js index cde9efa8..c5080008 100644 --- a/lib/agent.js +++ b/lib/agent.js @@ -44,9 +44,6 @@ class Agent { this.traceContext = new TraceContext(this.agentInfo, this.dataSender, this.config) - stringMetaService.init(this.dataSender) - apiMetaService.init(this.dataSender) - this.startSchedule(agentId, agentStartTime) this.initializeSupportModules() @@ -57,6 +54,8 @@ class Agent { initializeDataSender(dataSender) { dataSender.send(this.agentInfo) + stringMetaService.init(dataSender) + apiMetaService.init(dataSender) } initializeSupportModules() { diff --git a/test/client/data-sender.test.js b/test/client/data-sender.test.js index 192dc54f..d0840bb1 100644 --- a/test/client/data-sender.test.js +++ b/test/client/data-sender.test.js @@ -6,7 +6,7 @@ const test = require('tape') -require('../support/agent-singleton-mock') +const agent = require('../support/agent-singleton-mock') const { fixture } = require('../test-helper') const dataSenderMock = require('../support/data-sender-mock') const dataSender = dataSenderMock() @@ -18,6 +18,7 @@ const defaultPredefinedMethodDescriptorRegistry = require('../../lib/constant/de test('Should send agent info', function (t) { t.plan(1) + agent.bindHttp() dataSender.send(agentInfo) @@ -26,6 +27,7 @@ test('Should send agent info', function (t) { test('Should send api meta info', function (t) { t.plan(1) + agent.bindHttp() const methodDescriptor = defaultPredefinedMethodDescriptorRegistry.nodeServerMethodDescriptor const apiMetaInfo = ApiMetaInfo.create(methodDescriptor) @@ -36,6 +38,7 @@ test('Should send api meta info', function (t) { test('Should send string meta info', function (t) { t.plan(1) + agent.bindHttp() const stringMetaInfo = StringMetaInfo.create('1', 'test string') dataSender.send(stringMetaInfo)