Skip to content

Commit

Permalink
[PERF] Trace auth requests (#2589)
Browse files Browse the repository at this point in the history
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- This traces calls to the auth system in the server so that we can
measure its latency in a span
 - New functionality
	 - None

## Test plan
*How are these changes tested?*
Manually verified in jaeger
![Screenshot 2024-07-29 at 1 02 06
PM](https://github.com/user-attachments/assets/262f9db8-6917-45f1-a026-1e72a34ad6e1)

- [ ] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
repository](https://github.com/chroma-core/docs)?*
  • Loading branch information
HammadB authored Jul 29, 2024
1 parent 4f68c60 commit 48da264
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chromadb/server/fastapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ async def heartbeat(self) -> Dict[str, int]:
async def version(self) -> str:
return self._api.get_version()

@trace_method(
"auth_and_get_tenant_and_database_for_request",
OpenTelemetryGranularity.OPERATION,
)
def auth_and_get_tenant_and_database_for_request(
self,
headers: Headers,
Expand Down

0 comments on commit 48da264

Please sign in to comment.