opentelemetry-go-contrib icon indicating copy to clipboard operation
opentelemetry-go-contrib copied to clipboard

[Feature Request] Support metrics for otelgin

Open anoopknayak opened this issue 1 year ago • 3 comments

Problem Statement

Currently otelgin only provides ability to trace events. I want to propose the ability to monitor gin endpoints using OTEL.

Proposed Solution

The idea is to inject the various instruments within the current Middleware for tracing. We can create a single Meter for all gin endpoint related instrumentation. We want to measure the 4 golden signals and create instruments for measuring all the 4 signals. It would look something like follows:

Metric Name Type of Instrument Golden Signal Measured
http.server.request.duration Int64Histogram Latencu, Errors (through attributes)
http.server.active_requests Int64UpDownCounter Traffic, Errors (through attributes)
http.server.request.body.size Int64UpDownCounter Saturation
http.server.response.body.size Int64UpDownCounter Saturation

Alternatives

The alternative solution would be to create a new middleware specifically for metrics which IMO might be waste of resources as we are computing the same things for tracing as well.

Prior Art

N/A

Additional Context

N/A

anoopknayak avatar Feb 17 '24 04:02 anoopknayak