File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -537,9 +537,12 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
537
537
return internal .NormalizeMetricFamilies (metricFamiliesByName ), errs .MaybeUnwrap ()
538
538
}
539
539
540
- // WriteToTextfile formats the metrics of the provided Gatherer interface and
541
- // emits them in text format to the path. Intended for use with the node_exporter
542
- // textfile collector
540
+ // WriteToTextfile calls Gather on the provided Gatherer, encodes the result in the
541
+ // Prometheus text format, and writes it to a temporary file. Upon success, the
542
+ // temporary file is renamed to the provided filename.
543
+ //
544
+ // This is intended for use with the textfile collector of the node exporter.
545
+ // Note that the node exporter expects the filename to be suffixed with ".prom".
543
546
func WriteToTextfile (filename string , g Gatherer ) error {
544
547
tmp , err := ioutil .TempFile (filepath .Dir (filename ), filepath .Base (filename ))
545
548
if err != nil {
You can’t perform that action at this time.
0 commit comments