Skip to content

Commit ba62e8b

Browse files
committed
Add integration field to StartSpanConfig and related functions
1 parent 4def1e6 commit ba62e8b

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

internal/llmobs/llmobs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ func (l *LLMObs) StartSpan(ctx context.Context, kind SpanKind, name string, cfg
688688
span.mlApp = cfg.MLApp
689689
span.spanKind = kind
690690
span.sessionID = cfg.SessionID
691+
span.integration = cfg.Integration
691692

692693
span.llmCtx = llmobsContext{
693694
modelName: cfg.ModelName,

internal/llmobs/span.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ type StartSpanConfig struct {
3030
MLApp string
3131
// StartTime sets a custom start time for the span. If zero, uses current time.
3232
StartTime time.Time
33+
// Name of the tracing integration.
34+
Integration string
3335
}
3436

3537
// FinishSpanConfig contains configuration options for finishing an LLMObs span.

llmobs/option.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ func WithModelName(modelName string) StartSpanOption {
6868
}
6969
}
7070

71+
func WithIntegration(integration string) StartSpanOption {
72+
return func(c *illmobs.StartSpanConfig) {
73+
c.Integration = integration
74+
}
75+
}
76+
7177
// ------------- Finish options -------------
7278

7379
// FinishSpanOption configures span finishing. Use with span.Finish().

0 commit comments

Comments
 (0)