First release under the new name. github.com/labstack/echo-otel/v5 is the OpenTelemetry middleware for Echo v5. It replaces github.com/labstack/echo-opentelemetry (v0.0.x), which is now deprecated.
go get github.com/labstack/echo-otel/v5The MAJOR version tracks the Echo version, as in echo-jwt. For Echo v4, use github.com/labstack/echo-otel/v4 from the v4 branch.
Migrating from echo-opentelemetry
Change the import path to github.com/labstack/echo-otel/v5. The API is the same, except that a ServerName without a host (for example :8080) is now rejected. The README lists every telemetry change compared to v0.0.3: Migrating from echo-opentelemetry.
What's changed
error.typeon spans and metrics, per the HTTP semantic conventions (#10).- 5xx responses report the status code.
- Other errors report their Go type.
fmt.Errorfwrappers are unwrapped, and anErrorType()method is used when present. - 4xx responses are not errors.
http.routeand the span name are set when the middleware is added withEcho.Pre. The route always comes from Echo.- Metrics carry only low-cardinality attributes.
server.address,server.portandhttp.request.method_originalstay on spans only. - A panic in a handler is recorded with
error.typepanicand then re-panicked. - Body sizes are no longer set on spans; the body size metrics stay.
network.protocol.versionis2for HTTP/2, not2.0. - Semantic conventions v1.40.0 and OpenTelemetry v1.46.0. The minimum Echo version is still v5.2.1.
- Migration guide from
otelecho, which is deprecated and has been removed from opentelemetry-go-contrib.
Full Changelog: v0.0.3...v5.0.0