Skip to content

Commit

Permalink
[pinpoint-apm#251] Fix SQL-ID not found sqlId:1 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
feelform committed Dec 23, 2024
1 parent 6d502f9 commit 3310757
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -57,6 +54,8 @@ class Agent {

initializeDataSender(dataSender) {
dataSender.send(this.agentInfo)
stringMetaService.init(dataSender)
apiMetaService.init(dataSender)
}

initializeSupportModules() {
Expand Down
5 changes: 4 additions & 1 deletion test/client/data-sender.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)

Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 3310757

Please sign in to comment.