-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,3 +128,5 @@ do | |
end | ||
|
||
return app | ||
|
||
-- run tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
local kong_meta = require "kong.meta" | ||
|
||
|
||
|
||
local SampleChangerHandler = { | ||
VERSION = kong_meta.version, | ||
PRIORITY = 9000, | ||
} | ||
function SampleChangerHandler:access(conf) | ||
if math.random() < 0.5 then | ||
ngx.ctx.KONG_SPANS = { nil }; | ||
ngx.ctx.KONG_SPANS[0] = 1; | ||
-- kong.tracing = kong.tracing("off", { noop = true }); | ||
|
||
else | ||
ngx.log(ngx.ERR, "THIS WAS REPORTED") | ||
end | ||
end | ||
|
||
return SampleChangerHandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
local typedefs = require "kong.db.schema.typedefs" | ||
|
||
return { | ||
name = "sample-changer", | ||
fields = { | ||
{ protocols = typedefs.protocols_http }, -- TODO: support stream mode | ||
{ config = { | ||
type = "record", | ||
fields = { | ||
{ foo = { | ||
description = "The foo ss.", | ||
type = "integer" | ||
} }, | ||
} }, | ||
}, }, | ||
} |