Skip to content

Commit f45110f

Browse files
committed
update readme
1 parent 01dc2af commit f45110f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ langtrace.init(custom_remote_exporter=<your_exporter>, batch=<True or False>)
148148
| `api_host` | `Optional[str]` | `https://langtrace.ai/` | The API host for the remote exporter. |
149149
| `disable_instrumentations` | `Optional[DisableInstrumentations]` | `None` | You can pass an object to disable instrumentation for specific vendors ex: `{'only': ['openai']}` or `{'all_except': ['openai']}` |
150150

151+
### Error Reporting to Langtrace
152+
153+
By default all sdk errors are reported to langtrace via Sentry. This can be disabled by setting the following enviroment variable to `False` like so `LANGTRACE_ERROR_REPORTING=False`
154+
151155
### Additional Customization
152156

153157
- `@with_langtrace_root_span` - this decorator is designed to organize and relate different spans, in a hierarchical manner. When you're performing multiple operations that you want to monitor together as a unit, this function helps by establishing a "parent" (`LangtraceRootSpan` or whatever is passed to `name`) span. Then, any calls to the LLM APIs made within the given function (fn) will be considered "children" of this parent span. This setup is especially useful for tracking the performance or behavior of a group of operations collectively, rather than individually.
@@ -229,6 +233,7 @@ prompt = get_prompt_from_registry(<Registry ID>, options={"prompt_version": 1, "
229233
```
230234

231235
### Opt out of tracing prompt and completion data
236+
232237
By default, prompt and completion data are captured. If you would like to opt out of it, set the following env var,
233238

234239
`TRACE_PROMPT_COMPLETION_DATA=false`

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ dependencies = [
3030
'sqlalchemy',
3131
'fsspec>=2024.6.0',
3232
"transformers>=4.11.3",
33+
"sentry-sdk>=2.14.0",
3334
]
3435

3536
requires-python = ">=3.9"

src/langtrace_python_sdk/langtrace.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ def init(
166166
provider.add_span_processor(batch_processor_remote)
167167

168168
sys.stdout = sys.__stdout__
169-
if (
170-
os.environ.get("LANGTRACE_ERROR_REPORTING", "True") == "True"
171-
or os.environ.get("LANGTRACE_ERROR_REPORTING", "True") == "true"
172-
):
169+
if os.environ.get("LANGTRACE_ERROR_REPORTING", "True") == "True":
173170
sentry_sdk.init(
174171
dsn=SENTRY_DSN,
175172
traces_sample_rate=1.0,

0 commit comments

Comments
 (0)