You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: convert space indentation to tabs in upstream-added template files
Commits ccee642 and e4e58cd added versioned-metrics support with
2-space indentation in metrics.go.tmpl, metrics_test.go.tmpl, and
config_test.go.tmpl. The check-template-tabs check added in this PR
now catches these. Convert all leading spaces to tabs (2 spaces per
tab) to pass the check. The generated code is unaffected because
mdatagen runs go/format (gofmt) over all generated files.
Assisted-by: Claude Sonnet 4.6
if {{ printf"%s"$metric.Migration.ThroughGates.EnableNew| publicVar }}FeatureGate.IsEnabled() {
411
-
if mb.metric{{ $name.Render }}.config.Enabled && mb.metric{{ $metric.Migration.To.Render }}.config.Enabled {
412
-
var disable bool
413
-
if mb.metric{{ $name.Render }}.data.Type() != mb.metric{{ $metric.Migration.To.Render }}.data.Type() {
414
-
// Disable legacy metric if legacy and latest have same name but different types
415
-
disable = true
416
-
settings.Logger.Warn("[WARNING] Legacy metric `{{ $name }}` disabled: same emitted name as `{{ $metric.Migration.To }}` with different type; only latest will be emitted")
417
-
}
418
-
if !slices.Equal(MetricsInfo.{{ $name.Render }}.Attributes, MetricsInfo.{{ $metric.Migration.To.Render }}.Attributes) {
419
-
// Disable legacy metric if legacy and latest have same name but different attributes
420
-
// The latest metric will emit both attribute sets during migration
421
-
disable = true
422
-
settings.Logger.Warn("[WARNING] Legacy metric `{{ $name }}` disabled: same emitted name as `{{ $metric.Migration.To }}` with different attributes; only latest will be emitted with combined attributes",
settings.Logger.Warn("[WARNING] metric `{{ $metric.Migration.To }}` requires feature gate `{{ $metric.Migration.ThroughGates.EnableNew }}` to be enabled, metric has been disabled")
434
-
}
435
-
}
436
-
{{- end }}
437
-
{{- end }}
408
+
{{- range$name, $metric:=.Metrics }}
409
+
{{- if$metric.Migration }}
410
+
if {{ printf"%s"$metric.Migration.ThroughGates.EnableNew| publicVar }}FeatureGate.IsEnabled() {
411
+
if mb.metric{{ $name.Render }}.config.Enabled && mb.metric{{ $metric.Migration.To.Render }}.config.Enabled {
412
+
var disable bool
413
+
if mb.metric{{ $name.Render }}.data.Type() != mb.metric{{ $metric.Migration.To.Render }}.data.Type() {
414
+
// Disable legacy metric if legacy and latest have same name but different types
415
+
disable = true
416
+
settings.Logger.Warn("[WARNING] Legacy metric `{{ $name }}` disabled: same emitted name as `{{ $metric.Migration.To }}` with different type; only latest will be emitted")
417
+
}
418
+
if !slices.Equal(MetricsInfo.{{ $name.Render }}.Attributes, MetricsInfo.{{ $metric.Migration.To.Render }}.Attributes) {
419
+
// Disable legacy metric if legacy and latest have same name but different attributes
420
+
// The latest metric will emit both attribute sets during migration
421
+
disable = true
422
+
settings.Logger.Warn("[WARNING] Legacy metric `{{ $name }}` disabled: same emitted name as `{{ $metric.Migration.To }}` with different attributes; only latest will be emitted with combined attributes",
settings.Logger.Warn("[WARNING] metric `{{ $metric.Migration.To }}` requires feature gate `{{ $metric.Migration.ThroughGates.EnableNew }}` to be enabled, metric has been disabled")
0 commit comments