File: //proc/self/root/opt/netdata/netdata-web-files/v3/4142.5a702b5ec17d060a296e.chunk.js
try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="09288b36-2a1d-48d1-bda3-d608c28bf6a2",e._sentryDebugIdIdentifier="sentry-dbid-09288b36-2a1d-48d1-bda3-d608c28bf6a2")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"7c174a810ceb580519f3181b86370f2046d11e4e"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[4142],{4142:(e,t,n)=>{n.d(t,{A:()=>k});var i=n(96540),a=n(87073),r=n(21996),s=n(29579),o=(n(98992),n(81454),n(79997)),c=n(43252),l=n(74848);const d="Something went wrong",u=e=>{let{message:t=d}=e;return(0,l.jsx)(a.Flex,{"data-testid":"insights-investigation-chat-item-error",children:(0,l.jsx)(o.qm,{children:(0,l.jsxs)(a.TextBig,{color:"error",children:["Error: ",t]})})})},p=e=>{let{type:t,question:n,response:r,error:s}=e;const{message:p}=(0,i.useMemo)((()=>(e=>e?"string"===typeof e?{message:e}:{message:e.response?.data?.errorMessage||e?.message||d}:{})(s)),[s]);return t===c.$p.error?(0,l.jsx)(u,{message:p}):(0,l.jsxs)(a.Flex,{column:!0,gap:2,children:[n?(0,l.jsx)(a.Flex,{"data-testid":"insights-investigation-chat-item-question",children:(0,l.jsx)(o.qm,{children:(0,l.jsx)(a.TextBig,{children:n})})}):null,r?(0,l.jsx)(a.Flex,{justifyContent:"end","data-testid":"insights-investigation-chat-item-response",children:(0,l.jsx)(o.qm,{background:"inputBg",children:(0,l.jsx)(a.TextBig,{children:r})})}):null]})},m=function(){let{chat:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,i.useRef)();return(0,i.useEffect)((()=>{t?.current&&t.current.scrollIntoView({behavior:"smooth"})}),[e,t?.current]),(0,l.jsxs)(l.Fragment,{children:[e.map((e=>(0,l.jsx)(p,{...e},e.id))),(0,l.jsx)("div",{ref:t})]})};var h=n(18121);const f=e=>{let{id:t,title:n,onClick:r}=e;const[s,o]=(0,h.useHovered)({},[]),c=(0,i.useCallback)((()=>{"function"===typeof r&&r({id:t})}),[t,r]);return(0,l.jsx)(a.Flex,{ref:s,cursor:"pointer",onClick:c,padding:[2,3],border:{side:"all",color:o?"primary":"border"},children:(0,l.jsx)(a.Text,{color:o?"primary":"menuItem",children:n})})},g=e=>{let{title:t,items:n=[],onItemClick:i}=e;return(0,l.jsxs)(a.Flex,{column:!0,gap:4,padding:[4],background:"panelBg",children:[(0,l.jsx)(a.TextBig,{color:"menuItem",children:t}),n.map((e=>(0,l.jsx)(f,{onClick:i,...e},e.id)))]})};var v=n(55744);const y=e=>{let{isNarrow:t,onItemClick:n}=e;return(0,l.jsxs)(a.Flex,{column:!0,gap:4,padding:[2,0,0,0],children:[(0,l.jsx)(a.Flex,{column:!0,gap:2,children:(0,l.jsx)(a.TextBig,{color:"textLite",children:"These examples provide starting templates\u2014customize them with your specific context. Netdata understands any investigation query, not just these categories."})}),(0,l.jsx)(a.Flex,{column:t,gap:4,children:v.K.map((e=>(0,l.jsx)(g,{onItemClick:n,...e},e.id)))})]})};var b=n(5310);const x=(0,n(74891).A)(a.Button),w=e=>{let{canSubmit:t,isLoading:n,isActive:a,...r}=e;const s=(0,i.useMemo)((()=>!t||n?{}:{tooltip:a?"Report is scheduled":"Schedule report",tooltipProps:{align:"bottom"}}),[a,t,n]);return(0,l.jsx)(x,{flavour:"hollow",disabled:!t||n,padding:[1,2],label:a?"Scheduled":"Schedule",icon:"clock_hollow",neutral:!a,...s,...r})},k=e=>{let{flavour:t,variables:n,parentRef:d}=e;const u=(0,i.useRef)(),p=t===c.Rh.troubleshooter,[h,f]=(0,i.useState)(),{isLoading:g,chat:v,submitButtonToootip:k,canSubmit:C,textValue:I,textPlaceHolder:S,textMaxLength:j,onTextChange:A,onTextBlur:T,onKeyDown:B,onSubmit:V,onExampleItemClick:M}=(0,b.A)({variables:n,textRef:u,parentRef:d,schedulerState:h}),P=!!v.length,R=(0,i.useCallback)((e=>{const{name:t,rrule:n,recipientIds:i}=e||{};f({name:t,rrule:n,recipientIds:i})}),[f]),F=h?()=>f():void 0,q=(0,i.useCallback)((e=>(0,l.jsx)(w,{canSubmit:C,isLoading:g,isActive:!!h,...e})),[C,g,h]);return(0,l.jsxs)(a.Flex,{"data-testid":"insights-custom-investigation-container",width:"100%",column:!0,gap:2,padding:[4,4,0,4],children:[P?null:(0,l.jsx)(a.TextBig,{color:"menuItem",children:"Start a New Investigation"}),(0,l.jsxs)(a.Flex,{"data-testid":"insights-investigation-container",width:"100%",alignItems:"center",column:!0,gap:2,children:[P?(0,l.jsx)(a.Flex,{"data-testid":"insights-investigation-chat-container",width:"100%",height:"calc(100vh - 570px)",overflow:{vertical:"auto"},column:!0,gap:2,padding:[2,2,2,0],children:(0,l.jsx)(m,{chat:v})}):null,(0,l.jsx)(a.Flex,{"data-testid":"insights-investigation-prompt-container",width:"100%",column:!0,gap:4,alignItems:"center",justifyContent:"center",children:(0,l.jsxs)(a.Flex,{"data-testid":"insights-investigation-prompt-input-container",width:"100%",position:"relative",children:[(0,l.jsx)(r.A,{ref:u,tabIndex:"0","data-testid":"insights-investigation-prompt-input",width:"100%",maxLength:j,rows:3,placeholder:S,value:I,onChange:A,onBlur:T,onKeyDown:B,autoFocus:"autofocus",disabled:g,round:"2px"}),(0,l.jsxs)(a.Flex,{alignItems:"center",gap:2,position:"absolute",right:"8px",bottom:"8px",children:[(0,l.jsx)(s.A,{Accessor:q,onSubmit:R,onPause:F}),(0,l.jsx)(x,{onClick:V,disabled:!C||g,tooltip:k,padding:[.5,1.5],children:(0,l.jsx)(o.AQ,{isBlinking:g,name:"arrow_left",rotate:1})})]})]})})]}),P?null:(0,l.jsx)(y,{isNarrow:p,onItemClick:M})]})}},5310:(e,t,n)=>{n.d(t,{A:()=>h,u:()=>m});n(98992),n(54520),n(72577),n(81454),n(37550);var i=n(96540),a=n(81685),r=n(23117),s=n(43252),o=n(55744),c=n(25279);const l=e=>{let{state:t,query:n,variableIds:i}=e;return t&&n?t.clarificationId?(n.variables.find((e=>{let{id:t}=e;return t===i.clarifications}))?.value||[]).map((e=>e.id===t.clarificationId?{...e,response:t.textValue}:e)):t.textValue:""},d=e=>({id:(0,c.A)(),type:s.$p.response,response:e.textValue}),u=e=>{let{query:t,variableIds:n}=e;return{...t,variables:t.variables.filter((e=>!(e.id===n.clarifications&&!Array.isArray(e.value))))}},p=()=>!1,m={textValue:"",textPlaceHolder:"Describe your investigation. Include context like when it started, what changed, impact, and what you've already tried...",variableId:s.Vs.reportDescription,clarificationId:null,clarifications:[],chat:[],error:null},h=e=>{let{variables:t,textRef:n,parentRef:h,schedulerState:f}=e;const{query:g,onVariableChange:v}=(0,a.g0)(),y=(0,a.fT)(),[,b]=(0,a.W5)(),[x,w]=(0,i.useState)(m),{textValue:k,textPlaceHolder:C,chat:I}=x,S=(0,i.useCallback)((()=>{w((e=>({...e,textValue:m.textValue})))}),[m,w]),j=(0,i.useCallback)((e=>{let{isScheduled:t}=e;n?.current&&n.current.focus(),t?y():(b(),S())}),[n,b,S,y]),A=(0,i.useCallback)((e=>{const t=e?.response?.status;if(422===t){const t=e?.response?.data?.details?.clarification_questions;Array.isArray(t)&&(w((e=>{const n=t.filter((t=>!e.clarifications.map((e=>{let{id:t}=e;return t})).includes(t.id)));return{...e,variableId:s.Vs.clarifications,textPlaceHolder:"Type your answer",clarificationId:n[0]?.id,clarifications:[...e.clarifications,...n],chat:[...e.chat,n[0]]}})),S())}else w((t=>({...t,chat:[...t.chat,{id:(0,c.A)(),type:s.$p.error,error:e}]})));n?.current&&n.current.focus()}),[n,w,S]),{isLoading:T,onGenerate:B}=(0,r.J)({query:u({query:g,variableIds:s.Vs}),onSuccess:j,onError:A,checkErrorNotification:p,schedulerState:f}),{maxLength:V}=(0,i.useMemo)((()=>t.find((e=>{let{id:t}=e;return t===s.Vs.reportDescription}))),[t]),{items:M}=(0,i.useMemo)((()=>t.find((e=>{let{id:t}=e;return t===s.Vs.clarifications}))),[t]),P=(0,i.useMemo)((()=>M?.properties?.find((e=>{let{id:t}=e;return"response"===t}))?.max_length||1e3),[M]),R=(0,i.useMemo)((()=>x.clarificationId?P||s.Gt:V||s.Gt),[x,V,P]),F=(0,i.useMemo)((()=>x.clarifications.some((e=>{let{response:t}=e;return!t}))),[x]),q=(0,i.useMemo)((()=>x.clarifications.map((e=>{let{id:t}=e;return t})).indexOf(x.clarificationId)===x.clarifications.length-1),[x]),D=(0,i.useMemo)((()=>T?"Loading...":k?.length?null:"Please type something"),[T,k]),z=(0,i.useMemo)((()=>!!k?.length),[k]),L=(0,i.useCallback)((e=>{w((t=>({...t,textValue:e})))}),[w]),_=(0,i.useCallback)((()=>{const e=l({state:x,query:g,variableIds:s.Vs});v({id:x.variableId,value:e})}),[x,g,v]),W=(0,i.useCallback)((e=>{if(F){const{clarificationId:e,clarifications:t,pendingClarification:n}=(e=>{let t=e.clarificationId;const n=e.clarifications.map(((n,i)=>n.id===e.clarificationId?(t=e.clarifications[i+1]?.id,{...n,response:e.textValue}):n)),i=n.find((e=>{let{response:t}=e;return!t}));return{clarificationId:t,clarifications:n,pendingClarification:i}})(x);if(q){const e={...g,variables:g.variables.map((e=>e.id===s.Vs.clarifications?{...e,value:t}:e))};w((e=>({...e,chat:[...e.chat,d(e)]}))),B(e)}else w((i=>({...i,textValue:m.textValue,clarificationId:e,clarifications:t,chat:[...i.chat,d(i),n]})))}else w((e=>({...e,chat:[...e.chat,d(e)]}))),B(e)}),[x,m,g,F,q,B]),E=(0,i.useCallback)((()=>{z&&W()}),[z,W]),N=(0,i.useCallback)((e=>{if("Enter"===e.key&&!e.shiftKey&&z){e.preventDefault(),x.variableId===s.Vs.reportDescription&&v({id:x.variableId,value:x.textValue});const t=l({state:x,query:g,variableIds:s.Vs}),n={...g,variables:g.variables.map((e=>e.id===x.variableId?{...e,value:t}:e))};W(u({query:n,variableIds:s.Vs}))}}),[x,g,z,v,W]),K=(0,i.useCallback)((e=>{let{id:t}=e;const n=(e=>o.K.map((e=>[...e.items])).flat().find((t=>t.id===e)))(t);n&&(w((e=>({...e,textValue:n.content}))),v({id:s.Vs.reportDescription,value:n.content}),h?.current&&h.current.scrollTo({top:0,behavior:"smooth"}))}),[w,v,h]);return{isLoading:T,chat:I,submitButtonToootip:D,canSubmit:z,textValue:k,textPlaceHolder:C,textMaxLength:R,onTextChange:L,onTextBlur:_,onKeyDown:N,onSubmit:E,onExampleItemClick:K}}},55744:(e,t,n)=>{n.d(t,{K:()=>i});const i=[{id:"troubleshoot-problem",title:"Troubleshoot a problem",items:[{id:"checkout-pods-crashing",title:"Why are my checkout-service pods crashing repeatedly?",content:'Why are my checkout-service pods crashing repeatedly?\n\nContext:\n- Started after: [deployment at 14:00 UTC of version 2.3.1]\n- Impact: [Customer checkout failures, lost revenue ~$X/hour]\n- Recent changes: [Updated payment gateway integration, increased worker threads from 10 to 20]\n- Error pattern in logs: ["connection refused to payment-service:8080", "Java heap space"]\n\nEnvironment: production / eks-prod-us-east-1\nRelated services: payment-service, inventory-service, redis-session-store'},{id:"root-cause-increased-5xx-errors",title:"Find root cause of increased 5xx errors in API gateway",content:'Find root cause of increased 5xx errors in API gateway\n\nweb_log_1m_unmatched and web_log_1m_bad_requests are spiking. Context:\n- Affected endpoints: [/api/v2/checkout, /api/v2/inventory/check]\n- Started when: [Right after payments-service v1.5.0 deployment]\n- External factors: [Marketing campaign launched, 3x normal traffic, new payment provider integration went live]\n- Customer impact: [Cart abandonment up 40%, support tickets about "payment errors"]'},{id:"high-memory-usage",title:"What's causing high memory usage on node web-prod-03?",content:"What's causing high memory usage on node web-prod-03?\n\nThe system.ram utilization alert triggered. Additional context:\n- Recent changes: [Deployed new caching strategy, increased Node.js heap size to 4GB]\n- This node runs: [customer-facing API, websocket connections for live chat]\n- Business impact: [Customer complaints about slow page loads, chat disconnections]\n- Different from other nodes because: [Only node running the legacy monolith alongside microservices]"},{id:"microservices-causing-latency",title:"Which microservices are causing latency in user requests?",content:'Which microservices are causing latency in user requests?\n\nUser experience context:\n- Customer complaints: [Mobile app "freezing" during checkout, web pages taking 5+ seconds to load]\n- Started: [After microservices migration last week]\n- Critical user journeys affected: [Login \u2192 Browse \u2192 Add to Cart \u2192 Checkout]\n\nArchitecture context:\n- Total microservices: [23 services in production]\n- Recent changes: [Split monolith into user, catalog, and order services]\n- Service mesh: [Using Istio with mTLS enabled]\n- Tracing: [Jaeger deployed but only 10% sampling]\n\nSpecific issues observed:\n- [Cascading timeouts during peak hours]\n- [Checkout service calling 7 different services synchronously]\n- [No circuit breakers implemented yet]\n\nBusiness impact: [Cart abandonment up 25%, mobile app store rating dropped to 3.2 stars]'}]},{id:"analyze-change",title:"Analyze a change",items:[{id:"compare-system-metrics",title:"Compare system metrics before and after recent deployment",content:"Compare system metrics before and after recent deployment\n\nDeployment details:\n- Service: user-authentication-service v2.2.0\n- Deployed: 2025-01-24 09:00 UTC\n- Changes: [Switched from JWT to Redis sessions, added Argon2 password hashing, implemented rate limiting]\n\nSpecific concerns:\n- [Users reporting intermittent logouts]\n- [Session persistence issues after pod restarts]\n- [Suspicious increase in redis_connected_clients]\n\nTime windows: 24h before deployment vs 24h after"},{id:"redis-affect-cache-performance",title:"How did the Redis upgrade affect cache performance?",content:"How did the Redis upgrade affect cache performance?\n\nUpgrade: Redis 6.2.7 \u2192 7.2.0 on 2025-01-22 02:00 UTC\n\nBusiness context:\n- [Product catalog cache serving Black Friday traffic prep]\n- [Concerns about new Redis features overhead]\n- [Need to validate investment in upgrade was worthwhile]\n\nSpecific checks needed:\n- Impact on our Node.js connection pooling\n- Whether new eviction policies are better for our use case\n- Any compatibility issues with our caching library"},{id:"impact-of-scaling-from-3-to-5",title:"Show impact of scaling from 3 to 5 replicas on user-service",content:"Show impact of scaling from 3 to 5 replicas on user-service\n\nScaling event: 2025-01-23 15:00 UTC (HPA triggered by cpu.utilization > 80%)\n\nBusiness context:\n- [New feature launch driving 30% more traffic]\n- [Customer complaints about slow profile pages]\n- [Preparing for Super Bowl Sunday traffic spike]\n\nSpecific concerns:\n- [Database connection pool exhaustion errors in logs]\n- [Uneven load distribution despite round-robin LB]\n- [Session affinity issues after scaling]"},{id:"what-changed-in-network-traffic-patterns-this-week",title:"What changed in network traffic patterns this week?",content:"What changed in network traffic patterns this week?\n\nContext for unusual patterns:\n- [Launched new mobile app on Tuesday]\n- [CDN configuration changed Thursday - moved static assets to new domain]\n- [Office VPN migration might be affecting internal traffic]\n- [New customer in Asia significantly increasing APAC traffic]\n\nSpecific concerns:\n- [20% increase in AWS bandwidth costs]\n- [European users reporting latency issues]\n- [Suspicious traffic spike from specific IP ranges]\n\nInfrastructure: AWS multi-region with Istio service mesh"}]},{id:"optimize-performance",title:"Optimize performance",items:[{id:"additional-resources",title:"Which services would benefit most from additional resources?",content:"Which services would benefit most from additional resources?\n\nBusiness context:\n- Budget: [Additional $5K/month approved for scaling]\n- Growth: [20% MoM traffic increase, Black Friday prep needed]\n- New features coming: [Real-time inventory, ML-based recommendations]\n\nCurrent pain points:\n- [Payment service timeouts during flash sales]\n- [Search service degradation when catalog updates run]\n- [Batch processing jobs failing due to OOM kills]\n\nSLA requirements:\n- API 95th percentile < 200ms\n- Search results < 500ms\n- Payment processing < 2s\n\nHelp prioritize which services to scale first for maximum business impact."},{id:"identify-underutilized-nodes-for-cost-optimization",title:"Identify underutilized nodes for cost optimization",content:"Identify underutilized nodes for cost optimization\n\nContext:\n- Monthly AWS bill: [$12K for compute]\n- Environment: Mixed workloads (prod + staging on same cluster)\n- Constraints: [Need 2 nodes per AZ for HA, GPU nodes must stay for ML workloads]\n\nKnown issues:\n- [Dev environments running 24/7 but only used 9-5]\n- [Batch processing nodes idle 20h/day]\n- [Overprovisioned after last Black Friday, traffic never reached expected levels]\n\nGoal: Find $2-3K/month in savings without impacting reliability"},{id:"analyze-container-resource-limits-vs-actual-usage",title:"Analyze container resource limits vs actual usage",content:"Analyze container resource limits vs actual usage\n\nCurrent state:\n- Total pods: [150 across production]\n- Resource requests/limits set: [Only 60% have proper limits defined]\n- Recent OOMKills: [12 in the last week]\n\nProblem indicators:\n- [Some pods using 10% of requested resources (overprovisioned)]\n- [Others constantly hitting CPU throttling]\n- [Memory limits based on old load tests from 2023]\n- [Java apps with -Xmx not aligned with container limits]\n\nBusiness impact:\n- [Wasting ~$3K/month on overprovisioned resources]\n- [Critical services getting throttled during peak hours]\n- [Unpredictable performance affecting SLAs]\n\nRecent changes:\n- [Migrated from VMs to containers 6 months ago]\n- [Copied VM resource allocations without optimization]\n- [Traffic patterns changed significantly after new feature launch]\n\nGoal: Right-size all containers for optimal performance and cost"},{id:"predict-capacity-needs-for-black-friday-traffic",title:"Predict capacity needs for Black Friday traffic",content:"Predict capacity needs for Black Friday traffic\n\nLast year's data:\n- Peak: 50K concurrent users, 2K orders/minute\n- Growth rate: 40% YoY\n- Multiplier: 8-10x normal traffic\n\nCurrent limitations:\n- Payment gateway: 100 TPS rate limit\n- Database connections: 200 max\n- Redis memory: 32GB per node\n- CDN: 100TB monthly quota\n\nBusiness requirements:\n- Zero downtime\n- <500ms response time during peak\n- Handle 3K orders/minute\n- Support new livestream shopping feature\n\nWhat's our scaling strategy and when should we start provisioning?"}]}]}}]);