Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Verified MySQL host:port metric is recorded #2400

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/versioned/mysql/basic.tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ tap.test('Basic run through mysql functionality', { timeout: 30 * 1000 }, functi
for (const query of agent.queries.samples.values()) {
t.ok(query.total > 0, 'the samples should have positive duration')
}

const metrics = agent.metrics._metrics.unscoped
const hostPortMetric = Object.entries(metrics).find((entry) =>
/Datastore\/instance\/MySQL\/[0-9a-zA-Z.-]+\/3306/.test(entry[0])
)
t.ok(hostPortMetric, 'has host:port metric')
t.equal(hostPortMetric[1].callCount, 1, 'host:port metric has been incremented')

t.end()
})
})
Expand Down
8 changes: 8 additions & 0 deletions test/versioned/mysql2/basic.tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ tap.test('Basic run through mysql functionality', { timeout: 30 * 1000 }, functi
for (const sample of agent.queries.samples.values()) {
t.ok(sample.total > 0, 'the samples should have positive duration')
}

const metrics = agent.metrics._metrics.unscoped
const hostPortMetric = Object.entries(metrics).find((entry) =>
/Datastore\/instance\/MySQL\/[0-9a-zA-Z.-]+\/3306/.test(entry[0])
)
t.ok(hostPortMetric, 'has host:port metric')
t.equal(hostPortMetric[1].callCount, 1, 'host:port metric has been incremented')

t.end()
})
})
Expand Down
Loading