@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55you may not use this file except in compliance with the License.
66You may obtain a copy of the License at
77
8- http://www.apache.org/licenses/LICENSE-2.0
8+ http://www.apache.org/licenses/LICENSE-2.0
99
1010Unless required by applicable law or agreed to in writing, software
1111distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,10 +23,13 @@ import (
2323// metricsCmd represents the metrics command
2424var metricsCmd = & cobra.Command {
2525 Use : "metrics [query_string]" ,
26- Short : "Get a list of all prometheus metric names" ,
27- Long : `Get a list of all prometheus metric names` ,
26+ Short : "Get a list of prometheus metric names matching the provided query " ,
27+ Long : `Get a list of prometheus metric names matching the provided query. If no query is provided, all metric names will be returned. ` ,
2828 Run : func (cmd * cobra.Command , args []string ) {
2929 var r writer.SeriesResult
30+ if query == "" {
31+ query = `{job=~".+"}`
32+ }
3033 result , warnings , err := pql .SeriesQuery (query )
3134 if len (warnings ) > 0 {
3235 errlog .Printf ("Warnings: %v\n " , warnings )
0 commit comments