-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: rename recorderTranslation to DRPCRecorder #29133
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,16 +228,20 @@ func (p *CachedBridgePool) Acquire(ctx context.Context, req Request, clientFn Cl | |
|
|
||
| span.AddEvent("cache_miss") | ||
| providerVersion := p.providerVersion.Load() | ||
| recorder := aibridge.NewRecorder(p.logger.Named("recorder"), p.tracer, func(clientCtx context.Context) (aibridge.Recorder, error) { | ||
| // The recorder outlives this Acquire call, so the client is acquired | ||
| // against the context of the record call being served. | ||
| client, err := clientFn(clientCtx) | ||
| if err != nil { | ||
| return nil, xerrors.Errorf("acquire client: %w", err) | ||
| } | ||
| recorder := aibridge.NewRecorder( | ||
| p.logger.Named("recorder"), | ||
| p.tracer, | ||
| func(clientCtx context.Context) (aibridge.Recorder, error) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (since parameters where cleaned up) very nit: I'd extract func to variable
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was considering it. will do something like it in a follow up. I still have questions about why we fetch a new client for every call. Once I understand that, I will make the necessary change here. |
||
| // The recorder outlives this Acquire call, so the client is acquired | ||
| // against the context of the record call being served. | ||
| client, err := clientFn(clientCtx) | ||
| if err != nil { | ||
| return nil, xerrors.Errorf("acquire client: %w", err) | ||
| } | ||
|
|
||
| return &recorderTranslation{apiKeyID: req.APIKeyID, client: client}, nil | ||
| }) | ||
| return &DRPCRecorder{apiKeyID: req.APIKeyID, client: client}, nil | ||
| }, | ||
| ) | ||
|
|
||
| // Slow path. | ||
| // Creating an *aibridge.RequestBridge may take some time, so gate all subsequent callers behind the initial request and return the resulting value. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect the interface used to be called RecorderClient and that the name drifted, leaving this comment out of date. This caused confusion for me, so I brought it back in line with the interface name.