Skip to content

Commit

Permalink
set db span types to sql
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiehodge committed Jul 2, 2018
1 parent 3320fa5 commit d595d69
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/plugins/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function createWrapQuery (tracer, config) {
span.setTag('resource.name', sequence.sql)
span.setTag('out.host', this.config.host)
span.setTag('out.port', String(this.config.port))
span.setTag('span.type', 'db')
span.setTag('span.type', 'sql')
span.setTag('db.user', this.config.user)

if (this.config.database) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/mysql2.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function createWrapQuery (tracer, config) {
span.setTag('resource.name', sequence.sql)
span.setTag('out.host', this.config.host)
span.setTag('out.port', String(this.config.port))
span.setTag('span.type', 'db')
span.setTag('span.type', 'sql')
span.setTag('db.user', this.config.user)

if (this.config.database) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/pg.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function patch (pg, tracer, config) {
}, span => {
span.setTag('service.name', config.service || 'postgres')
span.setTag('resource.name', statement)
span.setTag('span.type', 'db')
span.setTag('span.type', 'sql')

if (params) {
span.setTag('db.name', params.database)
Expand Down
4 changes: 2 additions & 2 deletions test/plugins/mysql.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('Plugin', () => {
agent.use(traces => {
expect(traces[0][0]).to.have.property('service', 'mysql')
expect(traces[0][0]).to.have.property('resource', 'SELECT 1 + 1 AS solution')
expect(traces[0][0]).to.have.property('type', 'db')
expect(traces[0][0]).to.have.property('type', 'sql')
expect(traces[0][0].meta).to.have.property('db.name', 'db')
expect(traces[0][0].meta).to.have.property('db.user', 'user')
expect(traces[0][0].meta).to.have.property('db.type', 'mysql')
Expand Down Expand Up @@ -191,7 +191,7 @@ describe('Plugin', () => {
agent.use(traces => {
expect(traces[0][0]).to.have.property('service', 'mysql')
expect(traces[0][0]).to.have.property('resource', 'SELECT 1 + 1 AS solution')
expect(traces[0][0]).to.have.property('type', 'db')
expect(traces[0][0]).to.have.property('type', 'sql')
expect(traces[0][0].meta).to.have.property('db.user', 'user')
expect(traces[0][0].meta).to.have.property('db.type', 'mysql')
expect(traces[0][0].meta).to.have.property('span.kind', 'client')
Expand Down
4 changes: 2 additions & 2 deletions test/plugins/mysql2.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('Plugin', () => {
.use(traces => {
expect(traces[0][0]).to.have.property('service', 'mysql')
expect(traces[0][0]).to.have.property('resource', 'SELECT 1 + 1 AS solution')
expect(traces[0][0]).to.have.property('type', 'db')
expect(traces[0][0]).to.have.property('type', 'sql')
expect(traces[0][0].meta).to.have.property('db.name', 'db')
expect(traces[0][0].meta).to.have.property('db.user', 'user')
expect(traces[0][0].meta).to.have.property('db.type', 'mysql')
Expand Down Expand Up @@ -197,7 +197,7 @@ describe('Plugin', () => {
.use(traces => {
expect(traces[0][0]).to.have.property('service', 'mysql')
expect(traces[0][0]).to.have.property('resource', 'SELECT 1 + 1 AS solution')
expect(traces[0][0]).to.have.property('type', 'db')
expect(traces[0][0]).to.have.property('type', 'sql')
expect(traces[0][0].meta).to.have.property('db.user', 'user')
expect(traces[0][0].meta).to.have.property('db.type', 'mysql')
expect(traces[0][0].meta).to.have.property('span.kind', 'client')
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/pg.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Plugin', () => {
agent.use(traces => {
expect(traces[0][0]).to.have.property('service', 'postgres')
expect(traces[0][0]).to.have.property('resource', 'SELECT $1::text as message')
expect(traces[0][0]).to.have.property('type', 'db')
expect(traces[0][0]).to.have.property('type', 'sql')
expect(traces[0][0].meta).to.have.property('db.name', 'postgres')
expect(traces[0][0].meta).to.have.property('db.user', 'postgres')
expect(traces[0][0].meta).to.have.property('db.type', 'postgres')
Expand Down

0 comments on commit d595d69

Please sign in to comment.