Updated readme to match latest changes.
Not writes process/resource and additional attribute information
This commit is contained in:
@@ -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:
|
||||
|
||||

|
||||
|
||||
## 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();
|
||||
});
|
||||
```
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user