pinpoint-apm/pinpoint · warning
invalid hostGroupName='<hostGroupName>'
Error message
invalid hostGroupName='<hostGroupName>'
What it means
Pinpoint's TelegrafMetricController rejects HTTP requests whose hostGroupName path/query parameter fails isValidGroupName (regex validation). It returns HTTP 400 with the message so telemetry ingestion is refused until a valid group name is supplied.
Source
Thrown at metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/collector/controller/TelegrafMetricController.java:91
this.tenantProvider = Objects.requireNonNull(tenantProvider, "tenantProvider");
}
@PostMapping(value = "/telegraf")
public ResponseEntity<String> saveSystemMetric(
@RequestHeader(value = "hostGroupName") String hostGroupName,
@RequestBody TelegrafMetrics telegrafMetrics, BindingResult bindingResult
) throws BindException {
if (bindingResult.hasErrors()) {
SimpleErrorMessage simpleErrorMessage = new SimpleErrorMessage(bindingResult);
logger.warn("metric binding error. header=hostGroupName:{} errorCount:{} {}", hostGroupName, bindingResult.getErrorCount(), simpleErrorMessage);
throw new BindException(bindingResult);
}
if (!isValidGroupName(hostGroupName)) {
logger.warn("invalid hostGroupName='{}'", hostGroupName);
return ResponseEntity.badRequest().body("invalid hostGroupName='" + hostGroupName + "'");
}
String hostName = getHost(telegrafMetrics);
if (StringUtils.isEmpty(hostName)) {
// hostname null check
logger.info("hostName is empty. hostGroupName={}", hostGroupName);
return ResponseEntity.badRequest().body("hostName is empty");
}
if (!isValidHostName(hostName)) {
logger.warn("invalid hostName='{}', hostGroupName='{}'", hostName, hostGroupName);
}
if (logger.isDebugEnabled()) {
logger.debug("hostGroupName:{} host:{} size:{}", hostGroupName, hostName, telegrafMetrics.size());
}
String tenantId = tenantProvider.getTenantId();
View on GitHub (pinned to 744c3d3075)
Solutions
- Correct the hostGroupName in the telegraf/client config to match the allowed pattern (alphanumeric, dash, underscore, dot typically)
- Check the isValidGroupName regex in TelegrafMetricController and conform to it
- URL-encode the hostGroupName in the request path/query
- Inspect the 400 response body, which echoes the exact invalid value sent
Example fix
# before (telegraf.conf) urls = ["http://collector:8080/telegraf/metrics/systemMetric/my group/hosts"] # after urls = ["http://collector:8080/telegraf/metrics/systemMetric/my-group/hosts"]
Defensive patterns
Strategy: validation
Validate before calling
function isValidHostGroupName(name) {
return typeof name === 'string' && /^[a-zA-Z0-9._-]+$/.test(name);
}
// check before POSTing to the telegraf system-metric endpoint Type guard
function isNonEmptyString(v) {
return typeof v === 'string' && v.length > 0;
} Try / catch
const res = await fetch(url, { method: 'POST', body });
if (res.status === 400) {
const msg = await res.text();
if (msg.startsWith('invalid hostGroupName=')) {
// fix the group name in config and retry
}
} Prevention
- Validate hostGroupName against the collector's regex before deploying telegraf config
- Use only alphanumeric characters, dashes, underscores, dots in group names
- URL-encode path/query parameters when building metric endpoint URLs
- Check for HTTP 400 responses from the metric collector during CI/deploy
When it happens
Trigger: POSTing telegraf metrics to the system-metric endpoint with a hostGroupName containing characters outside the allowed pattern (spaces, slashes, special characters) or an empty value.
Common situations: Telegraf config or client scripts with unencoded or wrong group names; dashboards configured with a group name renamed on the collector; deployments where the telegraf hostGroupName tag contains hostnames with invalid characters.
Understand the failure class
Background: "Invalid query parameter" / "Failed to parse value of ...": fixing bad query string parameters across APIs — this error's family across 36 libraries.
Related errors
- Resource attribute `service.name` is required to save OTLP m
- hostName is empty
- value
- customMetricName must consist of {GroupName}/{MetricName}/La
- negative tick
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/e400745cf8920839.
Report an issue: GitHub.