MCPcopy Index your code
hub / github.com/dagger/dagger / recordCall

Method recordCall

core/modfunc.go:99–122  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

97}
98
99func (fn *ModuleFunction) recordCall(ctx context.Context) {
100 mod := fn.mod.Self()
101 if fn.metadata.Name == "" {
102 return
103 }
104 props := map[string]string{
105 "target_function": fn.metadata.Name,
106 }
107 moduleAnalyticsProps(mod, "target_", props)
108 query, err := CurrentQuery(ctx)
109 if err != nil {
110 slog.Error("get current query for module call analytics", "err", err)
111 return
112 }
113 if caller, err := query.CurrentModule(ctx); err == nil {
114 props["caller_type"] = "module"
115 moduleAnalyticsProps(caller.Self(), "caller_", props)
116 } else if dagql.IsInternal(ctx) {
117 props["caller_type"] = "internal"
118 } else {
119 props["caller_type"] = "direct"
120 }
121 analytics.Ctx(ctx).Capture(ctx, "module_call", props)
122}
123
124func (fn *ModuleFunction) cacheImplicitInputs() []dagql.ImplicitInput {
125 if fn == nil || fn.mod.Self() == nil || fn.metadata == nil {

Callers 1

CallMethod · 0.95

Calls 8

ErrorFunction · 0.92
IsInternalFunction · 0.92
CtxFunction · 0.92
moduleAnalyticsPropsFunction · 0.85
CurrentQueryFunction · 0.85
SelfMethod · 0.80
CurrentModuleMethod · 0.65
CaptureMethod · 0.65

Tested by

no test coverage detected