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.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionapiKey()apiUrl()appUrl()protected <T> Tbooleandebug()booleanbooleanbooleanSetting for unit testing.fetch all project info and IDs from the braintrust apistatic 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) 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
fetch all project info and IDs from the braintrust api -
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
-