diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bbb8ed5..259c2b3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 diff --git a/box.json b/box.json index eee72d4..28f5244 100644 --- a/box.json +++ b/box.json @@ -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 ", "homepage":"https://github.com/coldbox-modules/cbotel", diff --git a/interceptors/Tracing.cfc b/interceptors/Tracing.cfc index 9a5ea73..ab7543b 100644 --- a/interceptors/Tracing.cfc +++ b/interceptors/Tracing.cfc @@ -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", "" ); @@ -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 ) }; } @@ -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" ) ) { @@ -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 ); } } diff --git a/server-boxlang@1.json b/server-boxlang@1.json new file mode 100644 index 0000000..52fda93 --- /dev/null +++ b/server-boxlang@1.json @@ -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" + } +} \ No newline at end of file diff --git a/test-harness/box.json b/test-harness/box.json index 64d8862..91b1c4a 100644 --- a/test-harness/box.json +++ b/test-harness/box.json @@ -10,7 +10,7 @@ "hyper":"^8.0.0" }, "devDependencies":{ - "testbox":"*" + "testbox":"be" }, "installPaths":{ "coldbox":"coldbox/",