-
Notifications
You must be signed in to change notification settings - Fork 17
/
busted-runner
executable file
·31 lines (27 loc) · 1.11 KB
/
busted-runner
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env resty
package.path = './lib/?.lua;./lib/?/?.lua;./lib/?/init.lua' .. package.path
-- Set up global tracer
Global = require("opentelemetry.global")
local tracer_provider = require("opentelemetry.trace.tracer_provider")
local attr = require("opentelemetry.attribute")
local resource = require("opentelemetry.resource")
local always_on_sampler = require("opentelemetry.trace.sampling.always_on_sampler")
local batch_span_processor = require("opentelemetry.trace.batch_span_processor")
local exporter = require("opentelemetry.trace.exporter.console")
local processor = batch_span_processor.new(exporter, {
drop_on_queue_full = false, max_queue_size = 1024, batch_timeout = 3, inactive_timeout = 1, max_export_batch_size = 10
})
local tracer_provider = tracer_provider.new(processor, {
sampler = always_on_sampler,
resource = resource.new(attr.string("service.name", "openresty"), attr.int("attr_int", 100)),
})
Global.set_tracer_provider(tracer_provider)
if ngx ~= nil then
ngx.exit = function() end
end
-- Busted command-line runner
require 'busted.runner' (
{
standalone = false,
}
)