Skip to main content

Configuration reference

Census reads one TOML file, given with --config <path>, or config.toml in the current directory. Before it reads the file, Census replaces ${NAME} with the value of the environment variable NAME, or an empty string, and ${NAME:-default} with the value or, when it is unset or empty, default.

Census refuses a setting it does not know, so a misspelled key stops startup instead of being ignored.

[server]​

Required.

SettingRequiredDefaultMeaning
bindYesAddress and port of the API, the webhook receiver, the API reference and the web UI, for example 0.0.0.0:8080.

[memgraph]​

Required.

SettingRequiredDefaultMeaning
bolt_urlYesMemgraph's Bolt address, for example bolt://localhost:7687.
userNoemptyMemgraph user.
passwordNoemptyMemgraph password.

[branching]​

Optional. Bounds the branch views Census holds.

SettingRequiredDefaultMeaning
max_viewsNo3Branch views held at once. A query for one more branch retires the view read least recently.
idle_ttlNo1hCensus retires a branch view that no query has read for this long.

[[connections]]​

One table per source system. Connect source systems describes them.

SettingRequiredDefaultMeaning
idYesUnique among connections. Names the webhook route /webhooks/{id}.
typeYesinfrahub or netbox.
endpointYesThe source system's address.
api_keyNoemptyInfrahub API key, or NetBox API token.
branchNomainInfrahub only: the branch the default view reads.
webhook_secretNononeInfrahub only: the secret that signs webhooks.
external_base_urlNononeThe address browsers use to reach the source, for links to source objects. An absolute http or https address with a host.
external_base_url_fallbackNoendpointWithout external_base_url: endpoint builds links from endpoint; error builds no links and reports an error in their place.

[inventories.<id>]​

One table per inventory. Define an inventory describes it.

SettingRequiredDefaultMeaning
descriptionNoemptyShown to consumers.
entity_kindNoemptyThe kind of entity, for example device. Shown to consumers only.
priorityYesEvery contribution id, once each, highest priority first.

[inventories.<id>.fields.<name>]​

SettingRequiredDefaultMeaning
typeYesstring, number or boolean.
vocabularyNononeCanonical values, of the field's type.
defaultNononeA vocabulary value used for a supplied value with no mapping.
priorityNothe inventory'sEvery contribution id, once each, for this field.

[inventories.<id>.freshness]​

KeyDefaultMeaning
default1hBudget of every field without its own, and of the location.
any field namethe default keyBudget of that field.

[inventories.<id>.location]​

Required. Declare the location hierarchy describes it.

SettingRequiredDefaultMeaning
levelsYesLevel names, top first.
locationsNoemptyEvery location as a /-joined path.
priorityNothe inventory'sEvery contribution id, once each, for the location.

[[inventories.<id>.contributions]]​

One table per contribution. Add a contribution describes it.

SettingRequiredDefaultMeaning
idYesUnique within the inventory.
connectionYesA connection id.
object_typesYesInfrahub node kinds or NetBox API paths.
hfidYesPath of the source field that supplies the HFID.
refresh_intervalNo5mInterval between full refreshes.
attributesNoemptyTable of field name to source field path.
valuesNoemptyTable of field name to a table of source value to canonical value.
defaultsNoemptyTable of field name to canonical value. Overrides the field's default for this contribution.
locationNoemptyTable of level name to source field path.
location_valuesNoemptyTable of level name to a table of source name to declared name.

Durations are a number followed by s, m, h or d, or a number of seconds, and must be greater than zero.

Rules Census checks at startup​

Census checks every rule before it connects to Memgraph or to any source. The first rule that fails stops startup, with a message that names the inventory, the contribution or field, and the rule number.

RuleWhat it requires
C1Connection ids are unique. type is infrahub or netbox.
C2Inventory ids match ^[a-z0-9][a-z0-9_-]*$.
C3Each inventory has at least one field and one contribution. Field and level names match ^[a-z][a-z0-9_]*$.
C4A field's type is string, number or boolean.
C5Every vocabulary value has the field's type. default is in vocabulary, and requires vocabulary.
C6Contribution ids are unique within the inventory. connection names a declared connection. object_types is not empty. hfid is not empty.
C7Every attributes, values and defaults key is a declared field. values and defaults are allowed only for fields with a vocabulary. Every values target and every defaults value is in the vocabulary.
C8The priority of the inventory, of each field and of the location lists every contribution of the inventory exactly once.
C9levels is not empty. Every location path has 1 to len(levels) names. Every path's parent is declared. No path is declared twice. Names do not contain /.
C10Every location and location_values key is a declared level. Every location_values target is a name declared at that level.
C11Durations parse. Freshness keys are default or declared fields.

Sections that are no longer supported​

A file with one of these sections is refused, with a message naming its replacement.

SectionReplacement
[schema][inventories.<id>.fields.<name>]
[budgets][inventories.<id>.freshness]
[normalization.<field>]vocabulary on each field and values on each contribution
[matching]None: identity is the HFID, and priority orders contributions.
[[sources]][[connections]] for the connection, and [[inventories.<id>.contributions]] for object types, attributes and refresh interval