Skip to content

Commit 0203010

Browse files
committed
Depratation notices
1 parent 608bf31 commit 0203010

6 files changed

Lines changed: 49 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
* [Official website](https://echo.labstack.com)
88
* [All middleware docs](https://echo.labstack.com/docs/category/middleware)
99

10+
## Deprecations / alternatives
11+
12+
1. Prometheus middleware has a new separate repository - https://github.com/labstack/echo-prometheus
13+
2. Jaeger middleware is deprecated, use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + [OTLP exporters](https://opentelemetry.io/docs/languages/go/exporters/).
14+
3. Zipkin middleware is deprecated, use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + [OTLP exporters](https://opentelemetry.io/docs/languages/go/exporters/).
15+
1016
## Usage
1117

1218
For Echo `v5` support:

echoprometheus/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Usage
22

3+
Deprecated: use new repository [echo-prometheus middleware](https://github.com/labstack/echo-prometheus) or [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters
4+
35
```go
46
package main
57

echoprometheus/prometheus.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
/*
55
Package echoprometheus provides middleware to add Prometheus metrics.
6+
7+
Deprecated: use new repository [echo-prometheus middleware](https://github.com/labstack/echo-prometheus) or [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters
68
*/
79
package echoprometheus
810

@@ -115,6 +117,8 @@ type PushGatewayConfig struct {
115117
}
116118

117119
// NewHandler creates new instance of Handler using Prometheus default registry.
120+
//
121+
// Deprecated: use new repository [echo-prometheus middleware](https://github.com/labstack/echo-prometheus) or [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters
118122
func NewHandler() echo.HandlerFunc {
119123
return NewHandlerWithConfig(HandlerConfig{})
120124
}
@@ -137,11 +141,15 @@ func NewHandlerWithConfig(config HandlerConfig) echo.HandlerFunc {
137141
}
138142

139143
// NewMiddleware creates new instance of middleware using Prometheus default registry.
144+
//
145+
// Deprecated: use new repository [echo-prometheus middleware](https://github.com/labstack/echo-prometheus) or [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters
140146
func NewMiddleware(subsystem string) echo.MiddlewareFunc {
141147
return NewMiddlewareWithConfig(MiddlewareConfig{Subsystem: subsystem})
142148
}
143149

144150
// NewMiddlewareWithConfig creates new instance of middleware using given configuration.
151+
//
152+
// Deprecated: use [echo-prometheus middleware](https://github.com/labstack/echo-prometheus) or [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters
145153
func NewMiddlewareWithConfig(config MiddlewareConfig) echo.MiddlewareFunc {
146154
mw, err := config.ToMiddleware()
147155
if err != nil {
@@ -151,6 +159,8 @@ func NewMiddlewareWithConfig(config MiddlewareConfig) echo.MiddlewareFunc {
151159
}
152160

153161
// ToMiddleware converts configuration to middleware or returns an error.
162+
//
163+
// Deprecated: use new repository [echo-prometheus middleware](https://github.com/labstack/echo-prometheus) or [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters
154164
func (conf MiddlewareConfig) ToMiddleware() (echo.MiddlewareFunc, error) {
155165
if conf.timeNow == nil {
156166
conf.timeNow = time.Now
@@ -386,6 +396,8 @@ func computeApproximateRequestSize(r *http.Request) int {
386396
// }()
387397
//
388398
// ```
399+
//
400+
// Deprecated: use new repository [echo-prometheus middleware](https://github.com/labstack/echo-prometheus) or [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters
389401
func RunPushGatewayGatherer(ctx context.Context, config PushGatewayConfig) error {
390402
if config.PushGatewayURL == "" {
391403
return errors.New("push gateway URL is missing")

jaegertracing/jaegertracing.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import (
2424
}
2525
2626
```
27+
28+
Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/jaegertracing/jaeger-client-go
2729
*/
2830
package jaegertracing
2931

@@ -90,6 +92,8 @@ var (
9092

9193
// New creates an Opentracing tracer and attaches it to Echo middleware.
9294
// Returns Closer do be added to caller function as `defer closer.Close()`
95+
//
96+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/jaegertracing/jaeger-client-go
9397
func New(e *echo.Echo, skipper middleware.Skipper) io.Closer {
9498
// Add Opentracing instrumentation
9599
defcfg := config.Configuration{
@@ -122,6 +126,8 @@ func New(e *echo.Echo, skipper middleware.Skipper) io.Closer {
122126

123127
// Trace returns a Trace middleware.
124128
// Trace middleware traces http requests and reporting errors.
129+
//
130+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/jaegertracing/jaeger-client-go
125131
func Trace(tracer opentracing.Tracer) echo.MiddlewareFunc {
126132
c := DefaultTraceConfig
127133
c.Tracer = tracer
@@ -131,6 +137,8 @@ func Trace(tracer opentracing.Tracer) echo.MiddlewareFunc {
131137

132138
// TraceWithConfig returns a Trace middleware with config.
133139
// See: `Trace()`.
140+
//
141+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/jaegertracing/jaeger-client-go
134142
func TraceWithConfig(config TraceConfig) echo.MiddlewareFunc {
135143
if config.Tracer == nil {
136144
panic("echo: trace middleware requires opentracing tracer")
@@ -279,6 +287,8 @@ func defaultOperationName(c *echo.Context) string {
279287
}
280288

281289
// TraceFunction wraps funtion with opentracing span adding tags for the function name and caller details
290+
//
291+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/jaegertracing/jaeger-client-go
282292
func TraceFunction(ctx *echo.Context, fn interface{}, params ...interface{}) (result []reflect.Value) {
283293
// Get function name
284294
name := runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name()
@@ -314,6 +324,8 @@ func TraceFunction(ctx *echo.Context, fn interface{}, params ...interface{}) (re
314324

315325
// CreateChildSpan creates a new opentracing span adding tags for the span name and caller details.
316326
// User must call defer `sp.Finish()`
327+
//
328+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/jaegertracing/jaeger-client-go
317329
func CreateChildSpan(ctx *echo.Context, name string) opentracing.Span {
318330
parentSpan := opentracing.SpanFromContext(ctx.Request().Context())
319331
sp := opentracing.StartSpan(
@@ -333,6 +345,8 @@ func CreateChildSpan(ctx *echo.Context, name string) opentracing.Span {
333345
}
334346

335347
// NewTracedRequest generates a new traced HTTP request with opentracing headers injected into it
348+
//
349+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/jaegertracing/jaeger-client-go
336350
func NewTracedRequest(method string, url string, body io.Reader, span opentracing.Span) (*http.Request, error) {
337351
req, err := http.NewRequest(method, url, body)
338352
if err != nil {

zipkintracing/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Tracing Library for Go
22

3+
> Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/openzipkin-contrib/zipkin-otel and https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/zipkinexporter
4+
> `Go app -> OTLP -> OpenTelemetry Collector -> Zipkin`
5+
36
This library provides tracing for go using [Zipkin](https://zipkin.io/)
47

58
## Usage

zipkintracing/tracing.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,16 @@ var (
5151
)
5252

5353
// DoHTTP is a http zipkin tracer implementation of HTTPDoer
54+
//
55+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/openzipkin-contrib/zipkin-otel and https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/zipkinexporter
5456
func DoHTTP(c *echo.Context, r *http.Request, client *zipkinhttp.Client) (*http.Response, error) {
5557
req := r.WithContext(c.Request().Context())
5658
return client.DoWithAppSpan(req, req.Method)
5759
}
5860

5961
// TraceFunc wraps function call with span so that we can trace time taken by func, eventContext only provided if we want to store trace headers
62+
//
63+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/openzipkin-contrib/zipkin-otel and https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/zipkinexporter
6064
func TraceFunc(c *echo.Context, spanName string, spanTags Tags, tracer *zipkin.Tracer) func() {
6165
span, _ := tracer.StartSpanFromContext(c.Request().Context(), spanName)
6266
for key, value := range spanTags(c) {
@@ -71,13 +75,17 @@ func TraceFunc(c *echo.Context, spanName string, spanTags Tags, tracer *zipkin.T
7175
}
7276

7377
// TraceProxy middleware that traces reverse proxy
78+
//
79+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/openzipkin-contrib/zipkin-otel and https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/zipkinexporter
7480
func TraceProxy(tracer *zipkin.Tracer) echo.MiddlewareFunc {
7581
config := DefaultTraceProxyConfig
7682
config.Tracer = tracer
7783
return TraceProxyWithConfig(config)
7884
}
7985

8086
// TraceProxyWithConfig middleware that traces reverse proxy
87+
//
88+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/openzipkin-contrib/zipkin-otel and https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/zipkinexporter
8189
func TraceProxyWithConfig(config TraceProxyConfig) echo.MiddlewareFunc {
8290
return func(next echo.HandlerFunc) echo.HandlerFunc {
8391
return func(c *echo.Context) error {
@@ -116,13 +124,17 @@ func TraceProxyWithConfig(config TraceProxyConfig) echo.MiddlewareFunc {
116124
}
117125

118126
// TraceServer middleware that traces server calls
127+
//
128+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/openzipkin-contrib/zipkin-otel and https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/zipkinexporter
119129
func TraceServer(tracer *zipkin.Tracer) echo.MiddlewareFunc {
120130
config := DefaultTraceServerConfig
121131
config.Tracer = tracer
122132
return TraceServerWithConfig(config)
123133
}
124134

125135
// TraceServerWithConfig middleware that traces server calls
136+
//
137+
// Deprecated: use [OpenTelemetry middleware](https://github.com/labstack/echo-opentelemetry) instead + OTLP exporters. Read this: https://github.com/openzipkin-contrib/zipkin-otel and https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/zipkinexporter
126138
func TraceServerWithConfig(config TraceServerConfig) echo.MiddlewareFunc {
127139
return func(next echo.HandlerFunc) echo.HandlerFunc {
128140
return func(c *echo.Context) error {

0 commit comments

Comments
 (0)