Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,28 @@ jobs:
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021", "adobe@2023" ]
coldboxVersion: [ "^6.0.0", "^7.0.0" ]
experimental: [ false ]
commandBoxVersion: [ "6.1.0" ]
# Here we tests all engines against ColdBox@BE
include:
- coldboxVersion: "be"
cfengine: "lucee@5"
commandBoxVersion: "6.1.0"
experimental: true
- coldboxVersion: "be"
cfengine: "lucee@6"
commandBoxVersion: "6.1.0"
experimental: true
- coldboxVersion: "be"
cfengine: "adobe@2021"
commandBoxVersion: "6.1.0"
experimental: true
- coldboxVersion: "be"
cfengine: "adobe@2023"
commandBoxVersion: "6.1.0"
experimental: true
- coldboxVersion: "be"
commandBoxVersion: "6.2.0-alpha"
cfengine: "boxlang@1"
experimental: true
steps:
- name: Checkout Repository
Expand All @@ -53,6 +62,8 @@ jobs:

- name: Setup CommandBox CLI
uses: Ortus-Solutions/setup-commandbox@v2.0.1
with:
version: ${{ matrix.commandBoxVersion }}

# Not Needed in this module
#- name: Setup Environment For Testing Process
Expand Down
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"Coldbox Open Telementry Module",
"version":"1.0.1",
"version":"1.0.3",
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbotel/@build.version@/cbotel-@build.version@.zip",
"author":"Ortus Solutions <info@ortussolutions.com>",
"homepage":"https://github.com/coldbox-modules/cbotel",
Expand Down
35 changes: 18 additions & 17 deletions interceptors/Tracing.cfc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
component {

property name="OpenTelemetryUtil" inject="OpenTelemetryUtil@cbotel";
property name="moduleSettings" inject="coldbox:moduleSettings:cbotel";
property name="moduleSettings" inject="box:moduleSettings:cbotel";

/**
* Processes the inbound open telemetry information and sets it in the private request context
*
* @event
* @rc
* @prc
* @rc
* @prc
*/
function preProcess( event, rc, prc ){
var traceParent = event.getHttpHeader( "traceparent", "" );
Expand Down Expand Up @@ -42,20 +42,21 @@ component {
traceId = traceId
);

// we need to make sure we javacast these or sometimes the values get picked up as scientific notation and result in infinity
prc[ "openTelemetry" ] = {
"traceParent" : traceParent,
"parentId" : listGetAt( traceParent, 3, "-" ),
"traceId" : listGetAt( traceParent, 2, "-" ),
"parentId" : javacast( "string", listGetAt( traceParent, 3, "-" ) ),
"traceId" : javacast( "string", listGetAt( traceParent, 2, "-" ) ),
"traceState" : traceStateObj,
"transactionId" : transactionId
"transactionId" : javacast( "string", transactionId )
};
} else if ( len( traceParent ) ) {
prc[ "openTelemetry" ] = {
"traceParent" : traceParent,
"parentId" : listGetAt( traceParent, 3, "-" ),
"traceId" : listGetAt( traceParent, 2, "-" ),
"parentId" : javacast( "string", listGetAt( traceParent, 3, "-" ) ),
"traceId" : javacast( "string", listGetAt( traceParent, 2, "-" ) ),
"traceState" : traceStateObj,
"transactionId" : transactionId
"transactionId" : javacast( "string", transactionId )
};
}

Expand All @@ -69,8 +70,8 @@ component {
* Adds the traceparent and tracestate headers to the response
*
* @event
* @rc
* @prc
* @rc
* @prc
*/
function postProcess( event, rc, prc ){
if ( structKeyExists( prc, "openTelemetry" ) && structKeyExists( prc.openTelemetry, "traceParent" ) ) {
Expand Down Expand Up @@ -118,17 +119,17 @@ component {
/**
* Appends the trace information to logstash entries
*
* @event
* @rc
* @prc
* @event
* @rc
* @prc
* @interceptData
*/
function onLogstashEntryCreate( event, rc, prc, interceptData ){
if ( moduleSettings.logstashTraceEnabled && prc.keyExists( "openTelemetry" ) ) {
var entry = interceptData.entry;
entry[ "span.id" ] = prc.openTelemetry.parentId;
entry[ "trace.id" ] = prc.openTelemetry.traceId;
entry[ "transaction.id" ] = prc.openTelemetry.transactionId;
entry[ "span.id" ] = javacast( "string", prc.openTelemetry.parentId );
entry[ "trace.id" ] = javacast( "string", prc.openTelemetry.traceId );
entry[ "transaction.id" ] = javacast( "string", prc.openTelemetry.transactionId );
}
}

Expand Down
36 changes: 36 additions & 0 deletions server-boxlang@1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"app":{
"cfengine":"boxlang@1.0.0-snapshot",
"serverHomeDirectory":".engine/boxlang"
},
"name":"cbotel-boxlang@1",
"force":true,
"openBrowser":false,
"web":{
"directoryBrowsing":true,
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"test-harness",
"aliases":{
"/moduleroot/cbotel":"./"
}
},
"JVM":{
"heapSize":"1024",
"javaVersion":"openjdk21_jdk",
"args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999"
},
"cfconfig":{
"file":".cfconfig.json"
},
"env":{
"BOXLANG_DEBUG":true
},
"scripts":{
"onServerInitialInstall":"install bx-compat-cfml@be,bx-esapi --noSave"
}
}
2 changes: 1 addition & 1 deletion test-harness/box.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"hyper":"^8.0.0"
},
"devDependencies":{
"testbox":"*"
"testbox":"be"
},
"installPaths":{
"coldbox":"coldbox/",
Expand Down
Loading