hashicorp / hashicorp/nomad

`nomad.client.allocs.memory.usage` reports 0 for jobs with raw_exec driver

Open
#9,073 12 comments 0 reactions 0 assignees View on GitHub
stage/accepted theme/metrics type/bug
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version

Nomad v0.12.3 (2db8abd9620dd41cb7bfe399551ba0f7824b3f61)

### Operating system and Environment details

This happens on both windows nodes and linux nodes

### Issue

Nomad reports wrong (`0`) _nomad.client.allocs.memory.usage_ metric for jobs with raw_exec driver

### Reproduction steps
deploy:
```
job "fake-joblinux" {
region = "global"
datacenters = [ "some-dc" ]

type = "service"

update {
stagger = "10s"
max_parallel = 1
}

group "fake-service-api-grouplinux" {
count = 1
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}

task "fake-api" {
driver = "raw_exec"

config {
command = "ping"
args = ["8.8.8.8"]
}

resources {
cpu = "200"
memory = "200"
}
}
}
}
```

and see `http://host-with-above-alloc/v1/metrics`:

```
{
"Labels": {
"alloc_id": "90025118-3928-68ad-d556-20633856ff52",
"task": "fake-api",
"namespace": "default",
"job": "fake-joblinux",
"task_group": "fake-service-api-grouplinux"
},
"Name": "nomad.client.allocs.memory.usage",
"Value": 0
},
```

### Job file (if appropriate)

see above

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by deploying the provided raw_exec job on a Linux or Windows node and querying the allocation's /v1/metrics endpoint. Compare nomad.client.allocs.memory.usage with the job's configured memory and verify that the metric no longer reports 0 for raw_exec allocations.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.