Skip to content

Commit

Permalink
Fix/validate start web transaction (#6)
Browse files Browse the repository at this point in the history
* Validate start (web and non web) transaction

Signed-off-by: Daniela Bento <[email protected]>
  • Loading branch information
danifbento authored Jul 13, 2023
1 parent d7634a8 commit c5a27df
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions lib/lua-nri/newrelic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,12 @@ end

-- web transactions
local newrelic_start_web_transaction = function(application, name)
return nr.newrelic_start_web_transaction(application, name)
local p = ffi.new('newrelic_txn_t*[1]')
p[0] = nr.newrelic_start_web_transaction(application, name)
if p[0] == nil then
return nil
end
return p[0]
end

local newrelic_end_web_transaction = function(transaction_id, nonWeb)
Expand Down Expand Up @@ -1154,7 +1159,12 @@ end

-- non web transactions
local newrelic_start_non_web_transaction = function(application, name)
return nr.newrelic_start_non_web_transaction(application, name)
local p = ffi.new('newrelic_txn_t*[1]')
p[0] = nr.newrelic_start_non_web_transaction(application, name)
if p[0] == nil then
return nil
end
return p[0]
end

local newrelic_end_non_web_transaction = function(transaction_id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package = "lua-newrelic-integration"
version = "0.01-6"
version = "0.01-7"
source = {
url = "git://github.com/danifbento/lua-newrelic-integration",
tag = "v0.01-6"
tag = "v0.01-7"
}
description = {
summary = "Lua newrelic client library for OpenResty / ngx_lua.",
Expand Down

0 comments on commit c5a27df

Please sign in to comment.