diff --git a/client/allocrunner/taskrunner/task_runner.go b/client/allocrunner/taskrunner/task_runner.go
index <HASH>..<HASH> 100644
--- a/client/allocrunner/taskrunner/task_runner.go
+++ b/client/allocrunner/taskrunner/task_runner.go
@@ -4,6 +4,7 @@ import (
 	"context"
 	"errors"
 	"fmt"
+	"strings"
 	"sync"
 	"time"
 
@@ -277,6 +278,25 @@ func (tr *TaskRunner) initLabels() {
 			Value: tr.taskName,
 		},
 	}
+
+	if tr.alloc.Job.ParentID != "" {
+		tr.baseLabels = append(tr.baseLabels, metrics.Label{
+			Name:  "parent_id",
+			Value: tr.alloc.Job.ParentID,
+		})
+		if strings.Contains(tr.alloc.Job.Name, "/dispatch-") {
+			tr.baseLabels = append(tr.baseLabels, metrics.Label{
+				Name:  "dispatch_id",
+				Value: strings.Split(tr.alloc.Job.Name, "/dispatch-")[1],
+			})
+		}
+		if strings.Contains(tr.alloc.Job.Name, "/periodic-") {
+			tr.baseLabels = append(tr.baseLabels, metrics.Label{
+				Name:  "periodic_id",
+				Value: strings.Split(tr.alloc.Job.Name, "/periodic-")[1],
+			})
+		}
+	}
 }
 
 func (tr *TaskRunner) Run() {
Port client portion of #<I> to new taskrunner

PR #<I> was merged to master *after* allocrunnerv2 was branched, so the
client-specific portions must be ported from master to arv2.