|
|
|
@ -79,3 +79,16 @@ func newSqliteExporter(cfg *Config) (*sqliteExporter, error) {
|
|
|
|
|
func NewSqliteSDKTraceExporter(cfg *Config) (sdktrace.SpanExporter, error) {
|
|
|
|
|
return newSqliteExporter(cfg)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewSqliteSDKTraceExporterWithDB(db *sql.DB) (sdktrace.SpanExporter, error) {
|
|
|
|
|
tx, _ := db.Begin()
|
|
|
|
|
defer tx.Commit()
|
|
|
|
|
|
|
|
|
|
if _, err := tx.Exec(initScript); err != nil {
|
|
|
|
|
return nil, fmt.Errorf("failed to run migrations: %w", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &sqliteExporter{
|
|
|
|
|
db: db,
|
|
|
|
|
}, nil
|
|
|
|
|
}
|
|
|
|
|