-
Notifications
You must be signed in to change notification settings - Fork 838
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into change_default_propagator
- Loading branch information
Showing
388 changed files
with
4,266 additions
and
1,090 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>Fetch Plugin Example</title> | ||
<base href="/"> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> | ||
|
||
<body> | ||
Example of using Web Tracer with Fetch plugin with console exporter and collector exporter | ||
<script type="text/javascript" src="fetch.js"></script> | ||
<br/> | ||
<button id="button1">Test</button> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
'use strict'; | ||
|
||
import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/tracing'; | ||
import { CollectorExporter } from '@opentelemetry/exporter-collector'; | ||
import { WebTracerProvider } from '@opentelemetry/web'; | ||
import { FetchPlugin } from '@opentelemetry/plugin-fetch'; | ||
import { ZoneContextManager } from '@opentelemetry/context-zone'; | ||
import { B3Propagator } from '@opentelemetry/core'; | ||
|
||
const provider = new WebTracerProvider({ | ||
plugins: [ | ||
new FetchPlugin({ | ||
ignoreUrls: [/localhost:8090\/sockjs-node/], | ||
propagateTraceHeaderCorsUrls: [ | ||
'https://cors-test.appspot.com/test', | ||
'https://httpbin.org/get', | ||
], | ||
clearTimingResources: true | ||
}), | ||
], | ||
}); | ||
|
||
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter())); | ||
provider.addSpanProcessor(new SimpleSpanProcessor(new CollectorExporter())); | ||
provider.register({ | ||
contextManager: new ZoneContextManager(), | ||
propagator: new B3Propagator(), | ||
}); | ||
|
||
const webTracerWithZone = provider.getTracer('example-tracer-web'); | ||
|
||
const getData = (url) => fetch(url, { | ||
method: 'GET', | ||
headers: { | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json', | ||
}, | ||
}); | ||
|
||
// example of keeping track of context between async operations | ||
const prepareClickEvent = () => { | ||
const url1 = 'https://httpbin.org/get'; | ||
|
||
const element = document.getElementById('button1'); | ||
|
||
const onClick = () => { | ||
const span1 = webTracerWithZone.startSpan(`files-series-info`, { | ||
parent: webTracerWithZone.getCurrentSpan(), | ||
}); | ||
webTracerWithZone.withSpan(span1, () => { | ||
getData(url1).then((_data) => { | ||
webTracerWithZone.getCurrentSpan().addEvent('fetching-span1-completed'); | ||
span1.end(); | ||
}); | ||
}); | ||
for (let i = 0, j = 5; i < j; i += 1) { | ||
const span1 = webTracerWithZone.startSpan(`files-series-info-${i}`, { | ||
parent: webTracerWithZone.getCurrentSpan(), | ||
}); | ||
webTracerWithZone.withSpan(span1, () => { | ||
getData(url1).then((_data) => { | ||
webTracerWithZone.getCurrentSpan().addEvent('fetching-span1-completed'); | ||
span1.end(); | ||
}); | ||
}); | ||
} | ||
}; | ||
element.addEventListener('click', onClick); | ||
}; | ||
|
||
window.addEventListener('load', prepareClickEvent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# OpenTelemetry Plugins Node Core | ||
[![Gitter chat][gitter-image]][gitter-url] | ||
[![NPM Published Version][npm-img]][npm-url] | ||
[![dependencies][dependencies-image]][dependencies-url] | ||
[![Apache License][license-image]][license-image] | ||
|
||
This package depends on all node plugins maintained by OpenTelemetry authors. | ||
Installing it will also install all plugins. | ||
|
||
## Plugins | ||
|
||
In addition to all [node core plugins][otel-plugins-node-core], the following plugins will be installed by this package: | ||
|
||
- [@opentelemetry/plugin-express][otel-plugin-express] | ||
- [@opentelemetry/plugin-ioredis][otel-plugin-ioredis] | ||
- [@opentelemetry/plugin-mongodb][otel-plugin-mongodb] | ||
- [@opentelemetry/plugin-mysql][otel-plugin-mysql] | ||
- [@opentelemetry/plugin-pg-pool][otel-plugin-pg-pool] | ||
- [@opentelemetry/plugin-pg][otel-plugin-pg] | ||
- [@opentelemetry/plugin-redis][otel-plugin-redis] | ||
|
||
Note: [@opentelemetry/plugin-dns][otel-plugin-dns] is excluded by default because it requires some manual configuration to prevent infinite loops with exporters. | ||
|
||
## Useful links | ||
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/> | ||
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js> | ||
- For help or feedback on this project, join us on [gitter][gitter-url] | ||
|
||
## License | ||
|
||
Apache 2.0 - See [LICENSE][license-url] for more information. | ||
|
||
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg | ||
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge | ||
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE | ||
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat | ||
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=metapackages/plugins-node-core | ||
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetryplugins-node-core | ||
[npm-url]: https://www.npmjs.com/package/@opentelemetry/plugins-node-core | ||
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fplugins-node-core.svg | ||
|
||
[otel-plugins-node-core]: https://www.npmjs.com/package/@opentelemetry/plugins-node-core | ||
|
||
[otel-plugin-dns]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-dns | ||
[otel-plugin-express]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-express | ||
[otel-plugin-ioredis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-ioredis | ||
[otel-plugin-mongodb]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-mongodb | ||
[otel-plugin-mysql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-mysql | ||
[otel-plugin-pg-pool]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-pg-pool | ||
[otel-plugin-pg]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-pg | ||
[otel-plugin-redis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "@opentelemetry/plugins-node-all", | ||
"version": "0.8.3", | ||
"description": "Metapackage which bundles opentelemetry node core and contrib plugins", | ||
"author": "OpenTelemetry Authors", | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme", | ||
"license": "Apache-2.0", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/open-telemetry/opentelemetry-js.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/open-telemetry/opentelemetry-js/issues" | ||
}, | ||
"dependencies": { | ||
"@opentelemetry/plugins-node-core": "^0.8.3", | ||
"@opentelemetry/plugin-express": "0.8.0", | ||
"@opentelemetry/plugin-ioredis": "0.8.0", | ||
"@opentelemetry/plugin-mongodb": "0.8.0", | ||
"@opentelemetry/plugin-mysql": "0.8.0", | ||
"@opentelemetry/plugin-pg-pool": "0.8.0", | ||
"@opentelemetry/plugin-pg": "0.8.0", | ||
"@opentelemetry/plugin-redis": "0.8.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/opentelemetry-api/src/context/propagation/HttpTextPropagator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/opentelemetry-api/src/context/propagation/NoopHttpTextPropagator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.