Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Documentation on Instrumentation Outcomes for HTTP Package #5042

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# OpenTelemetry HTTP and HTTPS Instrumentation for Node.js

[![NPM Published Version][npm-img]][npm-url]
[![Apache License][license-image]][license-image]
[![Apache License][license-image]][license-url]

**Note: This is an experimental package under active development. New releases may include breaking changes.**

This module provides automatic instrumentation for [`http`](https://nodejs.org/api/http.html) and [`https`](https://nodejs.org/api/https.html).

For automatic instrumentation see the
[@opentelemetry/sdk-trace-node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package.
For automatic instrumentation, see the [@opentelemetry/sdk-trace-node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package.

## Installation

```bash
npm install --save @opentelemetry/instrumentation-http
```

create2000 marked this conversation as resolved.
Show resolved Hide resolved
create2000 marked this conversation as resolved.
Show resolved Hide resolved

## Supported Versions

Expand Down Expand Up @@ -44,6 +43,7 @@ registerInstrumentations({
instrumentations: [new HttpInstrumentation()],
});


create2000 marked this conversation as resolved.
Show resolved Hide resolved
```

See [examples/http](https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/http) for a short example.
Expand Down Expand Up @@ -119,9 +119,8 @@ Create HTTP client spans which implement Semantic Convention [Version 1.7.0](htt
When `OTEL_SEMCONV_STABILITY_OPT_IN` is not set or includes `http/dup`, this module implements Semantic Convention [Version 1.7.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/semantic_conventions/README.md).

Attributes collected:

| Attribute | Short Description |
| ------------------------------------------- | ------------------------------------------------------------------------------ |
|---------------------------------------------|--------------------------------------------------------------------------------|
| `ip_tcp` | Transport protocol used |
| `ip_udp` | Transport protocol used |
| `http.client_ip` | The IP address of the original client behind all proxies, if known |
Expand All @@ -140,12 +139,12 @@ Attributes collected:
| `http.url` | Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]` |
| `http.user_agent` | Value of the HTTP User-Agent header sent by the client |
| `net.host.ip` | Like net.peer.ip but for the host IP. Useful in case of a multi-IP host |
| `net.host.name` | Local hostname or similar |
| `net.host.port` | Like net.peer.port but for the host port |
| `net.peer.ip.` | Remote address of the peer (dotted decimal for IPv4 or RFC5952 for IPv6) |
| `net.peer.name` | Remote hostname or similar |
| `net.peer.port` | Remote port number |
| `net.transport` | Transport protocol used |
| `net.host.name` | Local hostname of the server. |
| `net.peer.ip` | The IP address of the remote client |
| `net.peer.name` | The DNS name or IP address of the remote client |
| `net.peer.port` | The port of the remote peer |
| `peer.service` | The name of the remote service |
create2000 marked this conversation as resolved.
Show resolved Hide resolved
| `service.name` | Name of the service that generated the span |
create2000 marked this conversation as resolved.
Show resolved Hide resolved

## Useful links

Expand Down
1 change: 1 addition & 0 deletions org
Submodule org added at dfc0a2