Skip to content

Commit dee8718

Browse files
lethalSopaperpab-goog
authored andcommitted
tracings added, jaeger does not recognize the service
1 parent 7e12237 commit dee8718

File tree

9 files changed

+11946
-4367
lines changed

9 files changed

+11946
-4367
lines changed

babel.config.cjs

Lines changed: 0 additions & 3 deletions
This file was deleted.

docker_command.text

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
docker run -d --name jaeger \
2+
-e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
3+
-p 5775:5775/udp \
4+
-p 6831:6831/udp \
5+
-p 6832:6832/udp \
6+
-p 5778:5778 \
7+
-p 16686:16686 \
8+
-p 14268:14268 \
9+
-p 14250:14250 \
10+
-p 9411:9411 \
11+
jaegertracing/all-in-one:1.24.0
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* document-load.ts|js file - the code snippet is the same for both the languages */
2+
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
3+
import { DocumentLoadInstrumentation } from '@opentelemetry/instrumentation-document-load';
4+
import { ZoneContextManager } from '@opentelemetry/context-zone';
5+
import { registerInstrumentations } from '@opentelemetry/instrumentation';
6+
7+
const provider = new WebTracerProvider();
8+
9+
provider.register({
10+
// Changing default contextManager to use ZoneContextManager - supports asynchronous operations - optional
11+
contextManager: new ZoneContextManager(),
12+
});
13+
14+
// Registering instrumentations
15+
registerInstrumentations({
16+
instrumentations: [new DocumentLoadInstrumentation()],
17+
});

open_telemetry_test/index.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Document Load Instrumentation Example</title>
6+
<base href="/" />
7+
<!--
8+
https://www.w3.org/TR/trace-context/
9+
Set the `traceparent` in the server's HTML template code. It should be
10+
dynamically generated server side to have the server's request trace ID,
11+
a parent span ID that was set on the server's request span, and the trace
12+
flags to indicate the server's sampling decision
13+
(01 = sampled, 00 = not sampled).
14+
'{version}-{traceId}-{spanId}-{sampleDecision}'
15+
-->
16+
<meta
17+
name="traceparent"
18+
content="00-ab42124a3c573678d4d8b21ba52df3bf-d21f7bc17caa5aba-01"
19+
/>
20+
<meta name="viewport" content="width=device-width, initial-scale=1" />
21+
</head>
22+
<body>
23+
Example of using Web Tracer with document load instrumentation with console
24+
exporter and collector exporter
25+
<script type="module" src="document-load.ts"></script>
26+
</body>
27+
</html>

0 commit comments

Comments
 (0)