Updated readme to match latest changes.

Not writes process/resource and additional attribute information
This commit is contained in:
2026-01-10 13:53:53 -06:00
parent ce23405757
commit 7371260442
2 changed files with 171 additions and 153 deletions

View File

@@ -1,57 +1,67 @@
# Open Telemetery Example
# Open Telemetry Example
Writes Telemetry Tracing information to the endpoint provided using the [OLTP JSON over HTTP specification](https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md#json-protobuf-encoding)
## Example Usage
Use the _code block_ widget to start and end spans. Spans can be nested to form a stack, ending a span will always end the last span added to the stack.
Use the _code block_ widget to start and end spans.
### Visualization
Spans can be nested to form a stack, with the parent span being the most recent
active span added to the stack. You can have multiple spans using the same name,
and ending a span by name will always end the most recent span.
Spans will only be written to the opentelemetry endpoint once the _endSpan_
method is called.
## Visualization
For example, using Jaeger UI:
![Tracing Screenshot](screenshots/IVA%20Tracing.png)
## Code Snippets
### Start Span
```javascript
(async () => {
opentelemetry.startSpan("Global Flow")
opentelemetry.startSpan("Global Flow");
})()
.catch((error) => {
console.error(error.message)
recognizedObject.answers.push('')
console.error(error.message);
recognizedObject.answers.push("");
recognizedObject.errorInfo = {
...recognizedObject.errorInfo,
label: {
data: error.toJSON ? error.toJSON() : {},
message: error.message,
},
}
};
})
.finally(() => {
next()
})
next();
});
```
### End Span
```javascript
(async () => {
opentelemetry.endSpan("Global Flow")
opentelemetry.endSpan("Global Flow");
})()
.catch((error) => {
console.error(error.message)
recognizedObject.answers.push('')
console.error(error.message);
recognizedObject.answers.push("");
recognizedObject.errorInfo = {
...recognizedObject.errorInfo,
label: {
data: error.toJSON ? error.toJSON() : {},
message: error.message,
},
}
};
})
.finally(() => {
next()
})
next();
});
```
```