Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions packages/traceloop-sdk/tests/test_fortifyroot_auth_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _auth_warnings(caplog):
return [
record
for record in caplog.records
if "FortifyRoot SDK auth warning" in record.getMessage()
if "FortifyRoot Ocelle SDK auth warning" in record.getMessage()
]


Expand Down Expand Up @@ -181,7 +181,7 @@ def Export(self, *args, **kwargs): # noqa: N802
with caplog.at_level("WARNING"), pytest.raises(_FakeAuthRpcError):
exporter._client.Export()

assert "FortifyRoot SDK auth warning" in caplog.text
assert "FortifyRoot Ocelle SDK auth warning" in caplog.text
assert signal in caplog.text
assert f"gRPC {code.name}" in caplog.text

Expand Down Expand Up @@ -211,7 +211,7 @@ def log_message(self, format, *args):
server.server_close()
thread.join(timeout=2)

assert "FortifyRoot SDK auth warning" in caplog.text
assert "FortifyRoot Ocelle SDK auth warning" in caplog.text
assert "traces" in caplog.text
assert "HTTP 401" in caplog.text

Expand Down Expand Up @@ -258,9 +258,10 @@ def test_auth_warning_log_is_not_reexported_through_otel_logging_handler(caplog)
assert provider is not None
provider.force_flush()

assert "FortifyRoot SDK auth warning" in caplog.text
assert "FortifyRoot Ocelle SDK auth warning" in caplog.text
assert not any(
"FortifyRoot SDK auth warning" in body for body in log_exporter.bodies
"FortifyRoot Ocelle SDK auth warning" in body
for body in log_exporter.bodies
)
finally:
for handler in list(root_logger.handlers):
Expand Down
2 changes: 1 addition & 1 deletion packages/traceloop-sdk/traceloop/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def get():
"""
if not Traceloop.__client:
raise Exception(
"Client not initialized, you should call fortifyroot.init() first. "
"Client not initialized, you should call fortifyroot.ocelle.init() first. "
"If you are still getting this error - you are missing the api key"
)
return Traceloop.__client
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _warn_once(signal: str, status: str, endpoint: Any) -> None:
_WARNED_AUTH_FAILURES[key] = now

logger.warning(
"FortifyRoot SDK auth warning: %s export was rejected by the configured OTLP endpoint (%s) with %s. "
"FortifyRoot Ocelle SDK auth warning: %s export was rejected by the configured OTLP endpoint (%s) with %s. "
"If this endpoint is FortifyRoot, the SDK API key may be invalid, revoked, deleted, or missing permissions. "
"Telemetry will not reach the OTLP endpoint until a valid credential is configured.",
signal,
Expand Down
7 changes: 4 additions & 3 deletions packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def verify_initialized(cls) -> bool:

print(
Fore.RED
+ "Warning: FortifyRoot not initialized, make sure you call fortifyroot.init()"
+ "Warning: FortifyRoot Ocelle not initialized, make sure you call fortifyroot.ocelle.init()"
)
print(Fore.RESET)
return False
Expand Down Expand Up @@ -627,8 +627,9 @@ def init_instrumentations(
print(Fore.RED + f"Warning: {instrument} instrumentation does not exist.")
print(
"Usage:\n"
"from fortifyroot import Instruments\n"
"fortifyroot.init(app_name='...', instruments=set([Instruments.OPENAI]))"
"from fortifyroot.ocelle import Instruments\n"
"import fortifyroot.ocelle as ocelle\n"
"ocelle.init(app_name='...', instruments=set([Instruments.OPENAI]))"
)
print(Fore.RESET)

Expand Down
Loading