<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Development on HUATUO Documentation</title>
    <link>https://docs.huatuo.tech/en/v2.3.0/development/</link>
    <description>Recent content in Development on HUATUO Documentation</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Thu, 13 Aug 2026 21:53:16 +0800</lastBuildDate>
    <atom:link href="https://docs.huatuo.tech/en/v2.3.0/development/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Extending Observability</title>
      <link>https://docs.huatuo.tech/en/v2.3.0/development/custom-observability/</link>
      <pubDate>Sat, 18 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://docs.huatuo.tech/en/v2.3.0/development/custom-observability/</guid>
      <description>&lt;p&gt;HUATUO supports three extension types: Metrics, Event, and AutoTracing. They use&#xA;the same registration framework but differ in activation, runtime cost, and&#xA;data output.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Type&lt;/th&gt;&#xA;          &lt;th&gt;Activation&lt;/th&gt;&#xA;          &lt;th&gt;Data output&lt;/th&gt;&#xA;          &lt;th&gt;Use case&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Metrics&lt;/td&gt;&#xA;          &lt;td&gt;Periodic collection&lt;/td&gt;&#xA;          &lt;td&gt;Prometheus&lt;/td&gt;&#xA;          &lt;td&gt;Continuous performance monitoring and long-term trends&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Event&lt;/td&gt;&#xA;          &lt;td&gt;Kernel event or threshold&lt;/td&gt;&#xA;          &lt;td&gt;ES, local files, optional Prometheus&lt;/td&gt;&#xA;          &lt;td&gt;Continuous operation with anomaly context capture&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;AutoTracing&lt;/td&gt;&#xA;          &lt;td&gt;System anomaly&lt;/td&gt;&#xA;          &lt;td&gt;ES, local files, optional Prometheus&lt;/td&gt;&#xA;          &lt;td&gt;On-demand, higher-cost context capture&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;h2 id=&#34;collection-modes&#34;&gt;Collection Modes&lt;a class=&#34;td-heading-self-link&#34; href=&#34;#collection-modes&#34; aria-label=&#34;Heading self-link&#34;&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;metrics&#34;&gt;Metrics&lt;a class=&#34;td-heading-self-link&#34; href=&#34;#metrics&#34; aria-label=&#34;Heading self-link&#34;&gt;&lt;/a&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Metrics periodically collect system state through procfs, sysfs, or eBPF and&#xA;expose it in Prometheus format. This mode supports real-time monitoring and&#xA;long-term trend analysis. Built-in collectors cover:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Development Debugging</title>
      <link>https://docs.huatuo.tech/en/v2.3.0/development/debugging/</link>
      <pubDate>Sat, 18 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://docs.huatuo.tech/en/v2.3.0/development/debugging/</guid>
      <description>&lt;h2 id=&#34;full-stack-integration&#34;&gt;Full-Stack Integration&lt;a class=&#34;td-heading-self-link&#34; href=&#34;#full-stack-integration&#34; aria-label=&#34;Heading self-link&#34;&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;The development Compose configuration builds an image from the current&#xA;workspace and starts the collector, API Server, Elasticsearch, Prometheus, and&#xA;Grafana. The collector needs access to the host kernel and cgroups, so run the&#xA;command with root privileges from the repository root on a Linux host:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo make compose-dev-up&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Compose aggregates all component logs in the foreground. After changing the&#xA;source, press &lt;code&gt;Ctrl+C&lt;/code&gt; and run the command again. Docker reuses the toolchain&#xA;layers and Go build cache.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Integration Test</title>
      <link>https://docs.huatuo.tech/en/v2.3.0/development/integration/</link>
      <pubDate>Wed, 04 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://docs.huatuo.tech/en/v2.3.0/development/integration/</guid>
      <description>&lt;p&gt;This integration test validates that &lt;strong&gt;huatuo-bamai&lt;/strong&gt; can start correctly with mocked &lt;code&gt;/proc&lt;/code&gt; and &lt;code&gt;/sys&lt;/code&gt; filesystems and expose the expected &lt;strong&gt;Prometheus metrics&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The test runs the real &lt;code&gt;huatuo-bamai&lt;/code&gt; binary and verifies the &lt;code&gt;/metrics&lt;/code&gt;endpoint output without relying on the host kernel or hardware.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-the-script-does&#34;&gt;What the Script Does&lt;a class=&#34;td-heading-self-link&#34; href=&#34;#what-the-script-does&#34; aria-label=&#34;Heading self-link&#34;&gt;&lt;/a&gt;&lt;/h3&gt;&#xA;&lt;p&gt;The integration test performs the following steps:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Generates a temporary &lt;code&gt;bamai.conf&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Starts &lt;code&gt;huatuo-bamai&lt;/code&gt; with mocked &lt;code&gt;procfs&lt;/code&gt; and &lt;code&gt;sysfs&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Waits for the Prometheus &lt;code&gt;/metrics&lt;/code&gt; endpoint to become available&lt;/li&gt;&#xA;&lt;li&gt;Fetches all metrics from &lt;code&gt;/metrics&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Verifies that all expected metrics exist&lt;/li&gt;&#xA;&lt;li&gt;Stops the service and cleans up resources&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;If any expected metric is missing, the test fails.&lt;/p&gt;</description>
    </item>
    <item>
      <title>BPF ABI Guide</title>
      <link>https://docs.huatuo.tech/en/v2.3.0/development/bpf_abi_codegen/</link>
      <pubDate>Wed, 04 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://docs.huatuo.tech/en/v2.3.0/development/bpf_abi_codegen/</guid>
      <description>&lt;p&gt;The C structures on the BPF side are the source of truth for the perf event&#xA;ABI. Go types are generated automatically from BTF in the BPF objects. Do not&#xA;maintain equivalent structures manually.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conventions&#34;&gt;Conventions&lt;a class=&#34;td-heading-self-link&#34; href=&#34;#conventions&#34; aria-label=&#34;Heading self-link&#34;&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Each ABI domain maps to one C header and one generated Go file:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Item&lt;/th&gt;&#xA;          &lt;th&gt;Convention&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Domain name&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;&amp;lt;domain&amp;gt;&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;C header&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;bpf/include/abi/&amp;lt;domain&amp;gt;_types.h&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;C structure prefix&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;&amp;lt;domain&amp;gt;_&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Generated Go file&lt;/td&gt;&#xA;          &lt;td&gt;&lt;code&gt;internal/bpf/abi/&amp;lt;domain&amp;gt;_types_generated.go&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;domain&amp;gt;&lt;/code&gt; must start with a lowercase letter and contain only lowercase&#xA;letters, digits, and underscores. Avoid domains with overlapping prefixes,&#xA;such as &lt;code&gt;net&lt;/code&gt; and &lt;code&gt;net_rx&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Time Format Contract</title>
      <link>https://docs.huatuo.tech/en/v2.3.0/development/time-format/</link>
      <pubDate>Wed, 22 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://docs.huatuo.tech/en/v2.3.0/development/time-format/</guid>
      <description>&lt;h1 id=&#34;time-format-contract&#34;&gt;Time Format Contract&lt;a class=&#34;td-heading-self-link&#34; href=&#34;#time-format-contract&#34; aria-label=&#34;Heading self-link&#34;&gt;&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;HUATUO serializes timestamps in UTC with fixed nanosecond precision:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;2006-01-02T15:04:05.000000000Z&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For example, an event captured at half past midnight on 22 July 2026 is written as:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;2026-07-22T00:30:00.123456789Z&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;why-fixed-utc-precision&#34;&gt;Why fixed UTC precision&lt;a class=&#34;td-heading-self-link&#34; href=&#34;#why-fixed-utc-precision&#34; aria-label=&#34;Heading self-link&#34;&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Every host emits the same timezone (&lt;code&gt;Z&lt;/code&gt;), so distributed queries do not need timezone-specific handling.&lt;/li&gt;&#xA;&lt;li&gt;The nine fractional digits keep the string width fixed. Lexical ordering therefore matches chronological ordering, which is useful for log files and keyword-indexed storage.&lt;/li&gt;&#xA;&lt;li&gt;Nanoseconds preserve the precision supplied by Go&amp;rsquo;s &lt;code&gt;time.Time&lt;/code&gt; and by event-tracing pipelines.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;integration-guidance&#34;&gt;Integration guidance&lt;a class=&#34;td-heading-self-link&#34; href=&#34;#integration-guidance&#34; aria-label=&#34;Heading self-link&#34;&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;When producing data for HUATUO, format times with the canonical helper:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
