ko and pt-br for tracing missing links

This commit is contained in:
Lorenze Jay
2025-11-30 16:39:20 -08:00
parent 083246aebf
commit 200784cf19
3 changed files with 428 additions and 0 deletions

View File

@@ -703,6 +703,7 @@
{
"group": "Observabilidade",
"pages": [
"pt-BR/observability/tracing",
"pt-BR/observability/overview",
"pt-BR/observability/arize-phoenix",
"pt-BR/observability/braintrust",
@@ -1140,6 +1141,7 @@
{
"group": "Observability",
"pages": [
"ko/observability/tracing",
"ko/observability/overview",
"ko/observability/arize-phoenix",
"ko/observability/braintrust",

View File

@@ -0,0 +1,213 @@
---
title: CrewAI Tracing
description: CrewAI AOP 플랫폼을 사용한 CrewAI Crews 및 Flows의 내장 추적
icon: magnifying-glass-chart
mode: "wide"
---
# CrewAI 내장 추적 (Built-in Tracing)
CrewAI는 Crews와 Flows를 실시간으로 모니터링하고 디버깅할 수 있는 내장 추적 기능을 제공합니다. 이 가이드는 CrewAI의 통합 관측 가능성 플랫폼을 사용하여 **Crews**와 **Flows** 모두에 대한 추적을 활성화하는 방법을 보여줍니다.
> **CrewAI Tracing이란?** CrewAI의 내장 추적은 agent 결정, 작업 실행 타임라인, 도구 사용, LLM 호출을 포함한 AI agent에 대한 포괄적인 관측 가능성을 제공하며, 모두 [CrewAI AOP 플랫폼](https://app.crewai.com)을 통해 액세스할 수 있습니다.
![CrewAI Tracing Interface](/images/crewai-tracing.png)
## 사전 요구 사항
CrewAI 추적을 사용하기 전에 다음이 필요합니다:
1. **CrewAI AOP 계정**: [app.crewai.com](https://app.crewai.com)에서 무료 계정에 가입하세요
2. **CLI 인증**: CrewAI CLI를 사용하여 로컬 환경을 인증하세요
```bash
crewai login
```
## 설정 지침
### 1단계: CrewAI AOP 계정 생성
[app.crewai.com](https://app.crewai.com)을 방문하여 무료 계정을 만드세요. 이를 통해 추적, 메트릭을 보고 crews를 관리할 수 있는 CrewAI AOP 플랫폼에 액세스할 수 있습니다.
### 2단계: CrewAI CLI 설치 및 인증
아직 설치하지 않았다면 CLI 도구와 함께 CrewAI를 설치하세요:
```bash
uv add crewai[tools]
```
그런 다음 CrewAI AOP 계정으로 CLI를 인증하세요:
```bash
crewai login
```
이 명령은 다음을 수행합니다:
1. 브라우저에서 인증 페이지를 엽니다
2. 장치 코드를 입력하라는 메시지를 표시합니다
3. CrewAI AOP 계정으로 로컬 환경을 인증합니다
4. 로컬 개발을 위한 추적 기능을 활성화합니다
### 3단계: Crew에서 추적 활성화
`tracing` 매개변수를 `True`로 설정하여 Crew에 대한 추적을 활성화할 수 있습니다:
```python
from crewai import Agent, Crew, Process, Task
from crewai_tools import SerperDevTool
# Define your agents
researcher = Agent(
role="Senior Research Analyst",
goal="Uncover cutting-edge developments in AI and data science",
backstory=\"\"\"You work at a leading tech think tank.
Your expertise lies in identifying emerging trends.
You have a knack for dissecting complex data and presenting actionable insights.\"\"\",
verbose=True,
tools=[SerperDevTool()],
)
writer = Agent(
role="Tech Content Strategist",
goal="Craft compelling content on tech advancements",
backstory=\"\"\"You are a renowned Content Strategist, known for your insightful and engaging articles.
You transform complex concepts into compelling narratives.\"\"\",
verbose=True,
)
# Create tasks for your agents
research_task = Task(
description=\"\"\"Conduct a comprehensive analysis of the latest advancements in AI in 2024.
Identify key trends, breakthrough technologies, and potential industry impacts.\"\"\",
expected_output="Full analysis report in bullet points",
agent=researcher,
)
writing_task = Task(
description=\"\"\"Using the insights provided, develop an engaging blog
post that highlights the most significant AI advancements.
Your post should be informative yet accessible, catering to a tech-savvy audience.\"\"\",
expected_output="Full blog post of at least 4 paragraphs",
agent=writer,
)
# Enable tracing in your crew
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, writing_task],
process=Process.sequential,
tracing=True, # Enable built-in tracing
verbose=True
)
# Execute your crew
result = crew.kickoff()
```
### 4단계: Flow에서 추적 활성화
마찬가지로 CrewAI Flows에 대한 추적을 활성화할 수 있습니다:
```python
from crewai.flow.flow import Flow, listen, start
from pydantic import BaseModel
class ExampleState(BaseModel):
counter: int = 0
message: str = ""
class ExampleFlow(Flow[ExampleState]):
def __init__(self):
super().__init__(tracing=True) # Enable tracing for the flow
@start()
def first_method(self):
print("Starting the flow")
self.state.counter = 1
self.state.message = "Flow started"
return "continue"
@listen("continue")
def second_method(self):
print("Continuing the flow")
self.state.counter += 1
self.state.message = "Flow continued"
return "finish"
@listen("finish")
def final_method(self):
print("Finishing the flow")
self.state.counter += 1
self.state.message = "Flow completed"
# Create and run the flow with tracing enabled
flow = ExampleFlow(tracing=True)
result = flow.kickoff()
```
### 5단계: CrewAI AOP 대시보드에서 추적 보기
crew 또는 flow를 실행한 후 CrewAI AOP 대시보드에서 CrewAI 애플리케이션이 생성한 추적을 볼 수 있습니다. agent 상호 작용, 도구 사용 및 LLM 호출의 세부 단계를 볼 수 있습니다.
아래 링크를 클릭하여 추적을 보거나 대시보드의 추적 탭으로 이동하세요 [여기](https://app.crewai.com/crewai_plus/trace_batches)
![CrewAI Tracing Interface](/images/view-traces.png)
### 대안: 환경 변수 구성
환경 변수를 설정하여 전역적으로 추적을 활성화할 수도 있습니다:
```bash
export CREWAI_TRACING_ENABLED=true
```
또는 `.env` 파일에 추가하세요:
```env
CREWAI_TRACING_ENABLED=true
```
이 환경 변수가 설정되면 `tracing=True`를 명시적으로 설정하지 않아도 모든 Crews와 Flows에 자동으로 추적이 활성화됩니다.
## 추적 보기
### CrewAI AOP 대시보드 액세스
1. [app.crewai.com](https://app.crewai.com)을 방문하여 계정에 로그인하세요
2. 프로젝트 대시보드로 이동하세요
3. **Traces** 탭을 클릭하여 실행 세부 정보를 확인하세요
### 추적에서 볼 수 있는 내용
CrewAI 추적은 다음에 대한 포괄적인 가시성을 제공합니다:
- **Agent 결정**: agent가 작업을 통해 어떻게 추론하고 결정을 내리는지 확인하세요
- **작업 실행 타임라인**: 작업 시퀀스 및 종속성의 시각적 표현
- **도구 사용**: 어떤 도구가 호출되고 그 결과를 모니터링하세요
- **LLM 호출**: 프롬프트 및 응답을 포함한 모든 언어 모델 상호 작용을 추적하세요
- **성능 메트릭**: 실행 시간, 토큰 사용량 및 비용
- **오류 추적**: 세부 오류 정보 및 스택 추적
### 추적 기능
- **실행 타임라인**: 실행의 다양한 단계를 클릭하여 확인하세요
- **세부 로그**: 디버깅을 위한 포괄적인 로그에 액세스하세요
- **성능 분석**: 실행 패턴을 분석하고 성능을 최적화하세요
- **내보내기 기능**: 추가 분석을 위해 추적을 다운로드하세요
### 인증 문제
인증 문제가 발생하는 경우:
1. 로그인되어 있는지 확인하세요: `crewai login`
2. 인터넷 연결을 확인하세요
3. [app.crewai.com](https://app.crewai.com)에서 계정을 확인하세요
### 추적이 나타나지 않음
대시보드에 추적이 표시되지 않는 경우:
1. Crew/Flow에서 `tracing=True`가 설정되어 있는지 확인하세요
2. 환경 변수를 사용하는 경우 `CREWAI_TRACING_ENABLED=true`인지 확인하세요
3. `crewai login`으로 인증되었는지 확인하세요
4. crew/flow가 실제로 실행되고 있는지 확인하세요

View File

@@ -0,0 +1,213 @@
---
title: CrewAI Tracing
description: Rastreamento integrado para Crews e Flows do CrewAI com a plataforma CrewAI AOP
icon: magnifying-glass-chart
mode: "wide"
---
# Rastreamento Integrado do CrewAI
O CrewAI fornece recursos de rastreamento integrados que permitem monitorar e depurar seus Crews e Flows em tempo real. Este guia demonstra como habilitar o rastreamento para **Crews** e **Flows** usando a plataforma de observabilidade integrada do CrewAI.
> **O que é o CrewAI Tracing?** O rastreamento integrado do CrewAI fornece observabilidade abrangente para seus agentes de IA, incluindo decisões de agentes, cronogramas de execução de tarefas, uso de ferramentas e chamadas de LLM - tudo acessível através da [plataforma CrewAI AOP](https://app.crewai.com).
![CrewAI Tracing Interface](/images/crewai-tracing.png)
## Pré-requisitos
Antes de usar o rastreamento do CrewAI, você precisa:
1. **Conta CrewAI AOP**: Cadastre-se para uma conta gratuita em [app.crewai.com](https://app.crewai.com)
2. **Autenticação CLI**: Use a CLI do CrewAI para autenticar seu ambiente local
```bash
crewai login
```
## Instruções de Configuração
### Passo 1: Crie sua Conta CrewAI AOP
Visite [app.crewai.com](https://app.crewai.com) e crie sua conta gratuita. Isso lhe dará acesso à plataforma CrewAI AOP, onde você pode visualizar rastreamentos, métricas e gerenciar seus crews.
### Passo 2: Instale a CLI do CrewAI e Autentique
Se você ainda não o fez, instale o CrewAI com as ferramentas CLI:
```bash
uv add crewai[tools]
```
Em seguida, autentique sua CLI com sua conta CrewAI AOP:
```bash
crewai login
```
Este comando irá:
1. Abrir seu navegador na página de autenticação
2. Solicitar que você insira um código de dispositivo
3. Autenticar seu ambiente local com sua conta CrewAI AOP
4. Habilitar recursos de rastreamento para seu desenvolvimento local
### Passo 3: Habilite o Rastreamento em seu Crew
Você pode habilitar o rastreamento para seu Crew definindo o parâmetro `tracing` como `True`:
```python
from crewai import Agent, Crew, Process, Task
from crewai_tools import SerperDevTool
# Define your agents
researcher = Agent(
role="Senior Research Analyst",
goal="Uncover cutting-edge developments in AI and data science",
backstory=\"\"\"You work at a leading tech think tank.
Your expertise lies in identifying emerging trends.
You have a knack for dissecting complex data and presenting actionable insights.\"\"\",
verbose=True,
tools=[SerperDevTool()],
)
writer = Agent(
role="Tech Content Strategist",
goal="Craft compelling content on tech advancements",
backstory=\"\"\"You are a renowned Content Strategist, known for your insightful and engaging articles.
You transform complex concepts into compelling narratives.\"\"\",
verbose=True,
)
# Create tasks for your agents
research_task = Task(
description=\"\"\"Conduct a comprehensive analysis of the latest advancements in AI in 2024.
Identify key trends, breakthrough technologies, and potential industry impacts.\"\"\",
expected_output="Full analysis report in bullet points",
agent=researcher,
)
writing_task = Task(
description=\"\"\"Using the insights provided, develop an engaging blog
post that highlights the most significant AI advancements.
Your post should be informative yet accessible, catering to a tech-savvy audience.\"\"\",
expected_output="Full blog post of at least 4 paragraphs",
agent=writer,
)
# Enable tracing in your crew
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, writing_task],
process=Process.sequential,
tracing=True, # Enable built-in tracing
verbose=True
)
# Execute your crew
result = crew.kickoff()
```
### Passo 4: Habilite o Rastreamento em seu Flow
Da mesma forma, você pode habilitar o rastreamento para Flows do CrewAI:
```python
from crewai.flow.flow import Flow, listen, start
from pydantic import BaseModel
class ExampleState(BaseModel):
counter: int = 0
message: str = ""
class ExampleFlow(Flow[ExampleState]):
def __init__(self):
super().__init__(tracing=True) # Enable tracing for the flow
@start()
def first_method(self):
print("Starting the flow")
self.state.counter = 1
self.state.message = "Flow started"
return "continue"
@listen("continue")
def second_method(self):
print("Continuing the flow")
self.state.counter += 1
self.state.message = "Flow continued"
return "finish"
@listen("finish")
def final_method(self):
print("Finishing the flow")
self.state.counter += 1
self.state.message = "Flow completed"
# Create and run the flow with tracing enabled
flow = ExampleFlow(tracing=True)
result = flow.kickoff()
```
### Passo 5: Visualize os Rastreamentos no Painel CrewAI AOP
Após executar o crew ou flow, você pode visualizar os rastreamentos gerados pela sua aplicação CrewAI no painel CrewAI AOP. Você verá etapas detalhadas das interações dos agentes, usos de ferramentas e chamadas de LLM.
Basta clicar no link abaixo para visualizar os rastreamentos ou ir para a aba de rastreamentos no painel [aqui](https://app.crewai.com/crewai_plus/trace_batches)
![CrewAI Tracing Interface](/images/view-traces.png)
### Alternativa: Configuração de Variável de Ambiente
Você também pode habilitar o rastreamento globalmente definindo uma variável de ambiente:
```bash
export CREWAI_TRACING_ENABLED=true
```
Ou adicione-a ao seu arquivo `.env`:
```env
CREWAI_TRACING_ENABLED=true
```
Quando esta variável de ambiente estiver definida, todos os Crews e Flows terão automaticamente o rastreamento habilitado, mesmo sem definir explicitamente `tracing=True`.
## Visualizando seus Rastreamentos
### Acesse o Painel CrewAI AOP
1. Visite [app.crewai.com](https://app.crewai.com) e faça login em sua conta
2. Navegue até o painel do seu projeto
3. Clique na aba **Traces** para visualizar os detalhes de execução
### O que Você Verá nos Rastreamentos
O rastreamento do CrewAI fornece visibilidade abrangente sobre:
- **Decisões dos Agentes**: Veja como os agentes raciocinam através das tarefas e tomam decisões
- **Cronograma de Execução de Tarefas**: Representação visual de sequências e dependências de tarefas
- **Uso de Ferramentas**: Monitore quais ferramentas são chamadas e seus resultados
- **Chamadas de LLM**: Rastreie todas as interações do modelo de linguagem, incluindo prompts e respostas
- **Métricas de Desempenho**: Tempos de execução, uso de tokens e custos
- **Rastreamento de Erros**: Informações detalhadas de erros e rastreamentos de pilha
### Recursos de Rastreamento
- **Cronograma de Execução**: Clique através de diferentes estágios de execução
- **Logs Detalhados**: Acesse logs abrangentes para depuração
- **Análise de Desempenho**: Analise padrões de execução e otimize o desempenho
- **Capacidades de Exportação**: Baixe rastreamentos para análise adicional
### Problemas de Autenticação
Se você encontrar problemas de autenticação:
1. Certifique-se de estar logado: `crewai login`
2. Verifique sua conexão com a internet
3. Verifique sua conta em [app.crewai.com](https://app.crewai.com)
### Rastreamentos Não Aparecem
Se os rastreamentos não estiverem aparecendo no painel:
1. Confirme que `tracing=True` está definido em seu Crew/Flow
2. Verifique se `CREWAI_TRACING_ENABLED=true` se estiver usando variáveis de ambiente
3. Certifique-se de estar autenticado com `crewai login`
4. Verifique se seu crew/flow está realmente executando