Skip to content

Commit

Permalink
Merge branch 'main' into web-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkuba committed Jun 22, 2024
2 parents 4c6b199 + 86019e0 commit 4a10055
Show file tree
Hide file tree
Showing 124 changed files with 2,829 additions and 2,164 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ body:
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { ConsoleSpanExporter } = require('@opentelemetry/sdk-trace-base');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
// configure the SDK to export telemetry data to the console
// enable all auto-instrumentations from the meta package
const traceExporter = new ConsoleSpanExporter();
const sdk = new opentelemetry.NodeSDK({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'my-service',
[SEMRESATTRS_SERVICE_NAME]: 'my-service',
}),
traceExporter,
instrumentations: [getNodeAutoInstrumentations()]
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/

### :house: (Internal)

## 1.25.1

### :books: (Refine Doc)

* refactor(examples): added usage of @opentelemetry/semantic-conventions and @opentelemetry/resources to the examples in examples/opentelemetry-web for maintaining consistency across all examples. [#4764](https:/open-telemetry/opentelemetry-js/pull/4764) @Zen-cronic

### :house: (Internal)

* refactor(context-zone-peer-dep): use explicit exports [#4785](https:/open-telemetry/opentelemetry-js/pull/4787) @pichlermarc
* refactor(context-async-hooks): use explicit exports [#4785](https:/open-telemetry/opentelemetry-js/pull/4786) @pichlermarc

## 1.25.0

### :rocket: (Enhancement)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { ConsoleSpanExporter } = require('@opentelemetry/sdk-trace-base');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');

// configure the SDK to export telemetry data to the console
// enable all auto-instrumentations from the meta package
const traceExporter = new ConsoleSpanExporter();
const sdk = new opentelemetry.NodeSDK({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'my-service',
[SEMRESATTRS_SERVICE_NAME]: 'my-service',
}),
traceExporter,
instrumentations: [getNodeAutoInstrumentations()]
Expand Down
16 changes: 8 additions & 8 deletions examples/esm-http-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "esm-http-ts",
"private": true,
"version": "0.52.0",
"version": "0.52.1",
"description": "Example of HTTP integration with OpenTelemetry using ESM and TypeScript",
"main": "build/index.js",
"type": "module",
Expand Down Expand Up @@ -32,12 +32,12 @@
"homepage": "https:/open-telemetry/opentelemetry-js/tree/main/examples/",
"dependencies": {
"@opentelemetry/api": "1.9.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.52.0",
"@opentelemetry/instrumentation": "0.52.0",
"@opentelemetry/instrumentation-http": "0.52.0",
"@opentelemetry/resources": "1.25.0",
"@opentelemetry/sdk-trace-base": "1.25.0",
"@opentelemetry/sdk-trace-node": "1.25.0",
"@opentelemetry/semantic-conventions": "1.25.0"
"@opentelemetry/exporter-trace-otlp-proto": "0.52.1",
"@opentelemetry/instrumentation": "0.52.1",
"@opentelemetry/instrumentation-http": "0.52.1",
"@opentelemetry/resources": "1.25.1",
"@opentelemetry/sdk-trace-base": "1.25.1",
"@opentelemetry/sdk-trace-node": "1.25.1",
"@opentelemetry/semantic-conventions": "1.25.1"
}
}
18 changes: 9 additions & 9 deletions examples/http/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "http-example",
"private": true,
"version": "0.52.0",
"version": "0.52.1",
"description": "Example of HTTP integration with OpenTelemetry",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -30,14 +30,14 @@
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/exporter-jaeger": "1.25.0",
"@opentelemetry/exporter-zipkin": "1.25.0",
"@opentelemetry/instrumentation": "0.52.0",
"@opentelemetry/instrumentation-http": "0.52.0",
"@opentelemetry/resources": "1.25.0",
"@opentelemetry/sdk-trace-base": "1.25.0",
"@opentelemetry/sdk-trace-node": "1.25.0",
"@opentelemetry/semantic-conventions": "1.25.0"
"@opentelemetry/exporter-jaeger": "1.25.1",
"@opentelemetry/exporter-zipkin": "1.25.1",
"@opentelemetry/instrumentation": "0.52.1",
"@opentelemetry/instrumentation-http": "0.52.1",
"@opentelemetry/resources": "1.25.1",
"@opentelemetry/sdk-trace-base": "1.25.1",
"@opentelemetry/sdk-trace-node": "1.25.1",
"@opentelemetry/semantic-conventions": "1.25.1"
},
"homepage": "https:/open-telemetry/opentelemetry-js/tree/main/examples/http",
"devDependencies": {
Expand Down
18 changes: 9 additions & 9 deletions examples/https/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "https-example",
"private": true,
"version": "0.52.0",
"version": "0.52.1",
"description": "Example of HTTPs integration with OpenTelemetry",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
Expand Down Expand Up @@ -34,14 +34,14 @@
},
"dependencies": {
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/exporter-jaeger": "1.25.0",
"@opentelemetry/exporter-zipkin": "1.25.0",
"@opentelemetry/instrumentation": "0.52.0",
"@opentelemetry/instrumentation-http": "0.52.0",
"@opentelemetry/resources": "1.25.0",
"@opentelemetry/sdk-trace-base": "1.25.0",
"@opentelemetry/sdk-trace-node": "1.25.0",
"@opentelemetry/semantic-conventions": "1.25.0"
"@opentelemetry/exporter-jaeger": "1.25.1",
"@opentelemetry/exporter-zipkin": "1.25.1",
"@opentelemetry/instrumentation": "0.52.1",
"@opentelemetry/instrumentation-http": "0.52.1",
"@opentelemetry/resources": "1.25.1",
"@opentelemetry/sdk-trace-base": "1.25.1",
"@opentelemetry/sdk-trace-node": "1.25.1",
"@opentelemetry/semantic-conventions": "1.25.1"
},
"homepage": "https:/open-telemetry/opentelemetry-js/tree/main/examples/https",
"devDependencies": {
Expand Down
32 changes: 16 additions & 16 deletions examples/https/server-cert.pem
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDozCCAougAwIBAgIUZdBdHwmbcYbMUvOesYRyYlg11JMwDQYJKoZIhvcNAQEL
MIIDozCCAougAwIBAgIUNmVva8tI/hqzZAB7FZzPmNr/Q0owDQYJKoZIhvcNAQEL
BQAwYTELMAkGA1UEBhMCQ0wxCzAJBgNVBAgMAlJNMRowGAYDVQQHDBFPcGVuVGVs
ZW1ldHJ5VGVzdDENMAsGA1UECgwEUm9vdDENMAsGA1UECwwEVGVzdDELMAkGA1UE
AwwCY2EwHhcNMjEwNjA4MDgxNTE2WhcNMzEwNjA2MDgxNTE2WjBhMQswCQYDVQQG
AwwCY2EwHhcNMjQwNjA4MTkxODUyWhcNMzQwNjA2MTkxODUyWjBhMQswCQYDVQQG
EwJDTDELMAkGA1UECAwCUk0xGjAYBgNVBAcMEU9wZW5UZWxlbWV0cnlUZXN0MQ0w
CwYDVQQKDARSb290MQ0wCwYDVQQLDARUZXN0MQswCQYDVQQDDAJjYTCCASIwDQYJ
KoZIhvcNAQEBBQADggEPADCCAQoCggEBALw9Shaqp1O1zgYK8z5pnvuHK3o9cUNT
+EJz5KLADn11HSgfj5S96s6lDP9mUy8oDXdk9zSH8QsPp/maVh0AM1WrPDDTBJT5
vdPyUezzn4wvBrJSG/mmy/p4QU1srmE0ueuhgot97GZa9qu+gOqGei3YTjrbx14H
jyvexx+QhqrpUg46qAm67pJHC5jN6LmufoIvepyvQC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vP0RO99CpVdj0ZMB8GA1UdIwQYMBaAFOue
Tx80MsHFiBvP0RO99CpVdj0ZMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL
BQADggEBAJYqqU3wCDX+YZDZ4zd8k725MSfKk1omCxDzDzjuNAjqD/vuSE0YfdFB
bTWMiBGsCqa6FgWwyT2oMPnJKShScZReFEZcM2s+/odfwUTwF4lD/UvZf6PdDhJ5
kxqhoej2ZT8NY+m+rddmg5MaurIcIfOhOxRjarmhs2lrg5qmGKznauettsmA1ZpR
d2ZZA10WstCKN7jHOUqUmSB/2oC/NZno09yXqgbNwIEwBgsUDNaYkGzIzsKD+mOy
NTxLo/PJ5venVgboomDkWJqOOm+HtqfD64rczWyTS/ZdQhuFlk+aCYAwOhYZZH9Z
IEkKcW8xN5+q8Bi9nsst5F1cuw84LD4=
-----END CERTIFICATE-----
52 changes: 26 additions & 26 deletions examples/https/server-key.pem
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC8PUoWqqdTtc4G
CvM+aZ77hyt6PXFDU/hCc+SiwA59dR0oH4+UverOpQz/ZlMvKA13ZPc0h/ELD6f5
mlYdADNVqzww0wSU+b3T8lHs85+MLwayUhv5psv6eEFNbK5hNLnroYKLfexmWvar
voDqhnot2E4628deB48r3scfkIaq6VIOOqgJuu6SRwuYzei5rn6CL3qcr0AhGyjf
p9gdrQJ/aJ9cKO1JgYoExIlsZNRp+9CCbskxG6R6Cxb4kOZL02FzP9ihzDl42TPX
0MbW7HjVJo/FSt/rUuYwXSETmcSsYd6/a1e0gR625U1gdwmfzbCW5WbszGsy1pGE
tfyWbnfRAgMBAAECggEAP1YT7qp+4ICkkI3wqEhbkOA7Ncckq/W964YZINWkSnw0
UkLESdTZA6yvQeQJCy3b0hdrwgYXiZQ7/ZT7coiVvTZ/ayIlQYcCYyT+gc67GSzd
gPR1q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3vfrZ1Jocid3wn9uuu9vOazcz
M3EOF1rz5bgjwb/vk6CyGh1MfmeVCRnuQ3mBIXQ0xwS4QY71Vvw3099fhbtbMHez
5gyQv1ojKQKBgHkXBqGHmxsUVL/lZ/GT+rdayWPImK+L4IEItfNiOhn0huiKJ75+
Z0Zv3pkL52j3aOcWaFiDs2E0R9j8+lr5vRsu6kM0VDNF48ECCjVetXzSEYfJ+OeD
VZoyvwCEhIrjYtd1j0V8yOInfYVZcaaGgVZi2jGoc95x0dN3okXfT61VAoGAVrCA
bqdFPizzSXkTL15ztRt4C7JphWziIik37+fnom5uMPmauxX6rlgw8JmUo9ZK1+u4
7PHGHxuz6i5p29hF/SMMwfSirRzJEjo52STjWvqjVx3wBnUkRvvhlIWxOmpylzNj
hd7iUOdIqqES0O+udvUp+8xYUI/pU9vMadnKciECgYB3cJ+7EPNgJgdpQ9Pslex8
6iHdQH9DIyIb/KqQVe7em5NZXwANCAOQ6KqzhszM/eH7NoSeN7C9Z9uHHIHDfz4m
QO896l7rM1k1R/USaUK4By/O/t/V/aIGjOnPsXxEGrEPDXXBtzUAEs5yAa+Ne1m7
BiP9MuDgBTVkV1iJx37eqg==
-----END PRIVATE KEY-----
8 changes: 7 additions & 1 deletion examples/opentelemetry-web/examples/fetch-proto/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ const { ZoneContextManager } = require("@opentelemetry/context-zone");
const { B3Propagator } = require("@opentelemetry/propagator-b3");
const { registerInstrumentations } = require("@opentelemetry/instrumentation");
const { OTLPTraceExporter: OTLPTraceExporterProto } = require("@opentelemetry/exporter-trace-otlp-proto");
const { Resource } = require("@opentelemetry/resources");
const { SEMRESATTRS_SERVICE_NAME } = require("@opentelemetry/semantic-conventions");

const provider = new WebTracerProvider();
const provider = new WebTracerProvider({
resource: new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'fetch-proto-web-service'
})
});

// Note: For production consider using the "BatchSpanProcessor" to reduce the number of requests
// to your exporter. Using the SimpleSpanProcessor here as it sends the spans immediately to the
Expand Down
8 changes: 7 additions & 1 deletion examples/opentelemetry-web/examples/fetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ const { FetchInstrumentation } = require( '@opentelemetry/instrumentation-fetch'
const { ZoneContextManager } = require( '@opentelemetry/context-zone');
const { B3Propagator } = require( '@opentelemetry/propagator-b3');
const { registerInstrumentations } = require( '@opentelemetry/instrumentation');
const { Resource } = require('@opentelemetry/resources');
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');

const provider = new WebTracerProvider();
const provider = new WebTracerProvider({
resource: new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'fetch-web-service'
})
});

// Note: For production consider using the "BatchSpanProcessor" to reduce the number of requests
// to your exporter. Using the SimpleSpanProcessor here as it sends the spans immediately to the
Expand Down
8 changes: 7 additions & 1 deletion examples/opentelemetry-web/examples/fetchXhr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ const { FetchInstrumentation } = require('@opentelemetry/instrumentation-fetch')
const { XMLHttpRequestInstrumentation } = require('@opentelemetry/instrumentation-xml-http-request');
const { ZoneContextManager } = require('@opentelemetry/context-zone');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { Resource } = require('@opentelemetry/resources');
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');

const provider = new WebTracerProvider();
const provider = new WebTracerProvider({
resource: new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'fetch-xhr-web-service'
})
});

// Note: For production consider using the "BatchSpanProcessor" to reduce the number of requests
// to your exporter. Using the SimpleSpanProcessor here as it sends the spans immediately to the
Expand Down
8 changes: 7 additions & 1 deletion examples/opentelemetry-web/examples/fetchXhrB3/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ const { XMLHttpRequestInstrumentation } = require( '@opentelemetry/instrumentati
const { ZoneContextManager } = require( '@opentelemetry/context-zone');
const { B3Propagator } = require( '@opentelemetry/propagator-b3');
const { registerInstrumentations } = require( '@opentelemetry/instrumentation');
const { Resource } = require('@opentelemetry/resources');
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');

const provider = new WebTracerProvider();
const provider = new WebTracerProvider({
resource: new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'fetch-xhr-b3-web-service'
})
});

// Note: For production consider using the "BatchSpanProcessor" to reduce the number of requests
// to your exporter. Using the SimpleSpanProcessor here as it sends the spans immediately to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ const { ZoneContextManager } = require( '@opentelemetry/context-zone');
const { OTLPTraceExporter } = require( '@opentelemetry/exporter-trace-otlp-http');
const { B3Propagator } = require( '@opentelemetry/propagator-b3');
const { registerInstrumentations } = require( '@opentelemetry/instrumentation');
const { Resource } = require('@opentelemetry/resources');
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');

const providerWithZone = new WebTracerProvider();
const providerWithZone = new WebTracerProvider({
resource: new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'xml-http-web-service'
})
});

// Note: For production consider using the "BatchSpanProcessor" to reduce the number of requests
// to your exporter. Using the SimpleSpanProcessor here as it sends the spans immediately to the
Expand Down
9 changes: 8 additions & 1 deletion examples/opentelemetry-web/examples/zipkin/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
const { ConsoleSpanExporter, SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base');
const { WebTracerProvider } = require('@opentelemetry/sdk-trace-web');
const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin');
const { Resource } = require('@opentelemetry/resources');
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');

const provider = new WebTracerProvider({
resource: new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'zipkin-web-service'
})
});

const provider = new WebTracerProvider();
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
provider.addSpanProcessor(new SimpleSpanProcessor(new ZipkinExporter({
// testing interceptor
Expand Down
30 changes: 15 additions & 15 deletions examples/opentelemetry-web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "web-opentelemetry-example",
"private": true,
"version": "0.52.0",
"version": "0.52.1",
"description": "Example of using @opentelemetry/sdk-trace-web and @opentelemetry/sdk-metrics in browser",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -45,20 +45,20 @@
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/context-zone": "1.25.0",
"@opentelemetry/core": "1.25.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.52.0",
"@opentelemetry/exporter-trace-otlp-http": "0.52.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.52.0",
"@opentelemetry/exporter-zipkin": "1.25.0",
"@opentelemetry/instrumentation": "0.52.0",
"@opentelemetry/instrumentation-fetch": "0.52.0",
"@opentelemetry/instrumentation-xml-http-request": "0.52.0",
"@opentelemetry/propagator-b3": "1.25.0",
"@opentelemetry/sdk-metrics": "1.25.0",
"@opentelemetry/sdk-trace-base": "1.25.0",
"@opentelemetry/sdk-trace-web": "1.25.0",
"@opentelemetry/semantic-conventions": "1.25.0"
"@opentelemetry/context-zone": "1.25.1",
"@opentelemetry/core": "1.25.1",
"@opentelemetry/exporter-metrics-otlp-http": "0.52.1",
"@opentelemetry/exporter-trace-otlp-http": "0.52.1",
"@opentelemetry/exporter-trace-otlp-proto": "0.52.1",
"@opentelemetry/exporter-zipkin": "1.25.1",
"@opentelemetry/instrumentation": "0.52.1",
"@opentelemetry/instrumentation-fetch": "0.52.1",
"@opentelemetry/instrumentation-xml-http-request": "0.52.1",
"@opentelemetry/propagator-b3": "1.25.1",
"@opentelemetry/sdk-metrics": "1.25.1",
"@opentelemetry/sdk-trace-base": "1.25.1",
"@opentelemetry/sdk-trace-web": "1.25.1",
"@opentelemetry/semantic-conventions": "1.25.1"
},
"homepage": "https:/open-telemetry/opentelemetry-js/tree/main/examples/tracer-web"
}
Loading

0 comments on commit 4a10055

Please sign in to comment.