Skip to content

Commit

Permalink
pinpoint-apm#87 HTTP param annotation key
Browse files Browse the repository at this point in the history
  • Loading branch information
feelform committed May 25, 2021
1 parent a056b14 commit 5eaa08d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion lib/constant/annotation-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@

'use strict'

// https://github.com/pinpoint-apm/pinpoint/blob/b6a3f3e8aed8111264bedc77b110e0ffd5aa4852/commons/src/main/java/com/navercorp/pinpoint/common/trace/AnnotationKey.java#L144
const AnnotationKey = require('../context/annotation-key')

const DefaultAnnotationKey = {
API: new AnnotationKey(12, "API"),
API_METADATA: new AnnotationKey(13, "API-METADATA"),
HTTP_URL: new AnnotationKey(40, "http.url"),
HTTP_PARAM: new AnnotationKey(41, "http.param"),
HTTP_STATUS_CODE: new AnnotationKey(46, "http.status.code")
}

const EventAnnotationKey= {
const EventAnnotationKey = {
MONGO_JSON_DATA: new AnnotationKey(150, "MONGO-JSON-Data")
}

Expand Down
10 changes: 5 additions & 5 deletions test/instrumentation/module/express.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test(`${testName1} Should record request in basic route`, function (t) {

t.plan(3)

const PATH = '/'+testName
const PATH = '/' + testName
const app = new express()

app.get(PATH, async (req, res) => {
Expand Down Expand Up @@ -62,7 +62,7 @@ test(`[${testName2}] Should record request in express.Router`, function (t) {

t.plan(3)

const PATH = '/'+testName
const PATH = '/' + testName
const app = new express()

const router1 = express.Router()
Expand Down Expand Up @@ -103,7 +103,7 @@ test(`${testName3} Should record request taking more than 2 sec`, function (t) {

t.plan(2)

const PATH = '/'+testName
const PATH = '/' + testName
const app = new express()

app.get(PATH, async (req, res) => {
Expand Down Expand Up @@ -159,7 +159,7 @@ test(`${testName4} Should record internal error in express.test.js`, function (t
console.log('[app] error handler')
res.json({ message: error.message })
res.status = 500
});
})

const server = app.listen(TEST_ENV.port, async function () {
const result = await axios.get(getServerUrl(PATH))
Expand Down Expand Up @@ -216,7 +216,7 @@ test(`${testName5} Should record middleware`, function (t) {
const testName6 = 'express6'
test(`${testName6} Should record each http method`, function (t) {
agent.bindHttp()

const testName = testName6

t.plan(6)
Expand Down

0 comments on commit 5eaa08d

Please sign in to comment.