.agents/skills/integrations-lifecycle/how-tos/taxonomy-yaml-to-taxonomy-json.md
integrations/taxonomy.jsonQuestion answered: what is the general flow from collector
metadata.yaml and taxonomy.yaml to the generated dashboard
taxonomy artifact consumed by downstream frontend code?
metadata.yaml is the metric-context source of truth. Collector
taxonomy.yaml files organize those contexts into the dashboard table
of contents. integrations/gen_taxonomy.py validates both sides
against the taxonomy registries and schemas, then emits the gitignored
integrations/taxonomy.json cross-repo contract.
The implementation details can evolve, but the durable model is:
The taxonomy pipeline reads four source classes:
metadata.yaml files. The generator loads collector
modules through the shared integrations loader and extracts metric
contexts from metrics.scopes[].metrics[].name; see
integrations/gen_taxonomy.py:269-276.taxonomy.yaml files. These live next to collector
metadata and use the closed v1 authoring schema
integrations/schemas/taxonomy_collector.json.integrations/taxonomy/sections.yaml. This registry owns stable
section_id targets and parentage for the generated TOC section
tree; schema: integrations/schemas/taxonomy_sections.json.integrations/taxonomy/icons.yaml. This registry limits the icon IDs
sections and placements may reference.The field-level contract is documented in
../schema-reference.md. The contributor workflow is documented in
../recipes/add-go-collector.md and
../recipes/update-collector.md.
The generator first builds metadata indexes from all known collector metadata:
by_path_module: matches a taxonomy.yaml file to its sibling
metadata.yaml module by path, plugin_name, and module_name.all_contexts: sorted global list of known metric contexts, used for
prefix resolution.contexts_by_plugin: contexts grouped by plugin name, used for
collect_plugin selectors.metrics.dynamic_context_prefixes and
metrics.dynamic_collect_plugins.The relevant implementation is integrations/gen_taxonomy.py:286-315.
This is why metadata.yaml is the metric source of truth: a literal
context in taxonomy authoring is valid only if the sibling metadata
module declares it. A taxonomy file can organize and reference metric
contexts; it cannot invent static metric contexts.
Each collector taxonomy.yaml is loaded and validated against the
closed authoring schema before semantic validation. The schema rejects
old or ambiguous shapes such as placement-level contexts:,
section_path:, and string shorthand in display-only positions.
After schema validation, the generator checks:
section_id exists in sections.yaml;icons.yaml;unresolved escape hatch;The matching and semantic validation start in
integrations/gen_taxonomy.py:745-790. Selector and literal-reference
validation live around integrations/gen_taxonomy.py:438-526.
The generated artifact separates ownership from display references:
type: owned_context own literal contexts.type: selector owns the contexts matched by
context_prefix or collect_plugin.group, flatten, grid, first_available, and
view_switch aggregate context snapshots from their children.type: context display widgets reference contexts through
contexts: but do not own them.Generated items and placements therefore carry:
resolved_contexts: contexts owned by that node after child and
selector aggregation.referenced_contexts: contexts referenced by display widgets.unresolved_references: staged widget references that intentionally
do not resolve yet, with reason, owner, expires, and
item_path.The recursive emission logic is in integrations/gen_taxonomy.py:551-719.
The FE-facing meaning of the generated fields is documented in
../in-app-contract.md.
The generated artifact is integrations/taxonomy.json. It is validated
against integrations/schemas/taxonomy_output.json and is intentionally
gitignored.
Top-level shape:
{
"taxonomy_schema_version": 1,
"source": {},
"sections": [],
"placements": [],
"opted_out_collectors": []
}
Important output concepts:
sections[] is the resolved global section registry.placements[] is the ordered list of collector-owned TOC placements.placements[].items[] is the normalized recursive item tree.collector_ids links a placement back to the integration IDs produced
from metadata.section_id is the stable registry handle; section_path is the
resolved path for consumers.Assembly, deterministic placement sorting, and output schema validation
are handled in integrations/gen_taxonomy.py:847-883. Writing is handled
by the generator CLI in integrations/gen_taxonomy.py:890-920.
Pull requests run the taxonomy checker from
.github/workflows/check-markdown.yml. The checker:
taxonomy.yaml, adds/removes it, or edits metric-bearing parts of
metadata.yaml;See .github/workflows/check-markdown.yml:45-58 and
integrations/check_collector_taxonomy.py.
The master regeneration workflow runs integrations/gen_taxonomy.py as
part of the integrations regeneration job; see
.github/workflows/generate-integrations.yml:59-68. The generated
taxonomy.json is still a runtime/downstream contract artifact, not a
committed source file.
For a static collector such as MySQL:
metadata.yaml declares mysql.queries.mysql/taxonomy.yaml owns mysql.queries in a structural item.mysql.queries.mysql.queries in
resolved_contexts because it is owned, and in
referenced_contexts where the widget uses it.For a dynamic collector such as SNMP:
metadata.yaml declares a dynamic namespace such as snmp..snmp/taxonomy.yaml may use a narrower selector like
snmp.device_prof_ under that declared namespace.Files read:
integrations/gen_taxonomy.pyintegrations/check_collector_taxonomy.pyintegrations/schemas/taxonomy_collector.jsonintegrations/schemas/taxonomy_output.json.github/workflows/check-markdown.yml.github/workflows/generate-integrations.yml../schema-reference.md../in-app-contract.mdCommands used during the original analysis:
rg -n "def module_contexts|def build_metadata_indexes|def process_taxonomy_file|def emit_item|def build_taxonomy" integrations/gen_taxonomy.py
rg -n "gen_taxonomy|check_collector_taxonomy|taxonomy.json|taxonomy.yaml" .github/workflows integrations/README.md .agents/skills/integrations-lifecycle/taxonomy.md