MCPcopy Create free account
hub / github.com/algolia/cli / GetTelemetryClient

Function GetTelemetryClient

pkg/telemetry/telemetry.go:176–182  ·  view source on GitHub ↗

GetTelemetryClient returns the CLIAnalyticsEventMetadata from the provided context

(ctx context.Context)

Source from the content-addressed store, hash-verified

174
175// GetTelemetryClient returns the CLIAnalyticsEventMetadata from the provided context
176func GetTelemetryClient(ctx context.Context) TelemetryClient {
177 client := ctx.Value(telemetryClientKey{})
178 if client != nil {
179 return client.(TelemetryClient)
180 }
181 return nil
182}
183
184// SetCobraCommandContext sets the telemetry values for the command being executed.
185func (e *CLIAnalyticsEventMetadata) SetCobraCommandContext(cmd *cobra.Command) {

Callers 7

ExecuteFunction · 0.92
trackCommandCompletedFunction · 0.92
closeTelemetryFunction · 0.92
TrackEventFunction · 0.85

Calls

no outgoing calls

Tested by 1