Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
da7b4a7
Initial tracing code
sailalithkanumuri8 Jul 21, 2025
f530d61
Fix tracing and Docker integration for advanced coffee machine with J…
sailalithkanumuri8 Jul 21, 2025
6093f1e
fix: ran npm run format
sailalithkanumuri8 Jul 22, 2025
8034db9
Updated README
sailalithkanumuri8 Jul 24, 2025
4053ee7
Modified tracing to include input values
sailalithkanumuri8 Jul 29, 2025
340ac8c
Refactored tracing.ts code
sailalithkanumuri8 Jul 30, 2025
b211687
Updated tracing code
sailalithkanumuri8 Jul 30, 2025
6b9d238
Fixed merge conflict errors
sailalithkanumuri8 Aug 4, 2025
24c09d8
fix: ran npm format
sailalithkanumuri8 Aug 4, 2025
6e57e3d
Added spans for properties and events
sailalithkanumuri8 Aug 5, 2025
72c077f
fix: ran npm run format
sailalithkanumuri8 Aug 5, 2025
4e7b3e6
Merge remote-tracking branch 'upstream/main' into sai-opentelemetry-i…
sailalithkanumuri8 Aug 6, 2025
0db157e
fix: ran npm run format again
sailalithkanumuri8 Aug 6, 2025
97280dc
Enhanced OpenTelemetry tracing
sailalithkanumuri8 Aug 8, 2025
40bd75d
refactor: remove low-level complexity and simplify OpenTelemetry trac…
sailalithkanumuri8 Aug 8, 2025
2e4284e
Added test file
sailalithkanumuri8 Aug 8, 2025
d4ecd0e
fix: ran npm run format
sailalithkanumuri8 Aug 8, 2025
0ec0d83
Fix Jaeger tracing configuration spans still not showing up
sailalithkanumuri8 Aug 11, 2025
a5e7996
Added more spans
sailalithkanumuri8 Aug 11, 2025
d2f4717
Merge remote-tracking branch 'origin/sai-opentelemetry-integration' i…
sailalithkanumuri8 Aug 11, 2025
740e6cd
fix: ran npm run format
sailalithkanumuri8 Aug 11, 2025
d404f88
update lock file
egekorkan Aug 12, 2025
40e84ae
Merge branch 'main' of github.com:eclipse-thingweb/test-things into s…
egekorkan Aug 12, 2025
f879825
Decreased redundancy to help developers code things faster
sailalithkanumuri8 Aug 19, 2025
680f320
fix: fixed jeager endpoint in docker-compose-things
sailalithkanumuri8 Aug 19, 2025
3cb0171
Removed unnecessary method
sailalithkanumuri8 Aug 19, 2025
f12f179
fix: hopefully fixed lint errors
sailalithkanumuri8 Aug 19, 2025
99f5db5
Fixed dependancy mismatch
sailalithkanumuri8 Aug 19, 2025
e69c3e7
Fixed hardcoded jeager endpoint
sailalithkanumuri8 Aug 19, 2025
71d984f
Updated paths to make tracing in util
sailalithkanumuri8 Aug 26, 2025
780c899
Fixed counter thing
sailalithkanumuri8 Aug 26, 2025
7053292
Updated loc file
sailalithkanumuri8 Aug 26, 2025
ff10f89
Reduced redundancy in main.ts
sailalithkanumuri8 Aug 27, 2025
d43998d
Updated README
sailalithkanumuri8 Aug 27, 2025
4d94a97
Ran npm run format
sailalithkanumuri8 Aug 27, 2025
9a7e000
Updated schema fetching in util.ts
sailalithkanumuri8 Aug 29, 2025
a43fb54
Made span name handling easier for developer
sailalithkanumuri8 Sep 1, 2025
13161c8
Updated span names and added more info on readme
sailalithkanumuri8 Sep 1, 2025
68cb5d4
Updated README
sailalithkanumuri8 Sep 1, 2025
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ COAP_SIMPLE_PORT_OUT=5683
COAP_NEGOTIATION_PORT_OUT=5684
SMART_HOME_SMART_CLOCK_PORT_OUT=5685
TRAEFIK_DASHBOARD_PORT_OUT=8080
JAEGER_ENDPOINT=http://host.docker.internal:8085/api/traces

STACK_HOSTNAME="plugfest.thingweb.io"
BROKER_URI="plugfest.thingweb.io"
Expand Down
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,24 @@ If you are going to add a completely new Thing:
2. Add your Thing Model under the previously created directory and name it such as `<your_thing_name>.tm.json`.
3. Follow the steps above to add your protocol and programming language/framework.

**TypeScript Tracing Integration:**
Wrap your WoT Thing with auto-tracing to get detailed OpenTelemetry spans for validation, processing, and database operations:

```typescript
import { createAutoTracedThing, TracedBusinessLogic } from "../../util/dist/auto-tracing";
const tracedThing = createAutoTracedThing(thing);

// Property writes get ".read" suffix
tracedThing.setPropertyReadHandler("allAvailableResources", async (options) => {
return getResources(); // Span: "allAvailableResources.read"
});

// Property writes get ".write" suffix
tracedThing.setPropertyWriteHandler("servedCounter", async (value) => {
updateCounter(value); // Span: "servedCounter.write"
});
```

## Current Devices

The table below contains the public base URIs of the Things used for protocol testing.
Expand Down Expand Up @@ -178,3 +196,24 @@ docker buildx build \
For running the things separately, using their `Dockerfile`'s, `docker build -t <image-tag> -f ./Dockerfile ../../` command must be used to give the context to be able to copy `tm.json` into the container.

For Node.js-based devices, we use npm workspaces and running `npm install` at the root directory installs all the packages needed for every device. After packages are installed, running `node main.js` would run the thing. For port configuration, running either `node main.js -p 1000` or `node main.js --port 1000` would start the thing on port 1000.

## Tracing

Distributed tracing is enabled using OpenTelemetry and Jaeger. To view all traces and logs, open [http://localhost:8084](http://localhost:8084) in your browser (Jaeger UI). Traces are sent to the Jaeger collector on port 8085.

Enhanced auto-tracing automatically injects `TracedBusinessLogic` for detailed span creation without redundancy. Function signatures determine tracing mode.

Also, there is comprehensive test suites that are also traced and visible in Jaeger:

- **Thing Description (TD) validation tests** - Test if the exposed TD is valid according to W3C WoT standards
- **Thing Model (TM) validation tests** - Validate the Thing Model against the schema
- **Integration tests** - Test actual interactions with the Things

When tests run, they appear in Jaeger with clear span names like `td.test` or `tm.test`. Failed tests show up as **error spans** with red highlighting in the Jaeger UI, making it easy to:

- **Debug test failures** by examining the error details and stack traces in span logs
- **Track test performance** and identify slow validation steps
- **Monitor CI/CD pipelines** by observing test execution patterns
- **Correlate test failures** with specific Thing operations or configurations

Test spans include detailed attributes about what was validated, error messages for failures, and timing information for performance analysis.
7 changes: 4 additions & 3 deletions docker-compose-things-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,15 @@ services:
- things_network
http-advanced-coffee-machine:
build:
context: ./things/advanced-coffee-machine
dockerfile: ./http/ts/Dockerfile
context: .
dockerfile: ./things/advanced-coffee-machine/http/ts/Dockerfile
labels:
- traefik.http.routers.http-advanced-coffee-machine.rule=PathPrefix(`/http-advanced-coffee-machine`)
- traefik.http.services.http-advanced-coffee-machine.loadbalancer.server.port=${WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${WEB_PORT_OUT}
- JAEGER_ENDPOINT=${JAEGER_ENDPOINT}
networks:
- things_network
http-data-schema-thing:
Expand All @@ -128,7 +129,7 @@ services:
counter-thing:
build:
context: ./things/counter-thing
dockerfile: Dockerfile
dockerfile: ./http/ts/Dockerfile
labels:
- traefik.http.routers.counter-thing.rule=PathPrefix(`/counter-thing`)
- traefik.http.services.counter-thing.loadbalancer.server.port=${WEB_PORT_OUT}
Expand Down
1 change: 1 addition & 0 deletions docker-compose-things.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ services:
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${WEB_PORT_OUT}
- JAEGER_ENDPOINT=${JAEGER_ENDPOINT}
deploy:
resources:
limits:
Expand Down
Loading
Loading