| 67 | } |
| 68 | |
| 69 | func (d dynamodbInstrumentation) Query(ctx context.Context, key dynamodbKey, isPrefix bool) (map[string]dynamodbItem, float64, error) { |
| 70 | var resp map[string]dynamodbItem |
| 71 | var totalCapacity float64 |
| 72 | err := instrument.CollectedRequest(ctx, "Query", d.ddbMetrics.dynamodbRequestDuration, errorCode, func(ctx context.Context) error { |
| 73 | var err error |
| 74 | resp, totalCapacity, err = d.kv.Query(ctx, key, isPrefix) |
| 75 | return err |
| 76 | }) |
| 77 | d.ddbMetrics.dynamodbUsageMetrics.WithLabelValues("Query").Add(totalCapacity) |
| 78 | return resp, totalCapacity, err |
| 79 | } |
| 80 | |
| 81 | func (d dynamodbInstrumentation) Delete(ctx context.Context, key dynamodbKey) error { |
| 82 | return instrument.CollectedRequest(ctx, "Delete", d.ddbMetrics.dynamodbRequestDuration, errorCode, func(ctx context.Context) error { |