İçeriğe geç

Enterprise APM'lerle LLM Cost Entegrasyonu: Sentry, Datadog, New Relic Pattern'leri

Mevcut APM altyapın varsa (Sentry, Datadog, New Relic) LLM telemetry'i ayrı bir tool'a koymak yerine onları extend edebilirsin. Bu derste 3 enterprise APM'in LLM-specific feature'ları, custom metric pattern'leri ve cost attribution stratejilerini görüyoruz.

Şükrü Yusuf KAYA
18 dakikalık okuma
İleri
Enterprise APM'lerle LLM Cost Entegrasyonu: Sentry, Datadog, New Relic Pattern'leri
🏢 Mevcut yatırımını koruyarak ileriye git
Şirketin zaten Datadog/Sentry/New Relic kullanıyorsa, LLM observability için ayrı bir tool eklemek yerine mevcut araçları extend etmek genelde daha mantıklı. Bu derste 3 enterprise APM için pattern'leri görüyoruz.

1️⃣ Datadog LLM Observability#

Datadog 2024 sonu LLM Observability modülünü çıkardı. Mevcut Datadog APM'in üzerine.

Feature seti#

  • ✅ Built-in tracing for OpenAI, Anthropic, Cohere, Mistral
  • ✅ Cost tracking (per provider)
  • ✅ Cost attribution (Datadog's tag system)
  • ✅ Eval framework (basic LLM-as-judge)
  • ✅ Prompt drift detection
  • ⚠️ Self-host Datadog yok (cloud-only)

Fiyatlandırma#

Datadog LLM Observability eklentisi: **25/host/aymevcutAPMinu¨zerine.Yadapayasyougoeventbased:25/host/ay** mevcut APM'in üzerine. Ya da `pay-as-you-go` event-based: 1.27 / 10K events.

Entegrasyon#

from ddtrace.llmobs import LLMObs LLMObs.enable( ml_app="my-llm-product", api_key=os.environ["DD_API_KEY"], site=os.environ["DD_SITE"], ) # OpenAI auto-instrumented response = openai.chat.completions.create(...)

Avantaj/Dezavantaj#

✅ Mevcut Datadog dashboard'ına entegre ✅ Cross-service correlation (DB + cache + LLM aynı trace) ✅ Otomatik PII redaction (enterprise) ❌ Cost on top of existing Datadog (genelde pahalı) ❌ Self-host yok — KVKK için sınır

2️⃣ Sentry AI Monitoring#

Sentry 2024 sonu AI Monitoring feature'ı ekledi. Error tracking + performance + LLM cost.

Feature seti#

  • ✅ Tracing (OpenAI, Anthropic, etc.)
  • ✅ Cost tracking
  • ✅ AI-specific error capture (token limit, rate limit, content filter)
  • ✅ Performance overlay (latency p95)
  • ✅ Self-host (Sentry'nin enterprise self-host'u)
  • ❌ Eval framework yok
  • ❌ Prompt management yok

Fiyatlandırma#

Sentry AI Monitoring dahil Team plan ($26/ay/dev) ve üstü. Volume-based event pricing.

Entegrasyon#

import sentry_sdk sentry_sdk.init( dsn="...", integrations=[ sentry_sdk.integrations.openai.OpenAIIntegration(), sentry_sdk.integrations.anthropic.AnthropicIntegration(), ], enable_tracing=True, )

Avantaj/Dezavantaj#

✅ Error tracking + LLM monitoring tek araç ✅ Self-host enterprise opsiyonu ✅ Türkiye'deki birçok SaaS zaten kullanıyor ❌ LLM-spesifik feature'lar Datadog'dan daha sınırlı ❌ Cost dashboard basit, deep-dive zayıf

3️⃣ New Relic AI Monitoring#

New Relic'in geleneksel APM'i artık LLM destekli.

Feature seti#

  • ✅ Tracing
  • ✅ Cost tracking
  • ✅ Model performance benchmarks
  • ✅ Token usage analytics
  • ✅ Built-in alerts
  • ⚠️ Self-host enterprise-only

Fiyatlandırma#

New Relic'in standart APM pricing'i geçerli — Compute Unit (CU) bazlı. LLM monitoring ek bir maliyet eklemez. Bu, mevcut New Relic müşterileri için avantaj.

Entegrasyon#

import newrelic.agent newrelic.agent.initialize("newrelic.ini") # OpenAI auto-instrumented (newrelic.ai modülü)

Hızlı Karşılaştırma#

ÖzellikDatadogSentryNew RelicLangfuse (referans)
LLM-specific UI⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Cross-service correlation⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Cost dashboard⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Eval framework⭐⭐⭐⭐⭐⭐⭐⭐⭐
Self-host✅ ent✅ ent✅ free
Fiyat (yüksek volume)💸💸💸💸💸💸💸💸

Karar#

SenaryoTavsiye
Mevcut Datadog kullanıyorsun + cost tracking yeterDatadog LLM Observability
Mevcut Sentry kullanıyorsun + ucuz yeterliSentry AI Monitoring
Eval framework + prompt management gerekliLangfuse paralel kur
KVKK + tam kontrolLangfuse self-host veya OTel + ClickHouse

Hybrid Pattern — En Yaygın Production Setup#

Aslında çoğu olgun ekibin yaptığı: iki araç birden.
[App] → LiteLLM proxy ↓ callback 1: Datadog (cross-service trace, error tracking) ↓ callback 2: Langfuse (LLM-specific eval, prompt mgmt, cost dashboard)
LiteLLM birden çok callback destekliyor:
import litellm litellm.success_callback = [ "datadog", "langfuse", ] litellm.failure_callback = [ "datadog", "langfuse", "sentry", ]
Bu pattern'ın çakışması yok — her araç güçlü olduğu yerde değer üretiyor.

Custom Metric Pattern'leri#

Bazı LLM-spesifik metric'leri APM'lerine kendin ekleyebilirsin (built-in feature olmasa bile).

Datadog custom metric örneği#

from datadog import statsd # Her LLM çağrısının sonunda statsd.gauge( "llm.cost_per_request", cost_usd, tags=[f"model:{model}", f"feature:{feature}", f"user:{user_id}"], ) statsd.histogram( "llm.tokens.input", input_tokens, tags=[f"model:{model}", f"cached:{is_cached}"], ) statsd.histogram( "llm.tokens.output", output_tokens, tags=[f"model:{model}"], ) statsd.increment( "llm.cache_hit" if cache_hit else "llm.cache_miss", tags=[f"model:{model}"], )

Sentry custom metric#

sentry_sdk.metrics.distribution( "llm.cost_per_request", cost_usd, unit="usd", tags={"model": model, "feature": feature}, )

Modül 3 Özet#

Bu modülde gördük:
  1. Telemetry felsefe — ölçemediğin neyi optimize edemezsin
  2. Usage objesi anatomi — 3 sağlayıcı, 3 farklı format
  3. Streaming nuance'leri — production'da 7 yaygın hata
  4. Araç karşılaştırma — Langfuse, Helicone, LangSmith, Phoenix, OTel
  5. Self-hosted stack — ClickHouse + Grafana ile maksimum kontrol
  6. Enterprise APM entegrasyonu — Datadog, Sentry, New Relic pattern'leri
Şimdi gerçekten ölçebiliyorsun. Modül 4'te bu telemetry'i cost attribution'a bağlayacağız: hangi feature, hangi kullanıcı, hangi takım ne kadar harcatıyor — ve bunu fiyatlandırmaya yansıtmak.
🚀 Modül 4'e geçiyoruz
Modül 4: Maliyet Atfı (Cost Attribution). Telemetry'in iş tarafına geçiyoruz. Per-tenant chargeback, per-feature ekonomik analiz, abuse detection, ve LiteLLM virtual keys mimari. Bir sonraki modülde.

Sık Sorulan Sorular

Evet, yaygın bir pattern. Datadog cross-service traces için (DB+cache+LLM aynı trace'te), Langfuse LLM-spesifik eval/prompt mgmt için. İkisi de LiteLLM callback ile aynı kaynaktan beslenir, çakışma yok. Maliyet sorgulanırsa: Langfuse free tier + Datadog'un existing maliyetinin üzerine $25/host/ay LLM eklenti.

Yorumlar & Soru-Cevap

(0)
Yorum yazmak için giriş yap.
Yorumlar yükleniyor...

İlgili İçerikler