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()CORS origins to allow when running remote eval devserverbooleanbooleanbooleanbooleanSetting 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 BraintrustConfigCustom SSL context for OTLP exporter.Custom X509 trust manager for OTLP exporter.
-
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
-
sslContext
Custom SSL context for OTLP exporter. Builder-only field, not backed by envars. -
x509TrustManager
Custom X509 trust manager for OTLP exporter. Builder-only field, not backed by envars. -
exportSpansInMemoryForUnitTest
public boolean exportSpansInMemoryForUnitTest()Setting for unit testing. Do not use in production. -
devserverCorsOriginWhitelistCsv
CORS origins to allow when running remote eval devserver -
getConfig
-
getConfig
-
getRequiredConfig
-
getRequiredConfig
-
cast
-
getEnvValue
-
equals
-
canEqual
-
hashCode
public int hashCode()
-