Skip to content

Commit

Permalink
Update exporters/prometheus/exporter.go
Browse files Browse the repository at this point in the history
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
  • Loading branch information
fatsheep9146 and MrAlias committed Dec 2, 2022
1 parent 1782350 commit 3484326
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion exporters/prometheus/exporter.go
Expand Up @@ -395,7 +395,13 @@ func validateMetrics(name, description string, metricType *dto.MetricType, mfs m
return false, emf.GetHelp()
}
if emf.GetType() != *metricType {
global.Info(fmt.Sprintf("the type %q of instrument %q conflicts with existing type %q, drop the new one. Please use a view that selects this instrument, and rename to a different name", *metricType, name, emf.GetType()))
global.Error(
errors.New("instrument type conflict"),
"Using existing type definition.",
"instrument", name,
"existing", emf.GetType(),
"dropped", *metricType,
)
return true, ""
}
return false, ""
Expand Down

0 comments on commit 3484326

Please sign in to comment.