Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Layr-Labs/op-plasma-eigenda into ep…
Browse files Browse the repository at this point in the history
…ociask--chore-eigenda-v8
  • Loading branch information
epociask committed Aug 20, 2024
2 parents 77b8796 + f71c31c commit 14c65d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ func NewServer(host string, port int, router *store.Router, log log.Logger,
func WithMetrics(handleFn func(http.ResponseWriter, *http.Request) error,
m metrics.Metricer) func(http.ResponseWriter, *http.Request) error {
return func(w http.ResponseWriter, r *http.Request) error {
recordDur := m.RecordRPCServerRequest(r.URL.Path)
// we use a commitment schema (https://github.com/Layr-Labs/eigenda-proxy?tab=readme-ov-file#commitment-schemas)
// where the first 3 bytes of the path are the commitment header
// commit type | da layer type | version byte
// we want to group all requests by commitment header, otherwise the prometheus metric labels will explode
commitmentHeader := r.URL.Path[:3]
recordDur := m.RecordRPCServerRequest(commitmentHeader)
defer recordDur()

return handleFn(w, r)
Expand Down

0 comments on commit 14c65d4

Please sign in to comment.