riandyrn/otelchi

OpenTelemetry instrumentation for go-chi/chi

Go

173

302 commits

updated May 3, 2026

See the code

README

otelchi

compatibility-test Go Report Card Documentation

OpenTelemetry instrumentation for go-chi/chi.

Essentially this is an adaptation from otelmux but instead of using gorilla/mux, we use go-chi/chi.

Currently, this library can only instrument traces and metrics.

Contributions are welcomed!

Install

$ go get github.com/riandyrn/otelchi

Examples

See examples for details.

Metrics

The metric package provides OpenTelemetry semantic-convention compliant HTTP server metric middleware:

  • http.server.request.duration
  • http.server.active_requests
  • http.server.request.body.size
  • http.server.response.body.size

Legacy metric middleware for request_duration_millis, requests_inflight, and response_size_bytes is still available but deprecated.

Why Port This?

I was planning to make this project as part of the Open Telemetry Go instrumentation project. However, based on this comment they no longer accept new instrumentation. This is why I maintain this project here.

go
go-chi
golang
instrumentation
opentelemetry

riandyrn/otelchi

OpenTelemetry instrumentation for go-chi/chi

Go

173

302 commits

updated May 3, 2026

See the code

README

otelchi

compatibility-test Go Report Card Documentation

OpenTelemetry instrumentation for go-chi/chi.

Essentially this is an adaptation from otelmux but instead of using gorilla/mux, we use go-chi/chi.

Currently, this library can only instrument traces and metrics.

Contributions are welcomed!

Install

$ go get github.com/riandyrn/otelchi

Examples

See examples for details.

Metrics

The metric package provides OpenTelemetry semantic-convention compliant HTTP server metric middleware:

  • http.server.request.duration
  • http.server.active_requests
  • http.server.request.body.size
  • http.server.response.body.size

Legacy metric middleware for request_duration_millis, requests_inflight, and response_size_bytes is still available but deprecated.

Why Port This?

I was planning to make this project as part of the Open Telemetry Go instrumentation project. However, based on this comment they no longer accept new instrumentation. This is why I maintain this project here.

go
go-chi
golang
instrumentation
opentelemetry

Project health

Overall

3.7/10

Maintained

0/10

Code review

5/10
OpenSSF Scorecard

Latest release

v0.12.3 · May 3, 2026

Releases this year

1

Significant stargazers

Ishida Yuya

18 followers · starred Apr 2023

Saza

126 followers · starred Jul 2024