Skip to contentমূল লেখায় যান

Topic 22 · AI/ML testingটপিক 22 · AI/ML testing

AI Observability and Production Monitoring

An eval suite tells you what the model does on the questions you thought to ask. Observability tells you what it did on the ones you did not.

5 min read5 মিনিটে পড়া যায় · 6 sections6টি সেকশন · 2 sources2টি সোর্স · updated Nov 2026আপডেট: Nov 2026

Trace, sample, score, alertট্রেস, স্যাম্পল, স্কোর, অ্যালার্ট

Watch traces flow in, a sample get scored, and an alert fire when the score drops.ট্রেস আসতে দেখুন, একটা স্যাম্পল স্কোর হতে দেখুন, আর স্কোর কমলে অ্যালার্ট বাজতে দেখুন।

2 min2 মিনিট7 steps7টি ধাপ
  • Tracesট্রেস1
traceট্রেসyour appআপনার অ্যাপPhoenixPhoenixLangFuseLangFusetrace · 1ট্রেস · 1EvalEvalmetricমেট্রিকAlertঅ্যালার্টoffবন্ধ

You’ll learnআপনি শিখবেন

  • What a trace, a span and a session areট্রেস, স্প্যান আর সেশন কী
  • The loop: collect, sample, eval, alertলুপ: সংগ্রহ, স্যাম্পল, eval, অ্যালার্ট
  • Why a sample is enough to scoreস্কোর করতে কেন স্যাম্পলই যথেষ্ট
  • Live traffic can fail where a test set passestest set পাস করলেও live traffic ব্যর্থ হতে পারে

In plain words

Observability is the practice of instrumenting a live system so that every call, its input, its output, and its timing, is recorded and queryable after the fact. For an AI application it answers a question an eval suite cannot: what is the model actually being asked in production, and how is it actually answering, on traffic nobody wrote a test case for.

Arize Phoenix is an open-source AI observability and evaluation tool: it collects traces from an app and scores outputs with evaluations to find failures and regressions Source 1সোর্স 1. LangFuse does a similar job with its own focus on tracing and prompt management Source 2সোর্স 2. In this tutorial's view, you can run both together or swap one for the other, depending on the stack.

This page is the introduction: what a trace is, why it matters, and the first setup. The deeper version — specific alert thresholds, drift detection, and A/B comparison in production — is in the Phase 2 module on production observability, once the tools and the agent/RAG concepts that feed it are in place.

সহজ English

Observability means recording every call in a live system. You record the input, the output, and the timing. Later, you can search those records.

For an AI app, this answers something an eval suite cannot. What is the model really being asked in production? How does it really answer? This includes traffic nobody wrote a test case for.

Arize Phoenix is an open-source AI observability and evaluation tool. It collects traces from an app. It scores outputs with evaluations to find failures and regressions Source 1সোর্স 1. LangFuse does a similar job. It focuses on tracing and prompt management Source 2সোর্স 2. In this tutorial's view, you can run both together or swap one for the other, depending on your stack.

This page is only the introduction. It covers what a trace is, why it matters, and the first setup. Alert thresholds, drift detection, and A/B comparison in production come later. They are in the Phase 2 module on production observability.

বাংলা ব্যাখ্যা

Observability হলো একটা live সিস্টেমকে এমনভাবে instrument করার practice যাতে প্রতিটা call, তার input, output, আর timing, রেকর্ড হয় আর পরে query করা যায়। একটা AI application-এর জন্য এটা এমন একটা প্রশ্নের উত্তর দেয় যা eval suite দিতে পারে না: production-এ model-কে আসলে কী জিজ্ঞেস করা হচ্ছে, আর এটা আসলে কীভাবে উত্তর দিচ্ছে, এমন traffic-এ যার জন্য কেউ test case লেখেনি।

Arize Phoenix একটা open-source AI observability আর evaluation টুল: এটা একটা app থেকে trace সংগ্রহ করে আর evaluation দিয়ে output স্কোর করে failure আর regression খুঁজে পেতে Source 1সোর্স 1। LangFuse একই ধরনের কাজ করে নিজের tracing আর prompt management-এ focus দিয়ে Source 2সোর্স 2। এই টিউটোরিয়ালের নিজস্ব মত: স্ট্যাক অনুযায়ী দুটোই একসাথে চালানো যায় বা একটার বদলে আরেকটা ব্যবহার করা যায়।

এই পেজটা ভূমিকা: trace কী, এটা কেন গুরুত্বপূর্ণ, আর প্রথম setup। গভীর সংস্করণ — নির্দিষ্ট alert threshold, drift detection, আর production-এ A/B তুলনা — Phase 2-এর production observability মডিউলে, একবার যে টুল আর agent/RAG ধারণা এটাকে খাওয়ায় সেগুলো জায়গায় থাকলে।

How it works

A trace is the record of one call to the model, captured at the point the call happens:

trace    one record: input, output, latency, token counts, model, timestamp
span     a sub-step inside a trace, e.g. one retrieval call within a RAG answer
session  a group of traces belonging to one conversation

Both Phoenix Source 1সোর্স 1 and LangFuse Source 2সোর্স 2 instrument an application by wrapping the calls it already makes, so adopting one does not mean rewriting the application: it means adding a decorator or a context manager around the existing model and retriever calls.

Once traces are flowing, the basic loop an observability setup supports is:

collect traces -> sample a subset -> run an eval metric on the sample -> alert if it degrades

This is the same DeepEval- and Ragas-style metrics from the eval modules, run on live traffic instead of a fixed test set — the mechanism does not change, only the data source does.

সহজ English

A trace is the record of one call to the model. It is captured at the moment the call happens:

trace    one record: input, output, latency, token counts, model, timestamp
span     a sub-step inside a trace, e.g. one retrieval call within a RAG answer
session  a group of traces belonging to one conversation

Phoenix and LangFuse both work by wrapping the calls your app already makes Source 1সোর্স 1 Source 2সোর্স 2. You do not rewrite the app. You add a decorator or a context manager around the existing model and retriever calls.

Once traces flow in, the basic loop looks like this:

collect traces -> sample a subset -> run an eval metric on the sample -> alert if it degrades

These are the same DeepEval- and Ragas-style metrics from the eval modules. The only change is the data. They run on live traffic, not a fixed test set.

বাংলা ব্যাখ্যা

একটা trace হলো model-এ একটা call-এর রেকর্ড, call ঘটার মুহূর্তে ধরা:

trace    one record: input, output, latency, token counts, model, timestamp
span     a sub-step inside a trace, e.g. one retrieval call within a RAG answer
session  a group of traces belonging to one conversation

Phoenix Source 1সোর্স 1 আর LangFuse Source 2সোর্স 2 দুটোই একটা application-কে instrument করে যা সে ইতিমধ্যে করা call-গুলো মুড়ে, তাই একটা গ্রহণ করা মানে application আবার লেখা নয়: এটা মানে বিদ্যমান model আর retriever call-এর চারপাশে একটা decorator বা context manager যোগ করা।

একবার trace প্রবাহিত হলে, একটা observability setup যে মূল loop সমর্থন করে:

collect traces -> sample a subset -> run an eval metric on the sample -> alert if it degrades

এটা eval মডিউলের সেই একই DeepEval- আর Ragas-স্টাইল metric, একটা নির্দিষ্ট test set-এর বদলে live traffic-এ চালানো — mechanism বদলায় না, শুধু data source বদলায়।

In practice

A minimal Phoenix setup that traces an existing OpenAI-style call Source 1সোর্স 1:

from openinference.instrumentation.openai import OpenAIInstrumentor
from phoenix.otel import register

# run `phoenix serve` (or `uvx arize-phoenix serve`) in another terminal first; UI at http://localhost:6006
tracer_provider = register(project_name="my-app")
OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)  # traces every OpenAI call from here on

# existing application code, unmodified
answer = client.chat.completions.create(model="gpt-6-luna", messages=messages)

Every call now shows up in the Phoenix UI with its input, output, latency, and token counts, with no change to answer_question() itself.

A minimal LangFuse setup, decorating the same kind of call Source 2সোর্স 2:

from langfuse import observe

@observe()
def answer_question(question: str) -> str:
    return client.chat.completions.create(
        model="gpt-6-luna",
        messages=[{"role": "user", "content": question}],
    ).choices[0].message.content

Both approaches collect the same shape of data. Choosing between them is usually about which one's UI, pricing, or self-hosting story fits the team, not about a difference in what gets captured.

Tutorial advice

This advice is the tutorial's own. It does not come from the sources.

  • Turn on tracing before the first production user, not after the first incident. A trace you did not capture cannot be reviewed later.
  • Tag every trace with the prompt version and model, the same discipline as the quality dashboard.
  • Start by just looking at a sample of real traces by hand, before building any alert. The surprises in real traffic inform what is worth alerting on.

সহজ English

Here is a minimal Phoenix setup. It traces an existing OpenAI-style call Source 1সোর্স 1:

from openinference.instrumentation.openai import OpenAIInstrumentor
from phoenix.otel import register

# run `phoenix serve` (or `uvx arize-phoenix serve`) in another terminal first; UI at http://localhost:6006
tracer_provider = register(project_name="my-app")
OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)  # traces every OpenAI call from here on

# existing application code, unmodified
answer = client.chat.completions.create(model="gpt-6-luna", messages=messages)

Now every call shows up in the Phoenix UI. You see its input, output, latency, and token counts. answer_question() itself does not change.

Here is a minimal LangFuse setup. It decorates the same kind of call Source 2সোর্স 2:

from langfuse import observe

@observe()
def answer_question(question: str) -> str:
    return client.chat.completions.create(
        model="gpt-6-luna",
        messages=[{"role": "user", "content": question}],
    ).choices[0].message.content

Both ways collect the same kind of data. Pick by what fits your team: the UI, the pricing, or self-hosting. What gets captured is not the difference.

This advice is the tutorial's own. It does not come from the sources.

  • Turn on tracing before the first production user, not after the first incident. You cannot review a trace you did not capture.
  • Tag every trace with the prompt version and the model. This is the same habit as the quality dashboard.
  • Start by reading a sample of real traces by hand. Do this before building any alert. Surprises in real traffic show you what is worth alerting on.

বাংলা ব্যাখ্যা

একটা বিদ্যমান OpenAI-স্টাইল call trace করা একটা ন্যূনতম Phoenix setup Source 1সোর্স 1:

from openinference.instrumentation.openai import OpenAIInstrumentor
from phoenix.otel import register

# run `phoenix serve` (or `uvx arize-phoenix serve`) in another terminal first; UI at http://localhost:6006
tracer_provider = register(project_name="my-app")
OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)  # traces every OpenAI call from here on

# existing application code, unmodified
answer = client.chat.completions.create(model="gpt-6-luna", messages=messages)

প্রতিটা call এখন Phoenix UI-তে তার input, output, latency, আর token count সহ দেখা যায়, answer_question()-এ কোনো পরিবর্তন ছাড়াই।

একই ধরনের call decorate করা একটা ন্যূনতম LangFuse setup Source 2সোর্স 2:

from langfuse import observe

@observe()
def answer_question(question: str) -> str:
    return client.chat.completions.create(
        model="gpt-6-luna",
        messages=[{"role": "user", "content": question}],
    ).choices[0].message.content

দুটো পদ্ধতিই একই আকারের data সংগ্রহ করে। এদের মধ্যে বেছে নেওয়া সাধারণত নির্ভর করে কারটার UI, pricing, বা self-hosting গল্প দলের সাথে মানানসই তার ওপর, কী ধরা পড়ে তার পার্থক্যের ওপর নয়।

Tutorial advice

এই পরামর্শ টিউটোরিয়ালের নিজস্ব। এটি সোর্স থেকে আসেনি।

  • প্রথম production ব্যবহারকারীর আগে tracing চালু করুন, প্রথম incident-এর পরে নয়। যে trace ধরা পড়েনি তা পরে review করা যায় না।
  • প্রতিটা trace-কে prompt version আর model দিয়ে ট্যাগ করুন, quality dashboard-এর একই শৃঙ্খলা।
  • কোনো alert বানানোর আগে শুধু হাতে কিছু real trace দেখা শুরু করুন। real traffic-এর বিস্ময়গুলো জানায় কী alert করার যোগ্য।

Common mistakes

Mistake 1: treating a clean eval run as proof production is fine. The eval suite only covers the inputs someone thought to write; production traffic always finds the rest.

Mistake 2: turning on tracing only after an incident. The traces from before the tool was installed do not exist to review.

Mistake 3: tracing without session grouping. A pile of individual calls with no conversation boundary cannot show a multi-turn failure.

Mistake 4: picking a tool before looking at either one's UI. Phoenix and LangFuse capture similar data but present it differently; try both on a small slice of real traffic before committing Source 1সোর্স 1 Source 2সোর্স 2.

Mistake 5: no link between a trace and the quality dashboard. A trace tool and a metrics dashboard that cannot be cross-referenced leave a tester unable to go from "the metric dropped" to "here is the specific call that caused it".

সহজ English

Mistake 1: thinking a clean eval run proves production is fine. The eval suite only covers inputs someone thought to write. Production traffic always finds the rest.

Mistake 2: turning on tracing only after an incident. Traces from before you installed the tool do not exist. You cannot review them.

Mistake 3: tracing without session grouping. A pile of single calls has no conversation boundaries. It cannot show a failure that happens over several turns.

Mistake 4: picking a tool before looking at either UI. Phoenix and LangFuse capture similar data but show it differently. Try both on a small slice of real traffic before you commit Source 1সোর্স 1 Source 2সোর্স 2.

Mistake 5: no link between a trace and the quality dashboard. Sometimes the trace tool and the metrics dashboard cannot be cross-checked. Then a tester cannot go from "the metric dropped" to "here is the call that caused it".

বাংলা ব্যাখ্যা

ভুল ১: পরিষ্কার eval run-কে production ঠিক আছে তার প্রমাণ ভাবা। eval suite শুধু সেই input কভার করে যা কেউ লেখার কথা ভেবেছিল; production traffic সবসময় বাকিটা খুঁজে পায়।

ভুল ২: শুধু একটা incident-এর পরে tracing চালু করা। টুল install হওয়ার আগের trace review করার জন্য থাকে না।

ভুল ৩: session grouping ছাড়া tracing। কথোপকথনের সীমানা ছাড়া পৃথক call-এর একটা স্তূপ একটা multi-turn ব্যর্থতা দেখাতে পারে না।

ভুল ৪: কারো UI না দেখে একটা টুল বেছে নেওয়া। Phoenix আর LangFuse একই রকম data ধরে কিন্তু আলাদাভাবে দেখায়; commit করার আগে real traffic-এর একটা ছোট অংশে দুটোই চেষ্টা করুন Source 1সোর্স 1 Source 2সোর্স 2।

ভুল ৫: trace আর quality dashboard-এর মধ্যে কোনো লিংক নেই। একটা trace টুল আর একটা metrics dashboard যা cross-reference করা যায় না, একজন টেস্টারকে "metric কমেছে" থেকে "এখানে নির্দিষ্ট call যা এটার কারণ"-এ যেতে অক্ষম রাখে।

What a tester can check

Tutorial advice

This advice is the tutorial's own. It does not come from the sources.

  • Confirm tracing is live before launch, with a real call visible in the tool's UI, not just the instrumentation code merged.
  • Confirm traces group into sessions, not just individual calls.
  • Spend time reading real traces by hand before writing any alert rule.
  • Confirm a trace can be found starting from a dashboard metric, and a dashboard metric can be explained starting from a trace.

সহজ English

Tutorial advice

This advice is the tutorial's own. It does not come from the sources.

  • Confirm tracing is live before launch, with a real call visible in the tool's UI, not just the instrumentation code merged.
  • Confirm traces group into sessions, not just individual calls.
  • Spend time reading real traces by hand before writing any alert rule.
  • Confirm a trace can be found starting from a dashboard metric, and a dashboard metric can be explained starting from a trace.

বাংলা ব্যাখ্যা

Tutorial advice

এই পরামর্শ টিউটোরিয়ালের নিজস্ব। এটি সোর্স থেকে আসেনি।

  • launch-এর আগে tracing live নিশ্চিত করুন, টুলের UI-তে একটা real call দৃশ্যমান সহ, শুধু instrumentation code merge হওয়া নয়।
  • trace session-এ গ্রুপ হয় তা নিশ্চিত করুন, শুধু পৃথক call নয়।
  • কোনো alert নিয়ম লেখার আগে হাতে real trace পড়ায় সময় দিন।
  • একটা dashboard metric থেকে শুরু করে একটা trace খুঁজে পাওয়া যায় তা নিশ্চিত করুন, আর একটা trace থেকে শুরু করে একটা dashboard metric ব্যাখ্যা করা যায় তাও।

Key words

WordWhat it means
ObservabilityInstrumenting a live system so every call can be reviewed after the fact
TraceThe record of one call: input, output, latency, token counts, model, timestamp
SpanA sub-step inside a trace, such as one retrieval call within a RAG answer
SessionA group of traces belonging to one conversation
Arize PhoenixAn open-source AI observability and evaluation tool that collects traces and scores outputs
LangFuseA tracing and prompt-management platform for LLM applications

Reels on this topicএই টপিকের রিলস

Short videos from other creators, picked for this topic. They are not part of this page's fact-checked text. Nothing loads from YouTube until you press Play.অন্য ক্রিয়েটরদের বানানো ছোট ভিডিও, এই টপিকের জন্য বাছাই করা। এগুলো এই পেজের ফ্যাক্ট-চেক করা লেখার অংশ নয়। চালান বাটন চাপার আগে YouTube থেকে কিছুই লোড হয় না।

  1. [1]
    Introduction

    Arize (Phoenix docs) · accessed 2026-11-01দেখা হয়েছে: 2026-11-01

  2. [2]
    Introduction

    Langfuse (docs) · accessed 2026-11-01দেখা হয়েছে: 2026-11-01