Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
Collecting all logstash metrics as Untyped
Browse files Browse the repository at this point in the history
  • Loading branch information
alxrem committed Sep 30, 2019
1 parent 8bad2d6 commit c4bf32b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (e *Exporter) collectMetrics(stats *Stats, ch chan<- prometheus.Metric) {
func (e *Exporter) collectTree(name string, data interface{}, labels prometheus.Labels, ch chan<- prometheus.Metric) {
if v, ok := parseData(data); ok {
if len(labels) == 0 {
metric := prometheus.NewGauge(prometheus.GaugeOpts{
metric := prometheus.NewUntyped(prometheus.UntypedOpts{
Namespace: namespace,
Name: name,
})
Expand All @@ -96,7 +96,7 @@ func (e *Exporter) collectTree(name string, data interface{}, labels prometheus.
for k := range labels {
labelNames = append(labelNames, k)
}
vec := prometheus.NewGaugeVec(prometheus.GaugeOpts{
vec := prometheus.NewUntypedVec(prometheus.UntypedOpts{
Namespace: namespace,
Name: name,
}, labelNames)
Expand Down Expand Up @@ -134,7 +134,7 @@ func (e *Exporter) collectFields(name string, data interface{}, labels prometheu

for field, v := range fields {
if v, ok := v.(float64); ok {
vec := prometheus.NewGaugeVec(prometheus.GaugeOpts{
vec := prometheus.NewUntypedVec(prometheus.UntypedOpts{
Namespace: namespace,
Name: name,
}, append(labelNames, "field"))
Expand Down

0 comments on commit c4bf32b

Please sign in to comment.