{"slug": "deepseek-monitoring-observability-with-opentelemetry", "title": "DeepSeek Monitoring & Observability with OpenTelemetry", "summary": "SigNoz has released a new guide for monitoring DeepSeek API calls using OpenTelemetry, enabling developers to track model latency, error rates, and token usage in unified dashboards. The integration allows users to instrument the DeepSeek API with OpenTelemetry and export traces, logs, and metrics to SigNoz for end-to-end observability. This setup helps teams debug issues, optimize performance, and improve reliability across AI workflows.", "body_md": "What is DeepSeek Monitoring?\n\nDeepSeek monitoring with OpenTelemetry gives you full visibility into your DeepSeek API calls. This guide walks you through instrumenting the DeepSeek API with [OpenTelemetry](https://opentelemetry.io/) and exporting traces, logs, and metrics to SigNoz, so you can track model latency, error rates, and token usage in one place.\n\nWith full DeepSeek monitoring in SigNoz, you can correlate traces, logs, and metrics in unified dashboards, configure alerts on latency and error rates, and gain actionable insights to continuously improve the reliability and responsiveness of your DeepSeek applications. This end-to-end DeepSeek observability makes it easier to debug issues, optimize performance, and understand user interactions across your AI workflows.\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- A\n[DeepSeek](https://api-docs.deepseek.com/)API account with a working API Key - For Python:\n`pip`\n\ninstalled for managing Python packages and*(optional but recommended)*a Python virtual environment to isolate dependencies - For JavaScript: Node.js (version 14 or higher) and\n`npm`\n\ninstalled for managing Node.js packages\n\nMonitoring DeepSeek with OpenTelemetry\n\nThe DeepSeek API uses an API format compatible with OpenAI. By modifying the configuration, you can use the OpenAI SDK or software compatible with the OpenAI API to access the DeepSeek API. Hence, a similar method to monitor OpenAI APIs can be used for monitoring DeepSeek APIs as well. To read more about this, you can read the [DeepSeek API Docs](https://api-docs.deepseek.com/)\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  openai \\\n  openinference-instrumentation-openai\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\n\nlogging.getLogger().setLevel(logging.INFO)\nlogging.getLogger(\"httpx\").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 openai\nimport os\n\nclient = OpenAI(api_key=os.getenv(\"DEEPSEEK_API_KEY\"), base_url=\"https://api.deepseek.com\")\n\nresponse = client.chat.completions.create(\n    model=\"deepseek-chat\",\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a helpful assistant\"},\n        {\"role\": \"user\", \"content\": \"What is SigNoz?\"},\n    ],\n    stream=False\n)\n\nprint(response.choices[0].message.content)\n```\n\n📌 Note: Before running this code, ensure that you have set the environment variable\n\n`DEEPSEEK_API_KEY`\n\nwith your generated API key.\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\n```\npip install \\\n  opentelemetry-api \\\n  opentelemetry-sdk \\\n  opentelemetry-exporter-otlp \\\n  opentelemetry-instrumentation-httpx \\\n  opentelemetry-instrumentation-system-metrics \\\n  openai \\\n  openinference-instrumentation-openai\n```\n\n**Step 2:** Import the necessary modules in your Python application\n\n**Traces:**\n\n``` python\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 DeepSeek using `OpenAInstrumentor`\n\nand the configured Tracer Provider\n\n``` python\nfrom openinference.instrumentation.openai import OpenAIInstrumentor\n\nOpenAIInstrumentor().instrument(tracer_provider=provider)\n```\n\n📌 Important: Place this code at the start of your application logic, before any DeepSeek 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 DeepSeek-specific metrics. DeepSeek does not expose metrics as part of their SDK. If you want to add custom metrics to your DeepSeek 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 openai\nimport os\n\nclient = OpenAI(api_key=os.getenv(\"DEEPSEEK_API_KEY\"), base_url=\"https://api.deepseek.com\")\n\nresponse = client.chat.completions.create(\n    model=\"deepseek-chat\",\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a helpful assistant\"},\n        {\"role\": \"user\", \"content\": \"What is SigNoz?\"},\n    ],\n    stream=False\n)\n\nprint(response.choices[0].message.content)\n```\n\n📌 Note: Before running this code, ensure that you have set the environment variable\n\n`DEEPSEEK_API_KEY`\n\nwith your generated API key.\n\n**Step 1:** Install the necessary packages in your Node.js project.\n\n```\nnpm install \\\n  @opentelemetry/api \\\n  @opentelemetry/sdk-node \\\n  @opentelemetry/sdk-trace-node \\\n  @opentelemetry/sdk-logs \\\n  @opentelemetry/sdk-metrics \\\n  @opentelemetry/exporter-otlp-http \\\n  @opentelemetry/instrumentation \\\n  @opentelemetry/instrumentation-http \\\n  @opentelemetry/host-metrics \\\n  @opentelemetry/resources \\\n  @opentelemetry/semantic-conventions \\\n  @arizeai/openinference-instrumentation-openai \\\n  openai\n```\n\n**Step 2:** Import the necessary modules in your JavaScript/Node.js application\n\n**Traces:**\n\n``` js\nconst { NodeSDK } = require('@opentelemetry/sdk-node')\nconst { Resource } = require('@opentelemetry/resources')\nconst { ATTR_SERVICE_NAME } = require('@opentelemetry/semantic-conventions')\nconst { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node')\nconst { BatchSpanProcessor } = require('@opentelemetry/sdk-trace-base')\nconst { OTLPTraceExporter } = require('@opentelemetry/exporter-otlp-http')\nconst { registerInstrumentations } = require('@opentelemetry/instrumentation')\nconst { OpenAIInstrumentation } = require('@arizeai/openinference-instrumentation-openai')\n```\n\n**Logs:**\n\n``` js\nconst { LoggerProvider, BatchLogRecordProcessor } = require('@opentelemetry/sdk-logs')\nconst { OTLPLogExporter } = require('@opentelemetry/exporter-otlp-http')\nconst { logs } = require('@opentelemetry/api')\n```\n\n**Metrics:**\n\n``` js\nconst { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics')\nconst { OTLPMetricExporter } = require('@opentelemetry/exporter-otlp-http')\nconst { HttpInstrumentation } = require('@opentelemetry/instrumentation-http')\nconst { HostMetrics } = require('@opentelemetry/host-metrics')\nconst { metrics } = require('@opentelemetry/api')\n```\n\n**Step 3:** Set up the OpenTelemetry Tracer Provider to send traces directly to SigNoz Cloud\n\n``` js\nconst { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node')\nconst { BatchSpanProcessor } = require('@opentelemetry/sdk-trace-base')\nconst { OTLPTraceExporter } = require('@opentelemetry/exporter-otlp-http')\nconst { Resource } = require('@opentelemetry/resources')\nconst { ATTR_SERVICE_NAME } = require('@opentelemetry/semantic-conventions')\nconst { trace } = require('@opentelemetry/api')\n\nconst resource = Resource.default({\n  attributes: {\n    [ATTR_SERVICE_NAME]: '<service_name>',\n  },\n})\n\nconst provider = new NodeTracerProvider({\n  resource: resource,\n})\n\nconst traceExporter = new OTLPTraceExporter({\n  url: process.env.OTEL_EXPORTER_TRACES_ENDPOINT,\n  headers: {\n    'signoz-ingestion-key': process.env.SIGNOZ_INGESTION_KEY,\n  },\n})\n\nconst spanProcessor = new BatchSpanProcessor(traceExporter)\nprovider.addSpanProcessor(spanProcessor)\nprovider.register()\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 DeepSeek using `OpenAIInstrumentation`\n\nand the configured Tracer Provider\n\n``` js\nconst { registerInstrumentations } = require('@opentelemetry/instrumentation')\nconst { OpenAIInstrumentation } = require('@arizeai/openinference-instrumentation-openai')\n\nregisterInstrumentations({\n  instrumentations: [\n    new OpenAIInstrumentation({\n      tracerProvider: provider,\n    }),\n  ],\n})\n```\n\n📌 Important: Place this code at the start of your application logic, before any DeepSeek functions are called or used, to ensure telemetry is correctly captured.\n\n**Step 5**: Setup Logs\n\n``` js\nconst { LoggerProvider, BatchLogRecordProcessor } = require('@opentelemetry/sdk-logs')\nconst { OTLPLogExporter } = require('@opentelemetry/exporter-otlp-http')\nconst { Resource } = require('@opentelemetry/resources')\nconst { ATTR_SERVICE_NAME } = require('@opentelemetry/semantic-conventions')\nconst { logs } = require('@opentelemetry/api')\n\nconst logResource = Resource.default({\n  attributes: {\n    [ATTR_SERVICE_NAME]: '<service_name>',\n  },\n})\n\nconst loggerProvider = new LoggerProvider({\n  resource: logResource,\n})\n\nconst logExporter = new OTLPLogExporter({\n  url: process.env.OTEL_EXPORTER_LOGS_ENDPOINT,\n  headers: {\n    'signoz-ingestion-key': process.env.SIGNOZ_INGESTION_KEY,\n  },\n})\n\nloggerProvider.addLogRecordProcessor(new BatchLogRecordProcessor(logExporter))\n\nlogs.setGlobalLoggerProvider(loggerProvider)\n\n// Create a logger instance\nconst logger = logs.getLogger('deepseek-app')\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``` js\nconst { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics')\nconst { OTLPMetricExporter } = require('@opentelemetry/exporter-otlp-http')\nconst { Resource } = require('@opentelemetry/resources')\nconst { ATTR_SERVICE_NAME } = require('@opentelemetry/semantic-conventions')\nconst { metrics } = require('@opentelemetry/api')\nconst { HttpInstrumentation } = require('@opentelemetry/instrumentation-http')\nconst { registerInstrumentations } = require('@opentelemetry/instrumentation')\n\nconst metricResource = Resource.default({\n  attributes: {\n    [ATTR_SERVICE_NAME]: '<service_name>',\n  },\n})\n\nconst metricExporter = new OTLPMetricExporter({\n  url: process.env.OTEL_EXPORTER_METRICS_ENDPOINT,\n  headers: {\n    'signoz-ingestion-key': process.env.SIGNOZ_INGESTION_KEY,\n  },\n})\n\nconst metricReader = new PeriodicExportingMetricReader({\n  exporter: metricExporter,\n  exportIntervalMillis: 10000,\n})\n\nconst meterProvider = new MeterProvider({\n  resource: metricResource,\n  readers: [metricReader],\n})\n\nmetrics.setGlobalMeterProvider(meterProvider)\n\n// Create a meter instance\nconst meter = metrics.getMeter('deepseek-app')\n\n// Register HTTP instrumentation for outbound HTTP metrics\nregisterInstrumentations({\n  instrumentations: [new HttpInstrumentation()],\n})\n\n// Initialize host metrics for system-level monitoring\nconst hostMetrics = new HostMetrics({\n  meterProvider: meterProvider,\n})\nhostMetrics.start()\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\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📌 Note: HostMetrics provides system-level metrics (CPU, memory, disk, network, etc.), and HttpInstrumentation provides outbound HTTP request metrics such as request duration. These are not DeepSeek-specific metrics. DeepSeek does not expose metrics as part of their SDK. If you want to add custom metrics to your DeepSeek application, see\n\n[JavaScript Custom Metrics].\n\n**Step 7:** Run an example\n\n``` js\nconst OpenAI = require('openai')\n\nconst client = new OpenAI({\n  apiKey: process.env.DEEPSEEK_API_KEY,\n  baseURL: 'https://api.deepseek.com',\n})\n\nasync function main() {\n  try {\n    const response = await client.chat.completions.create({\n      model: 'deepseek-chat',\n      messages: [\n        { role: 'system', content: 'You are a helpful assistant' },\n        { role: 'user', content: 'What is SigNoz?' },\n      ],\n      stream: false,\n    })\n\n    console.log(response.choices[0].message.content)\n\n    // Optional: Log the interaction\n    logger.emit({\n      severityText: 'INFO',\n      body: 'DeepSeek API call completed successfully',\n      attributes: {\n        'deepseek.model': 'deepseek-chat',\n        'deepseek.response.length': response.choices[0].message.content.length,\n      },\n    })\n  } catch (error) {\n    console.error('Error calling DeepSeek API:', error)\n\n    // Optional: Log the error\n    logger.emit({\n      severityText: 'ERROR',\n      body: 'DeepSeek API call failed',\n      attributes: {\n        'error.message': error.message,\n        'deepseek.model': 'deepseek-chat',\n      },\n    })\n  }\n}\n\nmain()\n```\n\n📌 Note: Before running this code, ensure that you have set the environment variable\n\n`DEEPSEEK_API_KEY`\n\nwith your generated API key.\n\nView DeepSeek Traces, Logs, and Metrics in SigNoz\n\nOnce configured, your DeepSeek application automatically emits traces, logs, and metrics.\n\nDeepSeek 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\nDeepSeek logs are available in SigNoz under the Logs tab. You can also click the “Related Logs” button in the trace view to see correlated logs:\n\nWhen you click on any of these logs in SigNoz, you'll see a detailed view of the log, including attributes:\n\nDeepSeek related 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\nDeepSeek Monitoring Dashboard\n\nThe [DeepSeek API dashboard template](https://signoz.io/docs/dashboards/dashboard-templates/deepseek-dashboard/) provides specialized visualizations for monitoring your DeepSeek API usage. It includes pre-built charts tailored for LLM usage, along with import instructions to get started quickly.", "url": "https://wpnews.pro/news/deepseek-monitoring-observability-with-opentelemetry", "canonical_source": "https://signoz.io/docs/deepseek-monitoring", "published_at": "2026-06-01 00:00:00+00:00", "updated_at": "2026-06-04 12:55:43.535894+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-tools", "ai-infrastructure", "mlops"], "entities": ["DeepSeek", "OpenTelemetry", "SigNoz", "OpenAI"], "alternates": {"html": "https://wpnews.pro/news/deepseek-monitoring-observability-with-opentelemetry", "markdown": "https://wpnews.pro/news/deepseek-monitoring-observability-with-opentelemetry.md", "text": "https://wpnews.pro/news/deepseek-monitoring-observability-with-opentelemetry.txt", "jsonld": "https://wpnews.pro/news/deepseek-monitoring-observability-with-opentelemetry.jsonld"}}