# nice-grpc-opentelemetry

> OpenTelemetry instrumentation for nice-grpc

Latest version **0.1.25** (published 2026-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install nice-grpc-opentelemetry
pnpm add nice-grpc-opentelemetry
yarn add nice-grpc-opentelemetry
bun add nice-grpc-opentelemetry
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.25 |
| Published | 2026-11-18 |
| First published | 2022-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 36.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 542 |
| Author | Daniel Lytkin |
| Maintainers | aikoven |
| Keywords | grpc, nice-grpc, opentelemetry, tracing |

## Links

- npm: https://www.npmjs.com/package/nice-grpc-opentelemetry
- Repository: https://github.com/deeplay-io/nice-grpc
- Homepage: https://github.com/deeplay-io/nice-grpc/tree/master/packages/nice-grpc-opentelemetry#readme
- Issues: https://github.com/deeplay-io/nice-grpc/issues
- npm.io page: https://npm.io/package/nice-grpc-opentelemetry

## Dependencies (5)

- [ipaddr.js](https://npm.io/package/ipaddr.js.md) ^2.0.1
- [nice-grpc-common](https://npm.io/package/nice-grpc-common.md) ^2.0.4
- [@opentelemetry/api](https://npm.io/package/@opentelemetry/api.md) ^1.8.0
- [abort-controller-x](https://npm.io/package/abort-controller-x.md) ^0.5.0
- [@opentelemetry/semantic-conventions](https://npm.io/package/@opentelemetry/semantic-conventions.md) ^1.22.0

## Recent versions

- 0.1.25 (latest) — 2026-11-18
- 0.1.24 — 2026-10-26
- 0.1.23 — 2026-08-04
- 0.1.22 — 2026-04-24
- 0.1.21 — 2026-04-12
- 0.1.20 — 2025-11-12
- 0.1.19 — 2025-10-01
- 0.1.18 — 2025-03-26
- 0.1.17 — 2025-02-18
- 0.1.16 — 2024-09-24
- 0.1.15 — 2024-06-06
- 0.1.14 — 2024-03-11
- 0.1.13 — 2023-10-19
- 0.1.12 — 2023-10-17
- 0.1.11 — 2023-08-24
- … 10 more at https://npm.io/package/nice-grpc-opentelemetry/versions

## README

# nice-grpc-opentelemetry [![npm version][npm-image]][npm-url]

[OpenTelemetry](https://opentelemetry.io/) instrumentation for
[nice-grpc](https://github.com/deeplay-io/nice-grpc). Currently provides only
[traces](#traces).

## Installation

    npm install nice-grpc-opentelemetry

## Usage

Attach middleware as the first one on the server:

```ts
import {createServer} from 'nice-grpc';
import {openTelemetryServerMiddleware} from 'nice-grpc-opentelemetry';

const server = createServer()
  .use(openTelemetryServerMiddleware())
  .use(/* ... other middleware */);
```

Attach middleware as the first one on the client:

```ts
import {createClientFactory} from 'nice-grpc'; // or 'nice-grpc-web'
import {openTelemetryClientMiddleware} from 'nice-grpc-opentelemetry';

const clientFactory = createClientFactory()
  .use(openTelemetryClientMiddleware())
  .use(/* ... other middleware */);

const client = clientFactory.create(/* ... */);
```

## Traces

This library generates spans according to
[Semantic conventions for RPC spans](https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/rpc/)
with an addition of custom attributes:

| Attribute              | Type   | Description                                | Examples           |
| ---------------------- | ------ | ------------------------------------------ | ------------------ |
| `rpc.grpc.status_text` | string | The name of the status of the gRPC request | `INVALID_ARGUMENT` |

[npm-image]: https://badge.fury.io/js/nice-grpc-opentelemetry.svg
[npm-url]: https://badge.fury.io/js/nice-grpc-opentelemetry

---
_Source: https://npm.io/package/nice-grpc-opentelemetry · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
