diff --git a/.gitignore b/.gitignore index 1dce148f7c..ab5c9a8bb9 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,7 @@ yarn-error.log* /ingest/__pycache__/ /myenv/ venv -.python-version \ No newline at end of file +.python-version + +# Test coverage reports +/coverage/ \ No newline at end of file diff --git a/docs/ask-netdata.mdx b/docs/ask-nedi.mdx similarity index 63% rename from docs/ask-netdata.mdx rename to docs/ask-nedi.mdx index 7e3afeb702..7ccad52f5b 100644 --- a/docs/ask-netdata.mdx +++ b/docs/ask-nedi.mdx @@ -1,24 +1,25 @@ --- -id: ask-netdata +id: ask-nedi title: " " -sidebar_label: "Ask Netdata Docs" +sidebar_label: "Ask Nedi" sidebar_position: 1 hide_title: true hide_table_of_contents: true pagination_prev: null pagination_next: null custom_edit_url: null -slug: /ask-netdata +full_page: true +slug: /ask-nedi part_of_learn: True ---
) - const hasBlockLevelContent = React.Children.toArray(children).some(child => { - if (!React.isValidElement(child)) return false; - - // Check for CodeBlock component directly - if (child.type === CodeBlock) return true; - - // Check for CodeBlockWrapper (our custom wrapper) - if (child.type === CodeBlockWrapper) return true; - - // Check if it's a code element that's not inline - if (child.type === 'code' && child.props && !child.props.inline) return true; - - // Check for any element with codeBlock-related classes - if (child.props && child.props.className) { - const className = String(child.props.className); - if (className.includes('codeBlock') || className.includes('language-')) return true; - } - - // Check for pre tags - if (child.type === 'pre') return true; - - return false; - }); - - if (hasBlockLevelContent) { - // Return children without paragraph wrapper - return <>{children}>; - } - - // Normal paragraph - return
{children}
; - }; - - // Markdown renderer pieces used inside chat messages - const MermaidWrapper = ({ value }) => { - const mermaidRef = useRef(null); - const [renderError, setRenderError] = useState(false); - - // Use the value directly without sanitization since LLM provides proper diagrams - const trimmedValue = value ? value.trim() : ''; - const mermaidTypes = [ - 'graph', 'flowchart', 'sequenceDiagram', 'classDiagram', 'stateDiagram', - 'erDiagram', 'journey', 'gantt', 'pie', 'gitgraph', 'mindmap', - 'timeline', 'sankey', 'block-beta', 'packet-beta', 'architecture-beta' - ]; - - // More lenient check: just see if it starts with a known diagram type - const isValidMermaid = trimmedValue && - mermaidTypes.some(type => { - // Case-insensitive match at start of string - return new RegExp(`^${type}\\b`, 'i').test(trimmedValue); - }); - - // Check if the diagram content is complete - must have at least one diagram type and NO incomplete arrows - const isContentComplete = trimmedValue && ( - // Must start with a diagram type - mermaidTypes.some(type => new RegExp(`^${type}\\b`, 'i').test(trimmedValue)) && - // Must not have lines ending with incomplete arrows - !trimmedValue.split('\n').some(line => { - const arrowMatch = line.match(/--[->](?:\|[^|]+\|)?$/); - return arrowMatch; // Returns true if line ends with an incomplete arrow - }) - ); - - - // Initialize and render Mermaid - useEffect(() => { - // Only attempt rendering if validation passes and content looks complete - if (!isValidMermaid || renderError || !isContentComplete) { - if (!isValidMermaid) { - mermaidLog('[Mermaid] ⏭️ Skipping - validation failed'); - } else if (!isContentComplete) { - mermaidLog('[Mermaid] ⏳ Waiting for complete content... Current length:', trimmedValue.length); - } - return; - } - - const renderDiagram = async () => { - try { - mermaidLog('[Mermaid] 🔍 Checking for mermaid library...'); - - // Try to load mermaid from window or import - let mermaid = null; - if (typeof window !== 'undefined' && window.mermaid) { - mermaid = window.mermaid; - mermaidLog('[Mermaid] ✓ Found mermaid on window object'); - } else { - mermaidLog('[Mermaid] ⚠️ Mermaid not found on window, trying dynamic import...'); - try { - const mermaidModule = await import('mermaid'); - mermaid = mermaidModule.default || mermaidModule; - mermaidLog('[Mermaid] ✓ Loaded mermaid via dynamic import'); - } catch (importError) { - console.error('[Mermaid] ❌ Failed to import mermaid:', importError); - } - } - - if (!mermaid) { - console.error('[Mermaid] ❌ Mermaid library not available'); - setRenderError(true); - return; - } - - mermaidLog('[Mermaid] 🎨 Attempting to render diagram'); - mermaidLog('[Mermaid] Diagram lines:', trimmedValue.split('\n').length); - mermaidLog('[Mermaid] First 200 chars:', trimmedValue.substring(0, 200)); - - // Initialize mermaid - mermaid.initialize({ - startOnLoad: false, - theme: document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default', - securityLevel: 'loose', - suppressErrorRendering: true, - }); - - // Set the content and let mermaid render directly to the element - if (mermaidRef.current) { - mermaidRef.current.textContent = trimmedValue; - mermaidRef.current.removeAttribute('data-processed'); - await mermaid.run({ nodes: [mermaidRef.current] }); - console.log('[Mermaid] ✅ Successfully rendered mermaid diagram'); - } - - } catch (error) { - console.error('[Mermaid] ❌ RENDER FAILED - Error:', error); - console.error('[Mermaid] Error details:', error.message || error.str); - console.warn('[Mermaid] Diagram content that failed:', trimmedValue); - setRenderError(true); - } - }; - - // Delay to ensure content is complete and DOM is ready - // Large diagrams need more time to stream in completely - const timer = setTimeout(renderDiagram, 1000); - return () => clearTimeout(timer); - }, [trimmedValue, isValidMermaid, renderError, isContentComplete]); - - // If we already encountered a render error, show code block - if (renderError) { - mermaidLog('[Mermaid] 📦 Showing code block due to render error'); - return ( -{titleSubtitle}
} -{truncated}
- ); - })()} - {/* Breadcrumb for learn_rel_path */} - {result.learn_rel_path && ( -Get instant answers from Netdata documentation
-I can help you with:
-Just type your question below to get started.
-$1')
- .replace(/\*\*([^*]+)\*\*/g, '$1')
- .replace(/\*([^*]+)\*/g, '$1')
- .replace(/\n/g, 'This is a notice
+First paragraph
+Second paragraph
+
+ To edit the
+
+ go.d/example.conf
+
+
+ configuration file:
+
+
+ cd /etc/netdata
+
+
+
+ edit-config
+
+
+
+ script to edit
+
+ go.d/example.conf
+
+ .
+
+
+ sudo ./edit-config
+ go.d/example.conf
+
+
+
+ enabled: yes
+
+ .
+
+ sudo systemctl restart netdata
+
+ or the
+
+
+ appropriate method
+
+
+ for your system.
+ + For all available options, please see the module + + + configuration file + + . +
+
+ To troubleshoot issues with the
+
+ example
+
+ collector, run the
+
+ go.d.plugin
+
+ with the debug option enabled.
+
+ /usr/libexec/netdata/plugins.d/
+
+ . If that's not the case on your system, open
+
+ netdata.conf
+
+ and look for the setting
+
+ plugins directory
+
+ .
+
+
+ netdata
+
+ user.
+
+
+ cd /usr/libexec/netdata/plugins.d/ sudo -u netdata -s
+
+
+
+
+ go.d.plugin
+
+ in debug mode to identify issues:
+
+
+ ./
+ go.d.plugin
+ -d -m
+ example
+
+
+ + The output should give you clues as to why the collector isn't working. +
+
+
+
+ wget -O /tmp/netdata-kickstart.sh https://get.netdata.cloud/kickstart.sh && sh /tmp/netdata-kickstart.sh --no-updates --stable-channel --disable-telemetry --claim-token TEST_TOKEN
+
+
+
+
+ curl https://get.netdata.cloud/kickstart.sh > /tmp/netdata-kickstart.sh && sh /tmp/netdata-kickstart.sh
+
+
+
+
+ wget -O /tmp/netdata-kickstart.sh https://get.netdata.cloud/kickstart.sh && sh /tmp/netdata-kickstart.sh
+
+
+
+ By default, the Agent collects metrics once per second (
+
+ 1
+
+ ). See the
+
+ update every
+
+ setting in your
+
+ netdata.conf
+
+ file if yours may be different. If you have streaming nodes, use the average of their settings.
+
+ To find this value for an Agent, scroll to the bottom of the dashboard to find the number of metrics your Agent collects. If you have streaming nodes, input the average of these values. +
++ To find this value, click on the + + Netdata Monitoring + + → + + dbengine + + items in the right-hand menu and look at the first chart under the + + dbengine + + section. You can also use your browser's search feature to look for + + compression savings ratio + + . Estimate an average value to input into the calculator. +
+
+ Open your
+
+ netdata.conf
+
+ file and find the
+
+ page cache size
+
+ setting in the
+
+ [global]
+
+ section.
+
+ With the above configuration, Netdata will use the following resources + to store metrics + : +
+ +
+ 330
+ MiB
+
+ in total disk space
+
+
+
+ 67
+ MiB
+
+ in system memory
+
+
+ To enable this setup,
+
+ edit your
+
+ netdata.conf
+
+
+ file
+ and change the
+
+ dbengine multihost disk space
+
+ setting to the following:
+
+
+ [global]
+ dbengine multihost disk space = 330
+
+
+
+ Restart your Agent with
+
+ service netdata restart
+
+ for the setting to take effect.
+
+ Your Agent now stores metrics for
+ 1
+ day
+ using a total of
+
+ 330
+ MiB
+
+ in disk space.
+
+ dbengine multihost disk space
+
+ /
+
+ dbengine disk space
+
+ setting and
+
+ dimensions-being-collected * 4096 * 2
+
+ .
+ + First paragraph +
+
+ Some code
+
+ Paragraph content
+First paragraph
+Some code
+ Test content
MDX wrapped content
+