MCPcopy Index your code
hub / github.com/docker/docker-agent / FromContext

Function FromContext

pkg/telemetry/context.go:21–26  ·  view source on GitHub ↗

FromContext retrieves the telemetry client from context

(ctx context.Context)

Source from the content-addressed store, hash-verified

19
20// FromContext retrieves the telemetry client from context
21func FromContext(ctx context.Context) *Client {
22 if client, ok := ctx.Value(clientContextKey).(*Client); ok {
23 return client
24 }
25 return nil
26}
27
28func RecordError(ctx context.Context, err string) {
29 if client := FromContext(ctx); client != nil {

Callers 5

RecordErrorFunction · 0.85
RecordToolCallFunction · 0.85
RecordSessionEndFunction · 0.85
RecordSessionStartFunction · 0.85
RecordTokenUsageFunction · 0.85

Calls 1

ValueMethod · 0.65

Tested by

no test coverage detected