Package dev.braintrust.config
Class BraintrustConfig
java.lang.Object
dev.braintrust.config.BraintrustConfig
Configuration for Braintrust SDK with sane defaults.
Most SDK users will want to use envars to configure all Braintrust settings.
However, it's also possible to override any envar during config construction.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionapiKey()apiUrl()appUrl()static BraintrustConfig.Builderbuilder()protected booleanprotected <T> Tbooleandebug()booleanbooleanbooleanbooleanSetting for unit testing.Deprecated.static BraintrustConfigThe parent attribute tells braintrust where to send otel data
The otel ingestion endpoint looks for (a) braintrust.parent = project_id|project_name|experiment_id:value otel attribute and routes accordingly
(b) if a span has no parent marked explicitly, it will look to see if there's an x-bt-parent http header (with the same format marked above e.g.protected <T> Tprotected <T> Tprotected StringgetEnvValue(String settingName) protected StringgetRequiredConfig(String settingName) protected <T> TgetRequiredConfig(String settingName, Class<T> settingClass) inthashCode()logsPath()static BraintrustConfig
-
Field Details
-
envOverrides
-
-
Method Details
-
fromEnvironment
-
of
-
getBraintrustParentValue
The parent attribute tells braintrust where to send otel data
The otel ingestion endpoint looks for (a) braintrust.parent = project_id|project_name|experiment_id:value otel attribute and routes accordingly
(b) if a span has no parent marked explicitly, it will look to see if there's an x-bt-parent http header (with the same format marked above e.g. project_name:andrew) that parent will apply to all spans in a request that don't have one
If neither (a) nor (b) exists, the data is dropped -
fetchProjectURI
Deprecated.Deprecated. Please useBraintrust.projectUri()instead -
builder
-
apiKey
-
apiUrl
-
appUrl
-
tracesPath
-
logsPath
-
defaultProjectId
-
defaultProjectName
-
enableTraceConsoleLog
public boolean enableTraceConsoleLog() -
debug
public boolean debug() -
experimentalOtelLogs
public boolean experimentalOtelLogs() -
requestTimeout
-
exportSpansInMemoryForUnitTest
public boolean exportSpansInMemoryForUnitTest()Setting for unit testing. Do not use in production. -
getConfig
-
getConfig
-
getRequiredConfig
-
getRequiredConfig
-
cast
-
getEnvValue
-
equals
-
canEqual
-
hashCode
public int hashCode()
-