grafana/k6 · error

a tag name (%s) shows up more than once in InfluxDB field ty

Error message

a tag name (%s) shows up more than once in InfluxDB field type configurations

What it means

The K6_INFLUXDB_TAGS_AS_FIELDS configuration maps the same tag/field name to more than one field type. checkDuplicatedTypeDefinitions is a guard that rejects a field kind map containing duplicate entries for a tag name.

Source

Thrown at internal/output/influxdb/util.go:56

	return client.NewHTTPClient(clientHTTPConfig)
}

// MakeBatchConfig returns a new InfluxDB BatchPointsConfig based on the given
func MakeBatchConfig(conf Config) client.BatchPointsConfig {
	if !conf.DB.Valid || conf.DB.String == "" {
		conf.DB = null.StringFrom("k6")
	}
	return client.BatchPointsConfig{
		Precision:        conf.Precision.String,
		Database:         conf.DB.String,
		RetentionPolicy:  conf.Retention.String,
		WriteConsistency: conf.Consistency.String,
	}
}

func checkDuplicatedTypeDefinitions(fieldKinds map[string]FieldKind, tag string) error {
	if _, found := fieldKinds[tag]; found {
		return fmt.Errorf("a tag name (%s) shows up more than once in InfluxDB field type configurations", tag)
	}
	return nil
}

// MakeFieldKinds reads the Config and returns a lookup map of tag names to
// the field type their values should be converted to.
func MakeFieldKinds(conf Config) (map[string]FieldKind, error) {
	fieldKinds := make(map[string]FieldKind)
	for _, tag := range conf.TagsAsFields {
		fieldName, fieldType, _ := strings.Cut(tag, ":")
		if fieldType == "" {
			fieldType = "string"
		}

		err := checkDuplicatedTypeDefinitions(fieldKinds, fieldName)
		if err != nil {
			return nil, err
		}

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Ensure each tag appears only once in K6_INFLUXDB_TAGS_AS_FIELDS with a single type suffix
  2. Change conflicting entries to use one consistent type, e.g. my_tag:float
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/output/influxdb/util.go:56 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/02c5b81585a2d481. Report an issue: GitHub.