MCPcopy
hub / github.com/grafana/tempo / Get

Method Get

modules/overrides/userconfigurable/client/client.go:157–177  ·  view source on GitHub ↗
(ctx context.Context, userID string)

Source from the content-addressed store, hash-verified

155}
156
157func (o *clientImpl) Get(ctx context.Context, userID string) (tenantLimits *Limits, version backend.Version, err error) {
158 ctx, span := tracer.Start(ctx, "clientImpl.Get", trace.WithAttributes(attribute.String("tenant", userID)))
159 defer span.End()
160
161 metricFetch.WithLabelValues(userID).Inc()
162 defer func() {
163 if err != nil {
164 metricFetchFailed.WithLabelValues(userID).Inc()
165 }
166 }()
167
168 reader, version, err := o.rw.ReadVersioned(ctx, OverridesFileName, []string{OverridesKeyPath, userID})
169 if err != nil {
170 return nil, "", err
171 }
172 defer reader.Close()
173
174 d := json.NewDecoder(reader)
175 err = d.Decode(&tenantLimits)
176 return
177}
178
179func (o *clientImpl) Set(ctx context.Context, userID string, limits *Limits, version backend.Version) (backend.Version, error) {
180 ctx, span := tracer.Start(ctx, "clientImpl.Set", trace.WithAttributes(attribute.String("tenant", userID)))

Callers

nothing calls this directly

Calls 6

DecodeMethod · 0.95
StartMethod · 0.65
IncMethod · 0.65
ReadVersionedMethod · 0.65
CloseMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected