Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support metrics for otelgin #5096

Open
anoopknayak opened this issue Feb 17, 2024 · 2 comments
Open

[Feature Request] Support metrics for otelgin #5096

anoopknayak opened this issue Feb 17, 2024 · 2 comments
Labels
area: instrumentation Related to an instrumentation package enhancement New feature or request instrumentation: otelgin

Comments

@anoopknayak
Copy link

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 anoopknayak added area: instrumentation Related to an instrumentation package enhancement New feature or request instrumentation: otelgin labels Feb 17, 2024
@anoopknayak
Copy link
Author

@hanyuancheung Could you help me with this?

@trajan0x
Copy link

trajan0x commented Jun 27, 2024

@technologize put together a demo here

This package also supports both and might be helpful as a reference

(We also adapted it to a later version of otel here if anyone else stumbling across this issue finds useful synapsecns/sanguine#2807)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: instrumentation Related to an instrumentation package enhancement New feature or request instrumentation: otelgin
Projects
None yet
Development

No branches or pull requests

2 participants