2018-06-29 12:44:16 +03:00
|
|
|
# metadata
|
|
|
|
|
|
|
|
|
|
## Name
|
|
|
|
|
|
2018-07-06 09:41:37 +01:00
|
|
|
*metadata* - enable a meta data collector.
|
2018-06-29 12:44:16 +03:00
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
2018-07-06 09:41:37 +01:00
|
|
|
By enabling *metadata* any plugin that implements [metadata.Provider
|
|
|
|
|
interface](https://godoc.org/github.com/coredns/coredns/plugin/metadata#Provider) will be called for
|
|
|
|
|
each DNS query, at beginning of the process for that query, in order to add it's own Metadata to
|
|
|
|
|
context.
|
2018-06-29 12:44:16 +03:00
|
|
|
|
2018-07-06 09:41:37 +01:00
|
|
|
The metadata collected will be available for all plugins, via the Context parameter
|
|
|
|
|
provided in the ServeDNS function. The package (code) documentation has examples on how to inspect
|
|
|
|
|
and retrieve metadata a plugin might be interested in.
|
|
|
|
|
|
|
|
|
|
TODO: write about naming of the keys (labels).
|
|
|
|
|
TODO: write about extracting and using
|
2018-06-29 12:44:16 +03:00
|
|
|
|
|
|
|
|
## Syntax
|
|
|
|
|
|
|
|
|
|
~~~
|
|
|
|
|
metadata [ZONES... ]
|
|
|
|
|
~~~
|
|
|
|
|
|
2018-07-06 09:41:37 +01:00
|
|
|
* **ZONES** zones metadata should be invoked for.
|
|
|
|
|
|
2018-06-29 12:44:16 +03:00
|
|
|
## Plugins
|
|
|
|
|
|
2018-07-06 09:41:37 +01:00
|
|
|
metadata.Provider interface needs to be implemented by each plugin willing to provide metadata
|
|
|
|
|
information for other plugins. It will be called by metadata and gather the information from all
|
|
|
|
|
plugins in context.
|
2018-06-29 12:44:16 +03:00
|
|
|
|
2018-07-06 09:41:37 +01:00
|
|
|
Note: this method should work quickly, because it is called for every request.
|
2018-06-29 12:44:16 +03:00
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
2018-07-06 09:41:37 +01:00
|
|
|
There are currently no in tree plugins that write or use metadata.
|
2018-06-29 12:44:16 +03:00
|
|
|
|
2018-07-06 09:41:37 +01:00
|
|
|
## Also See
|
2018-06-29 12:44:16 +03:00
|
|
|
|
2018-07-06 09:41:37 +01:00
|
|
|
The [Provider interface](https://godoc.org/github.com/coredns/coredns/plugin/metadata#Provider) and
|
|
|
|
|
the [package level](https://godoc.org/github.com/coredns/coredns/plugin/metadata) documentation.
|