grafana/k6 · error

couldn't make point from sample: %w

Error message

couldn't make point from sample: %w

What it means

While converting a metric sample into an InfluxDB point, client.NewPoint rejected the combination of metric name, tags and field values (e.g. unsupported field type from tag-to-value extraction such as a bool mixed into numeric fields). batchFromSamples wraps that failure for the offending sample.

Source

Thrown at internal/output/influxdb/output.go:145

			values := make(map[string]any)
			if cached, ok := cache[sample.Tags]; ok {
				tags = cached.tags
				maps.Copy(values, cached.values)
			} else {
				tags = sample.Tags.Map()
				o.extractTagsToValues(tags, values)
				cache[sample.Tags] = cacheItem{tags, values}
			}
			values["value"] = sample.Value
			var p *client.Point
			p, err = client.NewPoint(
				sample.Metric.Name,
				tags,
				values,
				sample.Time,
			)
			if err != nil {
				return nil, fmt.Errorf("couldn't make point from sample: %w", err)
			}
			batch.AddPoint(p)
		}
	}

	return batch, nil
}

// Description returns a human-readable description of the output.
func (o *Output) Description() string {
	return fmt.Sprintf("InfluxDBv1 (%s)", o.Config.Addr.String)
}

// Start tries to open the specified JSON file and starts the goroutine for
// metric flushing. If gzip encoding is specified, it also handles that.
func (o *Output) Start() error {
	o.logger.Debug("Starting...")
	// Try to create the database if it doesn't exist. Failure to do so is USUALLY harmless; it

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Inspect the wrapped error for which field/tag caused it
  2. Check K6_INFLUXDB_TAGS_AS_FIELDS typing: the same tag must not be mapped to conflicting types (e.g. bool and float)
  3. Fix duplicate or inconsistent tag types across samples
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at internal/output/influxdb/output.go:145 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/b9081daf613d85b4. Report an issue: GitHub.