(ctx context.Context)
| 97 | } |
| 98 | |
| 99 | func (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 | |
| 124 | func (fn *ModuleFunction) cacheImplicitInputs() []dagql.ImplicitInput { |
| 125 | if fn == nil || fn.mod.Self() == nil || fn.metadata == nil { |
no test coverage detected