Skip to content

Commit

Permalink
add ratelimit type as Tag to Span, such that we can see what type was…
Browse files Browse the repository at this point in the history
… used and serach (#1795)

Signed-off-by: Sandor Szücs <[email protected]>
  • Loading branch information
szuecs authored Jun 21, 2021
1 parent f550f9f commit 2a88786
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ratelimit/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

// clusterLimitRedis stores all data required for the cluster ratelimit.
type clusterLimitRedis struct {
typ string
group string
maxHits int64
window time.Duration
Expand Down Expand Up @@ -46,6 +47,7 @@ func newClusterRateLimiterRedis(s Settings, r *net.RedisRingClient, group string
}

rl := &clusterLimitRedis{
typ: s.Type.String(),
group: group,
maxHits: int64(s.MaxHits),
window: s.TimeWindow,
Expand Down Expand Up @@ -90,6 +92,7 @@ func (c *clusterLimitRedis) startSpan(ctx context.Context, spanName string) func
span := c.ringClient.StartSpan(spanName, opentracing.ChildOf(parentSpan.Context()))
ext.Component.Set(span, "skipper")
ext.SpanKind.Set(span, "client")
span.SetTag("ratelimit_type", c.typ)
span.SetTag("group", c.group)
span.SetTag("max_hits", c.maxHits)
span.SetTag("window", c.window.String())
Expand Down

0 comments on commit 2a88786

Please sign in to comment.