Home / Blog / Cloud & DevOps
Monitoring LLM Apps: Tracing, Costs and Quality with Langfuse and LangSmith
By Softworth Solutions · · 4 min read · For readers in UAE, UK, India

In short: Monitoring LLM apps means capturing a trace of every step, the token cost of each call and a measure of answer quality for each request. Langfuse and LangSmith both do this well; Langfuse is open source and self-hostable, while LangSmith fits most naturally with LangChain and LangGraph.
Traditional monitoring tells you about latency and errors. But an LLM app can return a fast, error-free, completely wrong answer, and your dashboards will stay green. That's the gap LLM observability fills.
A typical RAG or agent request makes several calls: rewrite the question, search, rerank, call the model, maybe call a tool and the model again. When a user complains, you need to see which documents were retrieved and what each step produced. Without traces, debugging is guesswork.
What should every LLM trace capture?
At minimum, a trace ID per request with a nested span for each retrieval, model call and tool call. On each model call, record the model, input and output tokens, latency and cost. Add the prompt template version, retrieved document IDs, the user and tenant, and any thumbs up or down. That's enough to answer most why-did-it-do-that questions in minutes.
How do Langfuse and LangSmith compare?
| Aspect | Langfuse | LangSmith |
|---|---|---|
| Licence | Open source core | Commercial |
| Hosting | Managed cloud or self-host | Managed; self-host on enterprise plans |
| Best fit | Any framework, data residency needs | LangChain and LangGraph apps |
| Evaluation | Datasets, scores, LLM-as-judge | Datasets, experiments, annotation queues |
Honestly, both are capable. The instrumentation discipline matters more than the logo. A team that traces consistently and reviews traces weekly will get more from either tool than a team that installs one and never looks. If you want to keep your options open, instrument with OpenTelemetry so you can switch backends later.
An illustrative example
Consider a property services firm in Abu Dhabi running an Arabic and English tenant assistant. Costs double in a month and nobody knows why. Once traces are switched on, the answer is obvious within an hour: conversation history is never trimmed, so long chats resend thousands of tokens on every turn. Capping history and summarising older turns brings costs back down, and the firm adds a daily budget alert per feature so it never happens silently again.
That story is typical. Once costs sit inside your traces, break them down by feature, customer and model, and you'll usually find a few features or heavy users drive most of the bill. The usual culprits are untrimmed history, retrieval stuffing too many chunks into the prompt, agents looping through tool calls and expensive models doing simple classification. For the infrastructure side of the bill, see our cloud cost optimisation tactics.
How do you measure quality, not just cost?
Combine three signals. Offline evaluation runs a fixed set of real questions against every prompt or model change before release. Online evaluation scores a sample of live traces for groundedness, relevance and format. Human review has a domain expert check a weekly sample, starting with traces that got negative feedback. Calibrate any LLM-as-judge scorer against human ratings before you trust it; our guide to evaluating LLM applications explains how.

Where should trace data live in the UAE, UK and India?
Traces often contain personal data from prompts and retrieved documents, so treat your observability tool like any other data processor. In the UAE, check the federal PDPL and, if you operate in DIFC or ADGM, their own data protection regimes. UK teams work under UK GDPR, and Indian teams under the DPDP Act. Self-hosting Langfuse in your chosen region is a common answer to residency questions. Whatever you choose, mask sensitive fields before sending, set a retention period and restrict who can view raw traces.
Key facts
- Langfuse is an open-source LLM engineering platform that can be self-hosted or used as a managed cloud service. (Langfuse)
- LangSmith is LangChain's platform for tracing, evaluating and monitoring LLM applications, and works with or without the LangChain framework. (LangChain)
- The Dubai International Financial Centre has its own data protection law, separate from the UAE federal regime, overseen by the DIFC Commissioner of Data Protection. (DIFC)
Key takeaways
- Trace every step, with tokens, cost and prompt version.
- Pick Langfuse for self-hosting, LangSmith for deep LangChain integration.
- Set daily budget alerts per feature and tenant.
- Treat traces as personal data: mask, retain briefly, restrict access.
Softworth Solutions (SWS AI) builds tracing, cost dashboards and evaluation sets into the LLM applications we deliver from Coimbatore. If your app is live and you can't see what it's doing, we can help you instrument it.
Frequently asked questions
Do I need Langfuse or LangSmith if I already use Datadog or Azure Monitor?
General tools handle latency and errors well. Dedicated LLM tools are better at prompt-level debugging, evaluation datasets and quality scores. Many teams use both, linked by a shared trace ID.
Does tracing slow my application down?
Both SDKs send data asynchronously in batches, so user-facing impact is normally negligible. In serverless environments, make sure the SDK flushes before shutdown.
Can we keep traces inside the UAE?
Self-hosting an open-source tool such as Langfuse on UAE-region cloud infrastructure keeps traces in-country. Confirm your obligations under the PDPL or DIFC and ADGM rules with legal counsel.
Planning an AI or software project? Talk to our team for a free consultation and an honest estimate.
Previous: AI for HR and Recruitment: Screening, Assessments and Bias
Next: Fine-Tuning Small Language Models: When It Beats Bigger Models