Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: yeya24 <yb532204897@gmail.com>
- Loading branch information
Showing
7 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//args: -Epromlinter | ||
package testdata | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
) | ||
|
||
var ( | ||
_ = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ // Metric: test_metric_name Error: counter metrics should have "_total" suffix | ||
Name: "test_metric_name", | ||
Help: "test help text", | ||
}, []string{}, | ||
) | ||
|
||
_ = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ // Metric: test_metric_total Error: no help text | ||
Name: "test_metric_total", | ||
}, []string{}, | ||
) | ||
|
||
_ = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ // Metric: metric_type_in_name_counter_total Error: metric name should not include type 'counter' | ||
Name: "metric_type_in_name_counter_total", | ||
Help: "foo", | ||
}, []string{}, | ||
) | ||
|
||
_ = prometheus.NewHistogram(prometheus.HistogramOpts{ // Metric: test_duration_milliseconds Error: use base unit "seconds" instead of "milliseconds" | ||
Name: "test_duration_milliseconds", | ||
Help: "", | ||
}) | ||
) |