DEV Community

Cover image for OpenTelemetry Echo by Labstack [otelecho]
Alexandr Bandurchin for Uptrace

Posted on • Originally published at uptrace.dev

OpenTelemetry Echo by Labstack [otelecho]

Echo is a high performance, extensible, minimalist web framework for Go. It features a highly optimized HTTP router with zero dynamic memory allocations.

In this article you will learn how to monitor and optimize Echo performance using OpenTelemetry Echo instrumentation.

What is OpenTelemetry?

OpenTelemetry is an open-source observability framework that aims to standardize and simplify the collection, processing, and export of telemetry data from applications and systems.

OpenTelemetry supports multiple programming languages and platforms, making it suitable for a wide range of applications and environments.

OpenTelemetry enables developers to instrument their code and collect telemetry data, which can then be exported to various OpenTelemetry backends or observability platforms for analysis and visualization. For production deployments, the OpenTelemetry Collector provides a robust solution for aggregating telemetry data from multiple sources before sending it to backend systems.

Echo instrumentation

To install otelecho instrumentation:

go get go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho
Enter fullscreen mode Exit fullscreen mode

Usage

You can instrument Gin router by installing OpenTelemetry middleware:

import (
    "github.com/labstack/echo/v4"
    "go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho"
)

router := echo.New()
router.Use(otelecho.Middleware("service-name"))
Enter fullscreen mode Exit fullscreen mode

What is Uptrace?

Uptrace is a OpenTelemetry APM that supports distributed tracing, metrics, and logs. You can use it to monitor applications and troubleshoot issues.

Uptrace Overview

Uptrace comes with an intuitive query builder, rich dashboards, alerting rules with notifications, and integrations for most languages and frameworks.

Uptrace can process billions of spans and metrics on a single server and allows you to monitor your applications at 10x lower cost.

In just a few minutes, you can try Uptrace by visiting the cloud demo (no login required) or running it locally with Docker. The source code is available on GitHub.

What's next?

With OpenTelemetry Echo instrumentation in place, you can monitor request performance, trace database queries, and troubleshoot errors across your distributed systems. Explore other Go frameworks like Gin or Beego for similar observability patterns.

Top comments (0)