From 2bd4982ee6bd8d2344ea36885198a65cc3c9b8f4 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Mon, 11 Nov 2024 17:16:05 +0000 Subject: [PATCH 1/8] Version bump --- box.json | 2 +- changelog.md | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/box.json b/box.json index 9ec7e4e..28f5244 100644 --- a/box.json +++ b/box.json @@ -1,6 +1,6 @@ { "name":"Coldbox Open Telementry Module", - "version":"1.0.2", + "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/changelog.md b/changelog.md index 524e280..6215eb9 100644 --- a/changelog.md +++ b/changelog.md @@ -9,10 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.1] - 2024-11-11 + +### Fixed + +- Fix transaction identifier lenth and compatibility issue with 16 character algorithm with ACF + ## [1.0.0] - 2024-11-10 - First iteration of this module -[Unreleased]: https://github.com/coldbox-modules/cbotel/compare/v1.0.0...HEAD +[Unreleased]: https://github.com/coldbox-modules/cbotel/compare/v1.0.1...HEAD + +[1.0.1]: https://github.com/coldbox-modules/cbotel/compare/v1.0.0...v1.0.1 [1.0.0]: https://github.com/coldbox-modules/cbotel/compare/82f2a929ff5e72c52ee0341933d1459191a04017...v1.0.0 From 295f4b74d86144a1673be7c7df3697bdf36e1619 Mon Sep 17 00:00:00 2001 From: Oscar Tisnado <68830577+otisnado@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:47:00 -0600 Subject: [PATCH 2/8] add boxlang to matrix --- .github/workflows/tests.yml | 3 +++ server-boxlang@1.json | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 server-boxlang@1.json diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bbb8ed5..d4dd374 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,6 +35,9 @@ jobs: - coldboxVersion: "be" cfengine: "adobe@2023" experimental: true + - coldboxVersion: "be" + cfengine: "boxlang@1" + experimental: true steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/server-boxlang@1.json b/server-boxlang@1.json new file mode 100644 index 0000000..391af92 --- /dev/null +++ b/server-boxlang@1.json @@ -0,0 +1,36 @@ +{ + "app":{ + "cfengine":"boxlang@be", + "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-mail,bx-mysql,bx-derby,bx-compat-cfml@be,bx-unsafe-evaluate,bx-esapi --noSave" + } +} \ No newline at end of file From 1826ad592070e4cb2c250cfa74e31a57f693782b Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Wed, 5 Feb 2025 13:38:11 -0500 Subject: [PATCH 3/8] make safe in CommandBox context --- .github/workflows/tests.yml | 6 ++++++ interceptors/Tracing.cfc | 16 ++++++++-------- server-boxlang@1.json | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d4dd374..4e514c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,21 +21,27 @@ 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: diff --git a/interceptors/Tracing.cfc b/interceptors/Tracing.cfc index 9a5ea73..37e5c1b 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", "" ); @@ -69,8 +69,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,9 +118,9 @@ component { /** * Appends the trace information to logstash entries * - * @event - * @rc - * @prc + * @event + * @rc + * @prc * @interceptData */ function onLogstashEntryCreate( event, rc, prc, interceptData ){ diff --git a/server-boxlang@1.json b/server-boxlang@1.json index 391af92..de6a29d 100644 --- a/server-boxlang@1.json +++ b/server-boxlang@1.json @@ -31,6 +31,6 @@ "BOXLANG_DEBUG":true }, "scripts":{ - "onServerInitialInstall":"install bx-mail,bx-mysql,bx-derby,bx-compat-cfml@be,bx-unsafe-evaluate,bx-esapi --noSave" + "onServerInitialInstall":"install bx-compat-cfml@be,bx-esapi --noSave" } } \ No newline at end of file From d0626b850bc0c2849ea8a9b1d9fd89e213dbabe6 Mon Sep 17 00:00:00 2001 From: jclausen <5255645+jclausen@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:38:46 +0000 Subject: [PATCH 4/8] Apply cfformat changes --- interceptors/Tracing.cfc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/interceptors/Tracing.cfc b/interceptors/Tracing.cfc index 37e5c1b..b260a8f 100644 --- a/interceptors/Tracing.cfc +++ b/interceptors/Tracing.cfc @@ -7,8 +7,8 @@ component { * 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", "" ); @@ -69,8 +69,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,9 +118,9 @@ component { /** * Appends the trace information to logstash entries * - * @event - * @rc - * @prc + * @event + * @rc + * @prc * @interceptData */ function onLogstashEntryCreate( event, rc, prc, interceptData ){ From 38c7d092c3e3ed189aa473f22b02d09dc9b22405 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Wed, 5 Feb 2025 15:50:17 -0500 Subject: [PATCH 5/8] ensure version on task --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4e514c6..259c2b3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -62,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 From fbb87fae7151be68c16470022754a8884952bc5e Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Wed, 5 Feb 2025 16:32:55 -0500 Subject: [PATCH 6/8] use testbox@be --- test-harness/box.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/", From 63293b6574bd7abc38b94d303a01ba5e69334004 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Wed, 5 Feb 2025 16:41:03 -0500 Subject: [PATCH 7/8] pin snapshot until we can get the `be` problem fixed --- server-boxlang@1.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-boxlang@1.json b/server-boxlang@1.json index de6a29d..52fda93 100644 --- a/server-boxlang@1.json +++ b/server-boxlang@1.json @@ -1,6 +1,6 @@ { "app":{ - "cfengine":"boxlang@be", + "cfengine":"boxlang@1.0.0-snapshot", "serverHomeDirectory":".engine/boxlang" }, "name":"cbotel-boxlang@1", From 3e7192657f24861be9d9533d9393e7565c1babc4 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Tue, 24 Mar 2026 19:45:25 -0400 Subject: [PATCH 8/8] update to ensure casting as strings so values are not picked up as scientific notation --- interceptors/Tracing.cfc | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/interceptors/Tracing.cfc b/interceptors/Tracing.cfc index b260a8f..ab7543b 100644 --- a/interceptors/Tracing.cfc +++ b/interceptors/Tracing.cfc @@ -7,8 +7,8 @@ component { * 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 ); } }