> For the complete documentation index, see [llms.txt](https://vostok.gitbook.io/configuration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vostok.gitbook.io/configuration/concepts-and-basics/configuration-sources.md).

# Configuration sources

Configuration sources fetch data from storage (local files or remote APIs) and convert it to [settings nodes](/configuration/concepts-and-basics/settings-nodes.md), abstracting away actual data formats such as JSON or YAML.&#x20;

They are not meant to be consumed directly and should be used in conjunction with a [configuration provider](/configuration/concepts-and-basics/configuration-provider.md) (see [assign sources to types](/configuration/basic-scenarios/assign-sources-to-types.md) and [obtain settings from provider](/configuration/basic-scenarios/obtain-settings-from-provider.md) scenarios).

Sources are also responsible for data change detection. They expose a [reactive interface](https://github.com/vostok/configuration.abstractions/blob/master/Vostok.Configuration.Abstractions/IConfigurationSource.cs) with subscription support:

```
IObservable<(ISettingsNode settings, Exception error)> Observe();
```

On each update, triggered either periodically or by an internal event, the source emits a pair: `(settings, null)` on success or `(null, error)` on failure. It's not required to deduplicate settings or errors at this level, although it's never wrong to do so.

Sources must never block indefinitely while waiting for data and should rather publish `null` settings after a short initial timeout.

Sources must be thread-safe and should be designed to support multiple concurrent observers. It is also expected that every new observer would immediately receive a notification with current state upon subscription.

Here are some of the often used source implementations:

* [JSON source](/configuration/sources/json-sources.md)
* [ClusterConfig source](/configuration/sources/clusterconfig-source.md)
* [In-memory object source](/configuration/sources/object-source.md)

It's also possible to [implement a custom source](/configuration/advanced-scenarios/create-custom-sources.md).

### Related pages

{% content-ref url="/pages/-M6UTADDgHsbhsLBW0sK" %}
[Sources](/configuration/modules/sources.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M6UVj1U2Fsz9Tw8WSTE" %}
[Combine sources](/configuration/basic-scenarios/combine-sources.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M6UVluEtzPV2Wnw3ecH" %}
[Scope sources](/configuration/basic-scenarios/scope-sources.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M6UWSpceWH4dlGESpjn" %}
[Nest sources](/configuration/advanced-scenarios/nest-sources.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M6UcXEkAZiLz\_D3tafd" %}
[Transform sources](/configuration/advanced-scenarios/transform-sources.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M6UWINy\_pTAY7sE2I6\_" %}
[Create custom sources](/configuration/advanced-scenarios/create-custom-sources.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M6UVN1ntnmh0ltnCI5I" %}
[Assign sources to types](/configuration/basic-scenarios/assign-sources-to-types.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M6UVVWxjimC0yLfXc\_P" %}
[Obtain settings from provider](/configuration/basic-scenarios/obtain-settings-from-provider.md)
{% endcontent-ref %}
