api_host
parameter or implementing a custom exporter.
Langtrace.init
function takes an object with the following options:
Parameter | Type | Description | Default Value |
---|---|---|---|
api_key | str | Your Langtrace API key. Required for sending traces to Langtrace Cloud. | - |
api_host | [str ] | The custom endpoint to send traces to. | Langtrace Cloud |
batch | [bool ] | Whether to batch spans before sending. | true |
write_spans_to_console | [bool ] | To allow spans to be displayed on console. Note: If you enable this, spans wont be forwarded to remote endpoint. | false |
custom_remote_exporter | [Any ] | A custom exporter for remote traces. Optional. | - |
disable_instrumentations | [dict ] | Instrumentations that are to be disabled or enabled. Optional. | - |
disable_tracing_for_functions | [dict ] | Functions to exclude from tracing. Optional. | None |
service_name | [str ] | The name of the service for which traces are generated. Optional. | - |
disable_logging | [bool ] | Whether to disable logging within the SDK. | false |
instrumentations | [dict ] | [Typescript SDK only] This is a required option for next.js applications. | - |
disable_latest_version_check | [bool ] | [Typescript SDK only] Whether to disable the latest version check. | false |
api_key
option allows you to specify Langtrace project API key.
The precedence order for determining the API key is as follows:
x-api-key
specified in environment variable OTEL_EXPORTER_OTLP_TRACES_HEADERS
x-api-key
specified in environment variable OTEL_EXPORTER_OTLP_HEADERS
LANGTRACE_API_KEY
api_key
parameter in the Langtrace.init
functionapi_host
option allows you to specify a custom endpoint to send traces to. This is particularly useful when you want to send traces to a different endpoint than the default Langtrace Cloud.
If no custom endpoint is specified, traces will be sent to Langtrace Cloud by default.
The precedence order for determining the API host is as follows:
LANGTRACE_API_HOST
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
OTEL_EXPORTER_OTLP_ENDPOINT
api_host
parameter in the Langtrace.init
functionfalse
to see the spans as they are captured.true
, the spans will not be sent to the remote endpoint.api_host
, it can be done by passing a custom exporter to the custom_remote_exporter
parameter in the Langtrace.init
function.
The custom_remote_exporter
option will take precedence over the api_host
option.
custom_remote_exporter
with a custom url will cause majority of
the langtrace features (like evaluations, user feedback, etc.) to not work and
should only be used if Langtrace is being used only to capture and
send traces.disable_instrumentations
parameter in the Langtrace.init
function.
weaviate
and gemini
will be disabled.
weaviate
and gemini
will be traced.
For Python SDK, the vendor name can be found in the all_instrumentations
variable in the repo here.
For Typescript SDK, the vendor name can be found in the allInstrumentations
variable in the repo here.
For more details on the implementation, refer Disable Tracing For Specific Vendors.
For more details on the implementation, refer Disable Tracing For Functions.
service.name
in the trace as per the OpenTelemetry specification.
The precedence order for determining the service name is as follows:
OTEL_SERVICE_NAME
service_name
parameter in the Langtrace.init
function