Skip to content

Commit 9585bab

Browse files
author
Mark Gritter
authored
[POA-3218] Fill in pod names in initial telemetry. (#92)
The daemonset (or an environment variable) uses tags on the learn session to identify the pod; this copies them into the telemetry as well. Depends on postmanlabs/observability-shared-libs#227 (won't compile until `go get` updated.)
1 parent 0127863 commit 9585bab

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

apidump/apidump.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ func (a *apidump) SendInitialTelemetry() {
244244
DockerDesktop: env.HasDockerInternalHostAddress(),
245245
}
246246

247+
if pod, present := a.Args.Tags[tags.XAkitaKubernetesPod]; present {
248+
req.MonitoredPodName = pod
249+
hostname, err := os.Hostname()
250+
if err != nil {
251+
req.AgentPodName = hostname
252+
}
253+
}
254+
247255
ctx, cancel := context.WithTimeout(context.Background(), telemetryTimeout)
248256
defer cancel()
249257
err := a.learnClient.PostInitialClientTelemetry(ctx, a.backendSvc, req)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/OneOfOne/xxhash v1.2.8
88
github.com/Pallinder/go-randomdata v1.2.0
99
github.com/akitasoftware/akita-ir v0.0.0-20241213050034-057d7b6097e8
10-
github.com/akitasoftware/akita-libs v0.0.0-20250207124702-a568277a6ab6
10+
github.com/akitasoftware/akita-libs v0.0.0-20250314233547-6ff5afce3bf6
1111
github.com/akitasoftware/go-utils v0.0.0-20240213133309-b95d4ace8803
1212
github.com/andybalholm/brotli v1.0.1
1313
github.com/aws/aws-sdk-go-v2 v1.17.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ github.com/akitasoftware/akita-ir v0.0.0-20241213050034-057d7b6097e8 h1:sf2aaOG8
3030
github.com/akitasoftware/akita-ir v0.0.0-20241213050034-057d7b6097e8/go.mod h1:WEWPzhZtxlJnov3MxcqSDiZaHHf00vs3aJwCdt3OwzA=
3131
github.com/akitasoftware/akita-libs v0.0.0-20250207124702-a568277a6ab6 h1:HPvFcp1WwGGM7ebxe/F07RKpE7w4fMSiGCJa95fC+Jw=
3232
github.com/akitasoftware/akita-libs v0.0.0-20250207124702-a568277a6ab6/go.mod h1:Fg14kX6+N7we3KdP1c11W/SzbKsgapV1hP5d4Z/Hqwc=
33+
github.com/akitasoftware/akita-libs v0.0.0-20250314233547-6ff5afce3bf6 h1:kuJ8kv8oG3h+B7MZF3x5sj4z/WTmJaNlC5FxM41fh9c=
34+
github.com/akitasoftware/akita-libs v0.0.0-20250314233547-6ff5afce3bf6/go.mod h1:Fg14kX6+N7we3KdP1c11W/SzbKsgapV1hP5d4Z/Hqwc=
3335
github.com/akitasoftware/go-utils v0.0.0-20240213133309-b95d4ace8803 h1:ebIh/EFuaP8GczzMe8EwVID/blSv5Tej6S8NE4xyarQ=
3436
github.com/akitasoftware/go-utils v0.0.0-20240213133309-b95d4ace8803/go.mod h1:+IOXf7l/QCAQECJzjJwhTp1sBkRoJ6WciZwJezUwBa4=
3537
github.com/akitasoftware/gopacket v1.1.18-0.20240820200020-7289ae956f70 h1:VnU7QLDBwRujpQoHwShs5yu0Ahv1fSalNJa4UijwlmY=

0 commit comments

Comments
 (0)