Skip to content

Commit 6101a5f

Browse files
authored
docs: fix outdated OpenTelemetry api example (#3051)
1 parent 985e12e commit 6101a5f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/tutorials/basic_opentelemetry.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Let's start by creating a basic HTTP server that simulates a small web
2222
application:
2323

2424
```ts title="server.ts"
25-
import { metrics, trace } from "npm:@opentelemetry/api@1";
25+
import { metrics, SpanStatusCode, trace } from "npm:@opentelemetry/api@1";
2626

2727
// Create a tracer and meter for our application
2828
const tracer = trace.getTracer("my-server", "1.0.0");
@@ -94,7 +94,7 @@ Deno.serve({ port: 8000 }, (req) => {
9494
if (error instanceof Error) {
9595
span.recordException(error);
9696
span.setStatus({
97-
code: trace.SpanStatusCode.ERROR,
97+
code: SpanStatusCode.ERROR,
9898
message: error.message,
9999
});
100100
}

0 commit comments

Comments
 (0)