{"slug": "crewai-observability-monitoring-with-opentelemetry", "title": "CrewAI Observability & Monitoring with OpenTelemetry", "summary": "SigNoz has released a guide for instrumenting CrewAI with OpenTelemetry to enable real-time observability into agent, model, and tool performance across AI workflows. The integration allows users to export traces, logs, and metrics to SigNoz for unified dashboards, alerting, and debugging of failed tasks, slow agents, and LLM usage patterns. The setup involves installing OpenTelemetry and OpenInference packages, configuring automatic instrumentation, and running example code with CrewAI agents and tasks.", "body_md": "What is CrewAI Observability?\n\nCrewAI observability gives you real-time visibility into agent, model, and tool performance across your AI workflows. This guide walks you through instrumenting CrewAI with [OpenTelemetry](https://opentelemetry.io/) and exporting traces, logs, and metrics to SigNoz, so you can track latency, error rates, and usage trends in your CrewAI applications.\n\nWith full CrewAI observability in SigNoz, you can correlate traces, logs, and metrics in unified dashboards, configure alerts, and gain actionable insights to improve reliability and responsiveness. CrewAI monitoring across your AI workflows makes it straightforward to debug failed tasks, identify slow agents, and understand LLM usage patterns.\n\nPrerequisites\n\n- SigNoz setup (choose one):\n[SigNoz Cloud account](https://signoz.io/teams/)with an active ingestion key- Self-hosted SigNoz instance\n\n- Internet access to send telemetry data to SigNoz Cloud\n- CrewAI integrated into your app\n- Basic understanding of AI Agents and tool calling workflow\n- For Python:\n`pip`\n\ninstalled for managing Python packages and*(optional but recommended)*a Python virtual environment to isolate dependencies\n\nCrewAI Monitoring with OpenTelemetry\n\nNo-code auto-instrumentation is recommended for quick setup with minimal code changes. It's ideal when you want to get observability up and running without modifying your application code and are leveraging standard instrumentor libraries.\n\n**Step 1:** Install the necessary packages in your Python environment.\n\n```\npip install \\\n  opentelemetry-distro \\\n  opentelemetry-exporter-otlp \\\n  opentelemetry-instrumentation-httpx \\\n  opentelemetry-instrumentation-system-metrics \\\n  openinference-instrumentation-crewai \\\n  openinference-instrumentation-openai \\\n  crewai \\\n  crewai-tools\n```\n\n**Step 2:** Add Automatic Instrumentation\n\n```\nopentelemetry-bootstrap --action=install\n```\n\n**Step 3:** Configure logging level\n\nTo ensure logs are properly captured and exported, configure the root logger to emit logs at the INFO level or higher:\n\n``` python\nimport logging\nlogging.getLogger().setLevel(logging.INFO)\n```\n\nThis sets the minimum log level for the root logger to INFO, which ensures that `logger.info()`\n\ncalls and higher severity logs (WARNING, ERROR, CRITICAL) are captured by the OpenTelemetry logging auto-instrumentation and sent to SigNoz.\n\n**Step 4:** Run an example\n\n``` python\nimport os\nfrom crewai import Agent, Task, Crew, Process\nfrom crewai_tools import SerperDevTool\n\nsearch_tool = SerperDevTool()\n\n# Define your agents with roles and goals\nresearcher = Agent(\n  role='Senior Research Analyst',\n  goal='Uncover cutting-edge developments in AI and data science',\n  backstory=\"\"\"You work at a leading tech think tank.\n  Your expertise lies in identifying emerging trends.\n  You have a knack for dissecting complex data and presenting actionable insights.\"\"\",\n  verbose=True,\n  allow_delegation=False,\n  # You can pass an optional llm attribute specifying what model you wanna use.\n  # llm=ChatOpenAI(model_name=\"gpt-3.5\", temperature=0.7),\n  tools=[search_tool]\n)\nwriter = Agent(\n  role='Tech Content Strategist',\n  goal='Craft compelling content on tech advancements',\n  backstory=\"\"\"You are a renowned Content Strategist, known for your insightful and engaging articles.\n  You transform complex concepts into compelling narratives.\"\"\",\n  verbose=True,\n  allow_delegation=True\n)\n\n# Create tasks for your agents\ntask1 = Task(\n  description=\"\"\"Conduct a comprehensive analysis of the latest advancements in AI in 2024.\n  Identify key trends, breakthrough technologies, and potential industry impacts.\"\"\",\n  expected_output=\"Full analysis report in bullet points\",\n  agent=researcher\n)\n\ntask2 = Task(\n  description=\"\"\"Using the insights provided, develop an engaging blog\n  post that highlights the most significant AI advancements.\n  Your post should be informative yet accessible, catering to a tech-savvy audience.\n  Make it sound cool, avoid complex words so it doesn't sound like AI.\"\"\",\n  expected_output=\"Full blog post of at least 4 paragraphs\",\n  agent=writer\n)\n\n# Instantiate your crew with a sequential process\ncrew = Crew(\n  agents=[researcher, writer],\n  tasks=[task1, task2],\n  verbose=True,\n  process=Process.sequential\n)\n\n# Get your crew to work!\nresult = crew.kickoff()\n\nprint(\"######################\")\nprint(result)\n```\n\n📌 Note: Before running this code, ensure that the API key of the specific LLM you are choosing is set as an env variable. In this example, since OpenAI is being used, set\n\n`OPENAI_API_KEY`\n\nwith your working API key. Additionally, for this specific example, you need to create a[Serper account], generate an API key, and set it as the environment variable`SERPER_API_KEY`\n\n.\n\n**Step 5:** Run your application with auto-instrumentation\n\n```\nOTEL_RESOURCE_ATTRIBUTES=\"service.name=<service_name>\" \\\nOTEL_EXPORTER_OTLP_ENDPOINT=\"https://ingest.<region>.signoz.cloud:443\" \\\nOTEL_EXPORTER_OTLP_HEADERS=\"signoz-ingestion-key=<your-ingestion-key>\" \\\nOTEL_EXPORTER_OTLP_PROTOCOL=grpc \\\nOTEL_TRACES_EXPORTER=otlp \\\nOTEL_METRICS_EXPORTER=otlp \\\nOTEL_LOGS_EXPORTER=otlp \\\nOTEL_PYTHON_LOG_CORRELATION=true \\\nOTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true \\\nopentelemetry-instrument <your_run_command>\n```\n\nis the name of your service`<service_name>`\n\n`<region>`\n\n: Your[SigNoz Cloud region](https://signoz.io/docs/ingestion/signoz-cloud/overview/#endpoint)`<your-ingestion-key>`\n\n: Your SigNoz[ingestion key](https://signoz.io/docs/ingestion/signoz-cloud/keys/)- Replace\n`<your_run_command>`\n\nwith the actual command you would use to run your application. For example:`python main.py`\n\nUsing self-hosted SigNoz? Most steps are identical. To adapt this guide, update the endpoint and remove the ingestion key header as shown in [Cloud → Self-Hosted](https://signoz.io/docs/ingestion/cloud-vs-self-hosted/#cloud-to-self-hosted).\n\nCode-based instrumentation gives you fine-grained control over your telemetry configuration. Use this approach when you need to customize resource attributes, sampling strategies, or integrate with existing observability infrastructure.\n\n**Step 1:** Install the necessary packages in your Python environment.\n\nCrewAI supports a variety of LLM providers for agent workflows, including OpenAI, Anthropic, Google (Gemini/Vertex AI), Azure, AWS Bedrock, Mistral, Groq, Ollama, and more. See the [full list of supported LLM providers](https://docs.crewai.com/en/concepts/llms).\n\nBased on which LLM provider you're using with CrewAI, you'll need to install the corresponding OpenInference instrumentor to track LLM-related traces. See the [OpenInference documentation](https://arize.com/docs/ax/observe/tracing/configure-tracing-options/instrument-with-openinference-helpers) for available instrumentors.\n\nFor this example using OpenAI:\n\n```\npip install \\\n  opentelemetry-api \\\n  opentelemetry-sdk \\\n  opentelemetry-exporter-otlp \\\n  opentelemetry-instrumentation-httpx \\\n  opentelemetry-instrumentation-system-metrics \\\n  openinference-instrumentation-crewai \\\n  openinference-instrumentation-openai \\\n  crewai \\\n  crewai-tools\n```\n\n📌 Note: If you're using a different LLM provider (e.g., Anthropic, Bedrock, Mistral), replace\n\n`openinference-instrumentation-openai`\n\nwith the appropriate instrumentor package such as`openinference-instrumentation-anthropic`\n\n,`openinference-instrumentation-bedrock`\n\n, etc.\n\n**Step 2:** Import the necessary modules in your Python application\n\n**Traces:**\n\n``` python\nfrom openinference.instrumentation.crewai import CrewAIInstrumentor\nfrom openinference.instrumentation.openai import OpenAIInstrumentor\nfrom opentelemetry import trace\nfrom opentelemetry.sdk.resources import Resource\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import BatchSpanProcessor\nfrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter\n```\n\n**Logs:**\n\n``` python\nfrom opentelemetry.sdk._logs import LoggerProvider, LoggingHandler\nfrom opentelemetry.sdk._logs.export import BatchLogRecordProcessor\nfrom opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter\nfrom opentelemetry._logs import set_logger_provider\nimport logging\n```\n\n**Metrics:**\n\n``` python\nfrom opentelemetry.sdk.metrics import MeterProvider\nfrom opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter\nfrom opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader\nfrom opentelemetry import metrics\nfrom opentelemetry.instrumentation.system_metrics import SystemMetricsInstrumentor\nfrom opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor\n```\n\n**Step 3:** Set up the OpenTelemetry Tracer Provider to send traces directly to SigNoz Cloud\n\n``` python\nfrom opentelemetry.sdk.resources import Resource\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import BatchSpanProcessor\nfrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter\nfrom opentelemetry import trace\nimport os\n\nresource = Resource.create({\"service.name\": \"<service_name>\"})\nprovider = TracerProvider(resource=resource)\nspan_exporter = OTLPSpanExporter(\n    endpoint= os.getenv(\"OTEL_EXPORTER_TRACES_ENDPOINT\"),\n    headers={\"signoz-ingestion-key\": os.getenv(\"SIGNOZ_INGESTION_KEY\")},\n)\nprocessor = BatchSpanProcessor(span_exporter)\nprovider.add_span_processor(processor)\ntrace.set_tracer_provider(provider)\n```\n\nis the name of your service`<service_name>`\n\n→ SigNoz Cloud trace endpoint with appropriate`OTEL_EXPORTER_TRACES_ENDPOINT`\n\n[region](https://signoz.io/docs/ingestion/signoz-cloud/overview/#endpoint):`https://ingest.<region>.signoz.cloud:443/v1/traces`\n\n→ Your SigNoz`SIGNOZ_INGESTION_KEY`\n\n[ingestion key](https://signoz.io/docs/ingestion/signoz-cloud/keys/)\n\nUsing self-hosted SigNoz? Most steps are identical. To adapt this guide, update the endpoint and remove the ingestion key header as shown in [Cloud → Self-Hosted](https://signoz.io/docs/ingestion/cloud-vs-self-hosted/#cloud-to-self-hosted).\n\n**Step 4:** Instrument CrewAI and your LLM provider using their respective instrumentors with the configured Tracer Provider\n\n``` python\nfrom openinference.instrumentation.crewai import CrewAIInstrumentor\nfrom openinference.instrumentation.openai import OpenAIInstrumentor\n\nCrewAIInstrumentor().instrument(tracer_provider=provider)\nOpenAIInstrumentor().instrument(tracer_provider=provider)\n```\n\n📌 Important: You must instrument both CrewAI and the LLM provider you're using with CrewAI. In this example, we're using OpenAI, so we instrument both\n\n`CrewAIInstrumentor`\n\nand`OpenAIInstrumentor`\n\n. If you're using a different LLM provider (e.g., Anthropic, Bedrock, Mistral), replace`OpenAIInstrumentor`\n\nwith the appropriate instrumentor for your provider.📌 Important: Place this code at the start of your application logic - before any CrewAI functions are called or used - to ensure telemetry is correctly captured.\n\n**Step 5**: Setup Logs\n\n``` python\nimport logging\nfrom opentelemetry.sdk.resources import Resource\nfrom opentelemetry._logs import set_logger_provider\nfrom opentelemetry.sdk._logs import LoggerProvider, LoggingHandler\nfrom opentelemetry.sdk._logs.export import BatchLogRecordProcessor\nfrom opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter\nimport os\n\nresource = Resource.create({\"service.name\": \"<service_name>\"})\nlogger_provider = LoggerProvider(resource=resource)\nset_logger_provider(logger_provider)\n\notlp_log_exporter = OTLPLogExporter(\n    endpoint= os.getenv(\"OTEL_EXPORTER_LOGS_ENDPOINT\"),\n    headers={\"signoz-ingestion-key\": os.getenv(\"SIGNOZ_INGESTION_KEY\")},\n)\nlogger_provider.add_log_record_processor(\n    BatchLogRecordProcessor(otlp_log_exporter)\n)\n# Attach OTel logging handler to root logger\nhandler = LoggingHandler(level=logging.INFO, logger_provider=logger_provider)\nlogging.basicConfig(level=logging.INFO, handlers=[handler])\n\nlogger = logging.getLogger(__name__)\n```\n\nis the name of your service`<service_name>`\n\n→ SigNoz Cloud endpoint with appropriate`OTEL_EXPORTER_LOGS_ENDPOINT`\n\n[region](https://signoz.io/docs/ingestion/signoz-cloud/overview/#endpoint):`https://ingest.<region>.signoz.cloud:443/v1/logs`\n\n→ Your SigNoz`SIGNOZ_INGESTION_KEY`\n\n[ingestion key](https://signoz.io/docs/ingestion/signoz-cloud/keys/)\n\nUsing self-hosted SigNoz? Most steps are identical. To adapt this guide, update the endpoint and remove the ingestion key header as shown in [Cloud → Self-Hosted](https://signoz.io/docs/ingestion/cloud-vs-self-hosted/#cloud-to-self-hosted).\n\n**Step 6**: Setup Metrics\n\n``` python\nfrom opentelemetry.sdk.resources import Resource\nfrom opentelemetry.sdk.metrics import MeterProvider\nfrom opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter\nfrom opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader\nfrom opentelemetry import metrics\nfrom opentelemetry.instrumentation.system_metrics import SystemMetricsInstrumentor\nimport os\n\nresource = Resource.create({\"service.name\": \"<service-name>\"})\nmetric_exporter = OTLPMetricExporter(\n    endpoint= os.getenv(\"OTEL_EXPORTER_METRICS_ENDPOINT\"),\n    headers={\"signoz-ingestion-key\": os.getenv(\"SIGNOZ_INGESTION_KEY\")},\n)\nreader = PeriodicExportingMetricReader(metric_exporter)\nmetric_provider = MeterProvider(metric_readers=[reader], resource=resource)\nmetrics.set_meter_provider(metric_provider)\n\nmeter = metrics.get_meter(__name__)\n\n# turn on out-of-the-box metrics\nSystemMetricsInstrumentor().instrument()\nHTTPXClientInstrumentor().instrument()\n```\n\nis the name of your service`<service_name>`\n\n→ SigNoz Cloud endpoint with appropriate`OTEL_EXPORTER_METRICS_ENDPOINT`\n\n[region](https://signoz.io/docs/ingestion/signoz-cloud/overview/#endpoint):`https://ingest.<region>.signoz.cloud:443/v1/metrics`\n\n→ Your SigNoz`SIGNOZ_INGESTION_KEY`\n\n[ingestion key](https://signoz.io/docs/ingestion/signoz-cloud/keys/)\n\n📌 Note: SystemMetricsInstrumentor provides system metrics (CPU, memory, etc.), and HTTPXClientInstrumentor provides outbound HTTP request metrics such as request duration. These are not CrewAI-specific metrics. CrewAI does not expose metrics as part of their SDK. If you want to add custom metrics to your CrewAI application, see\n\n[Python Custom Metrics].\n\nUsing self-hosted SigNoz? Most steps are identical. To adapt this guide, update the endpoint and remove the ingestion key header as shown in [Cloud → Self-Hosted](https://signoz.io/docs/ingestion/cloud-vs-self-hosted/#cloud-to-self-hosted).\n\n**Step 7:** Run an example\n\n``` python\nimport os\nfrom crewai import Agent, Task, Crew, Process\nfrom crewai_tools import SerperDevTool\n\nsearch_tool = SerperDevTool()\n\n# Define your agents with roles and goals\nresearcher = Agent(\n  role='Senior Research Analyst',\n  goal='Uncover cutting-edge developments in AI and data science',\n  backstory=\"\"\"You work at a leading tech think tank.\n  Your expertise lies in identifying emerging trends.\n  You have a knack for dissecting complex data and presenting actionable insights.\"\"\",\n  verbose=True,\n  allow_delegation=False,\n  # You can pass an optional llm attribute specifying what model you wanna use.\n  # llm=ChatOpenAI(model_name=\"gpt-3.5\", temperature=0.7),\n  tools=[search_tool]\n)\nwriter = Agent(\n  role='Tech Content Strategist',\n  goal='Craft compelling content on tech advancements',\n  backstory=\"\"\"You are a renowned Content Strategist, known for your insightful and engaging articles.\n  You transform complex concepts into compelling narratives.\"\"\",\n  verbose=True,\n  allow_delegation=True\n)\n\n# Create tasks for your agents\ntask1 = Task(\n  description=\"\"\"Conduct a comprehensive analysis of the latest advancements in AI in 2024.\n  Identify key trends, breakthrough technologies, and potential industry impacts.\"\"\",\n  expected_output=\"Full analysis report in bullet points\",\n  agent=researcher\n)\n\ntask2 = Task(\n  description=\"\"\"Using the insights provided, develop an engaging blog\n  post that highlights the most significant AI advancements.\n  Your post should be informative yet accessible, catering to a tech-savvy audience.\n  Make it sound cool, avoid complex words so it doesn't sound like AI.\"\"\",\n  expected_output=\"Full blog post of at least 4 paragraphs\",\n  agent=writer\n)\n\n# Instantiate your crew with a sequential process\ncrew = Crew(\n  agents=[researcher, writer],\n  tasks=[task1, task2],\n  verbose=True,\n  process=Process.sequential\n)\n\n# Get your crew to work!\nresult = crew.kickoff()\n\nprint(\"######################\")\nprint(result)\n```\n\n📌 Note: Before running this code, ensure that the API key of the specific LLM you are choosing is set as an env variable. In this example, since OpenAI is being used, set\n\n`OPENAI_API_KEY`\n\nwith your working API key. Additionally, for this specific example, you need to create a[Serper account], generate an API key, and set it as the environment variable`SERPER_API_KEY`\n\n.\n\nView CrewAI Traces, Logs, and Metrics in SigNoz\n\nOnce configured, your CrewAI application automatically emits traces, logs, and metrics.\n\nCrewAI traces are available in SigNoz under the Traces tab:\n\nWhen you click on a trace in SigNoz, you'll see a detailed view of the trace, including all associated spans, along with their events and attributes.\n\nCrewAI logs are available in SigNoz under the Logs tab. You can also view correlated logs by clicking the “Related Logs” button in the trace view:\n\nWhen you click on any of these logs in SigNoz, you'll see a detailed view of the log, including attributes:\n\nCrewAI metrics are available in SigNoz under the Metrics tab:\n\nWhen you click on any of these metrics in SigNoz, you'll see a detailed view of the metric, including attributes:\n\nCrewAI Monitoring Dashboard\n\nThe [CrewAI Monitoring Dashboard](https://signoz.io/docs/dashboards/dashboard-templates/crewai-dashboard/) provides specialized visualizations for CrewAI observability, including pre-built charts for agent performance, tool usage, and LLM call metrics, along with import instructions to get started quickly.", "url": "https://wpnews.pro/news/crewai-observability-monitoring-with-opentelemetry", "canonical_source": "https://signoz.io/docs/crewai-observability", "published_at": "2026-05-28 00:00:00+00:00", "updated_at": "2026-05-29 16:25:33.039654+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-agents", "ai-tools", "ai-infrastructure", "mlops"], "entities": ["CrewAI", "OpenTelemetry", "SigNoz", "SigNoz Cloud"], "alternates": {"html": "https://wpnews.pro/news/crewai-observability-monitoring-with-opentelemetry", "markdown": "https://wpnews.pro/news/crewai-observability-monitoring-with-opentelemetry.md", "text": "https://wpnews.pro/news/crewai-observability-monitoring-with-opentelemetry.txt", "jsonld": "https://wpnews.pro/news/crewai-observability-monitoring-with-opentelemetry.jsonld"}}