Skip to content

Commit

Permalink
chore: update HTTP Readme (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkale22 authored Sep 26, 2019
1 parent e201730 commit 1006e52
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ OpenTelemetry can collect tracing data automatically using plugins. Vendors/User
- [@opentelemetry/plugin-http](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-http)
- [@opentelemetry/plugin-grpc](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-grpc)

To request automatic tracing support for a module not on this list, please [file an issue](https://github.com/open-telemetry/opentelemetry-js/issues). Alternatively, you can write a plugin yourself.

### Shims

| Package | Description |
Expand Down
11 changes: 10 additions & 1 deletion examples/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

OpenTelemetry HTTP Instrumentation allows the user to automatically collect trace data and export them to the backend of choice (we can use Zipkin or Jaeger for this example), to give observability to distributed systems.

This is a simple example that demonstrates tracing HTTP request from client to server. The example
shows key aspects of tracing such as
- Root Span (on Client)
- Child Span (on Client)
- Child Span from a Remote Parent (on Server)
- SpanContext Propagation (from Client to Server)
- Span Events
- Span Attributes

## Installation

```sh
Expand Down Expand Up @@ -65,4 +74,4 @@ Go to Jaeger with your browser [http://localhost:16686/trace/(your-trace-id)]()

## LICENSE

Apache License 2.0
Apache License 2.0
25 changes: 23 additions & 2 deletions packages/opentelemetry-plugin-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,32 @@ npm install --save @opentelemetry/plugin-http

## Usage

OpenTelemetry HTTP Instrumentation allows the user to automatically collect trace data and export them to the backend of choice, to give observability to distributed systems.

To load a specific plugin (HTTP in this case), specify it in the Node Tracer's configuration.
```
const { NodeTracer } = require('@opentelemetry/node-sdk');
const tracer = new NodeTracer({
plugins: {
http: {
enabled: true,
// You may use a package name or absolute path to the file.
path: '@opentelemetry/plugin-http',
ignoreOutgoingUrls: [/spans/]
}
}
});
```
const opentelemetry = require('@opentelemetry/plugin-http');

// TODO: DEMONSTRATE API
To load all the [supported plugins](https://github.com/open-telemetry/opentelemetry-js#plugins), use below approach. Each plugin is only loaded when the module that it patches is loaded; in other words, there is no computational overhead for listing plugins for unused modules.
```
const { NodeTracer } = require('@opentelemetry/node-sdk');
const tracer = new NodeTracer();
```

See [examples/http](https://github.com/open-telemetry/opentelemetry-js/tree/master/examples/http) for a short example.

## Useful links
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
Expand Down

0 comments on commit 1006e52

Please sign in to comment.