Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Quick start

By the end of this page you have cetra running locally and a first trace in the UI.

Choose the first start settings. The CETRA_INIT_* variables create the admin account, an organization, a project and an API key, so there is no setup page and you know the key. Pick your own 32 letters or digits for the key.

Terminal window
docker run -d --name cetra \
-p 127.0.0.1:8080:8080 -p 127.0.0.1:4317:4317 -p 127.0.0.1:4318:4318 \
-v cetra-data:/data \
-e CETRA_PUBLIC_URL=http://localhost:8080 \
-e CETRA_INIT_ADMIN_EMAIL=you@example.com \
-e CETRA_INIT_ADMIN_PASSWORD=<YOUR_PASSWORD> \
-e CETRA_INIT_ORG=acme \
-e CETRA_INIT_PROJECT=demo \
-e CETRA_INIT_SECRET_KEY=sk-cetra-<32_LETTERS_OR_DIGITS> \
ghcr.io/cetra-ai/cetra:0.1.0

Open http://localhost:8080 and sign in with the admin email and password you chose.

Pick your language. Set CETRA_API_KEY to the secret key you chose in the first step.

Terminal window
pip install cetra-sdk
export CETRA_API_KEY=sk-cetra-<32_LETTERS_OR_DIGITS>
import cetra
cetra.init()
@cetra.observe(kind="tool", name="search_docs")
def search_docs(query: str, limit: int = 2) -> list[str]:
return ["doc-1", "doc-2"]
@cetra.observe(name="answer")
def answer(question: str) -> str:
docs = search_docs(question)
return f"It is in {docs[0]}."
answer("why?")
cetra.flush() # blocks until spans (and scores) are exported

In the UI, open the demo project and select Traces. The trace answer is in the list. Select it to see the search_docs span nested inside it, with its input and output.

A trace opened from the trace list: its span tree in the middle, and the root span's input and output on the right.
  • The API key starts with sk-cetra- and belongs to the project you are looking at.
  • The base URL and port are right. The SDKs send to http://localhost:8080 unless you set CETRA_BASE_URL.
  • Your process exited before the spans were sent. Call flush() (Python) or await flush() (TypeScript) before it ends.
  • CETRA_ENABLED is not set to false.
  • The cetra log names the reason when it refuses a request. Check the output of cetra serve or docker logs cetra.

For more causes and fixes, see Troubleshooting.

  • Run cetra: the other ways to run it, ports and where data lives.
  • Send OpenTelemetry: use plain OpenTelemetry instead of an SDK.
  • Sessions: group the traces of one conversation.
  • Traces: read a trace as a tree and a timeline.
  • Integrations: using a framework or a provider library? See how to connect it.