A Prometheus exporter for DSC files.
To install the dscexporter, simply download the binary of the latest GitHub release and copy it to a folder of your choice, like /usr/local/bin/.
The project is automatically built via GitHub Actions.
To build the project on your own, run:
make buildAfter installing the dscexporter to /usr/local/bin, the command dscexporter is available on your system.
To get an overview of the available flags, run:
dscexporter --helpThe only required parameter is the --config parameter, which specifies the path to your config file.
To run the dscexporter as a systemd service, you can use the example service file provided.
The dscexporter expects the following folder structure:
<data>/<location>/<nameserver>/<timestamp>.dscdata.xml
The data folder can be set via the CLI or the config file. The exporter uses the folder names as the values for the loc and ns labels.
In the config, you can configure the datasets that the dscexporter exports and the aggregations that are run on the datasets before export.
For an overview of the structure of the config, see example_config.yaml.
One of the most important configuration options is the timestamps setting.
The dscexporter supports exporting metrics with or without timestamps.
When timestamp export is enabled, the end time of the DSC files is used as the timestamp for the metrics.
Like aggregations or the Prometheus port, the configuration is done under the prometheus section.
Example:
prometheus:
timestamps: true
windowsize: 10- timestamps: Defines whether timestamps are exported.
- windowsize: Defines how many timestamps are exported.
A simple top-k filter that removes values of the second dimension that fall outside the top x.
The removed values are added to the -:SKIPPED:- and -:SKIPPED_SUM:- cells.
Example:
second_ld_vs_rcode:
aggregations:
SecondLD:
type: MaxCells
params:
x: 5Removes the given dimension. Useful when exporting a 2D dataset where only one dimension is of interest.
Example:
qtype_vs_qnamelen:
aggregations:
QnameLen:
type: EliminateDimensionThis results in a dataset that only monitors the qtypes.
Filters the values of a dimension to a specified list of allowed values. All other values are summed into a other value.
Note: Each parameter is an allowed value. The colon is required for YAML, the {} are optional.
Example:
qtype:
aggregations:
QType:
type: Filter
params:
"A": {}
"AAAA":
"NS":Exports the dataset using a histogram metric instead of the default counter metric.
Example 1 – For rcode_vs_replylen:
rcode_vs_replylen:
aggregations:
ReplyLen:
type: Bucket
params:
start: 31
width: 32
count: 40
⚠️ Note: When the dataset already contains ranges likeclient_port_range,start,width, andcountmust match the dataset values. Also the_summetric generated by histograms cannot be computed correctly because the exact values are unknown.
You can also set all CLI parameters in the config file:
remove: booldata: stringinterval: Durationprometheus.port: int
Refer to the example config file for usage.
⚠️ Important: The dscexporter does not track which files have already been exported. For production use, theremoveparameter must be set totrue.
Initial push without a tag:
git push origin refs/heads/mainThen add a tag and push it:
git tag v0.0.x
git push origin v0.0.x