@@ -270,7 +270,7 @@ func TestSyncMetadataAndEmitEntityEvents(t *testing.T) {
270
270
"otel.entity.interval" : int64 (7200000 ), // 2h in milliseconds
271
271
"otel.entity.type" : "k8s.pod" ,
272
272
"otel.entity.id" : map [string ]any {"k8s.pod.uid" : "pod0" },
273
- "otel.entity.attributes" : map [string ]any {"pod.creation_timestamp" : "0001-01-01T00:00:00Z" , "k8s.pod.phase" : "Unknown" },
273
+ "otel.entity.attributes" : map [string ]any {"pod.creation_timestamp" : "0001-01-01T00:00:00Z" , "k8s.pod.phase" : "Unknown" , "k8s.namespace.name" : "test" , "k8s.pod.name" : "0" },
274
274
}
275
275
assert .EqualValues (t , expected , lr .Attributes ().AsRaw ())
276
276
assert .WithinRange (t , lr .Timestamp ().AsTime (), step1 , step2 )
@@ -324,7 +324,7 @@ func TestObjMetadata(t *testing.T) {
324
324
EntityType : "k8s.pod" ,
325
325
ResourceIDKey : "k8s.pod.uid" ,
326
326
ResourceID : "test-pod-0-uid" ,
327
- Metadata : allPodMetadata (map [string ]string {"k8s.pod.phase" : "Succeeded" }),
327
+ Metadata : allPodMetadata (map [string ]string {"k8s.pod.phase" : "Succeeded" , "k8s.pod.name" : "test-pod-0" , "k8s.namespace.name" : "test-namespace" }),
328
328
},
329
329
experimentalmetricmetadata .ResourceID ("container-id" ): {
330
330
EntityType : "container" ,
@@ -333,6 +333,10 @@ func TestObjMetadata(t *testing.T) {
333
333
Metadata : map [string ]string {
334
334
"container.status" : "running" ,
335
335
"container.creation_timestamp" : "0001-01-01T01:01:01Z" ,
336
+ "container.image" : "container-image-name" ,
337
+ "container.name" : "container-name" ,
338
+ "k8s.pod.name" : "test-pod-0" ,
339
+ "k8s.pod.uid" : "test-pod-0-uid" ,
336
340
},
337
341
},
338
342
},
@@ -359,6 +363,8 @@ func TestObjMetadata(t *testing.T) {
359
363
"k8s.statefulset.uid" : "test-statefulset-0-uid" ,
360
364
"k8s.pod.phase" : "Failed" ,
361
365
"k8s.pod.status_reason" : "Evicted" ,
366
+ "k8s.pod.name" : "test-pod-0" ,
367
+ "k8s.namespace.name" : "test-namespace" ,
362
368
}),
363
369
},
364
370
},
@@ -398,6 +404,8 @@ func TestObjMetadata(t *testing.T) {
398
404
"k8s.service.test-service" : "" ,
399
405
"k8s-app" : "my-app" ,
400
406
"k8s.pod.phase" : "Running" ,
407
+ "k8s.namespace.name" : "test-namespace" ,
408
+ "k8s.pod.name" : "test-pod-0" ,
401
409
}),
402
410
},
403
411
},
@@ -415,6 +423,7 @@ func TestObjMetadata(t *testing.T) {
415
423
"k8s.workload.kind" : "DaemonSet" ,
416
424
"k8s.workload.name" : "test-daemonset-1" ,
417
425
"daemonset.creation_timestamp" : "0001-01-01T00:00:00Z" ,
426
+ "k8s.namespace.name" : "test-namespace" ,
418
427
},
419
428
},
420
429
},
@@ -433,6 +442,7 @@ func TestObjMetadata(t *testing.T) {
433
442
"k8s.workload.name" : "test-deployment-1" ,
434
443
"k8s.deployment.name" : "test-deployment-1" ,
435
444
"deployment.creation_timestamp" : "0001-01-01T00:00:00Z" ,
445
+ "k8s.namespace.name" : "test-namespace" ,
436
446
},
437
447
},
438
448
},
@@ -450,6 +460,7 @@ func TestObjMetadata(t *testing.T) {
450
460
"k8s.workload.kind" : "HPA" ,
451
461
"k8s.workload.name" : "test-hpa-1" ,
452
462
"hpa.creation_timestamp" : "0001-01-01T00:00:00Z" ,
463
+ "k8s.namespace.name" : "test-namespace" ,
453
464
},
454
465
},
455
466
},
@@ -469,6 +480,7 @@ func TestObjMetadata(t *testing.T) {
469
480
"k8s.workload.kind" : "Job" ,
470
481
"k8s.workload.name" : "test-job-1" ,
471
482
"job.creation_timestamp" : "0001-01-01T00:00:00Z" ,
483
+ "k8s.namespace.name" : "test-namespace" ,
472
484
},
473
485
},
474
486
},
@@ -511,6 +523,7 @@ func TestObjMetadata(t *testing.T) {
511
523
"k8s.workload.kind" : "ReplicaSet" ,
512
524
"k8s.workload.name" : "test-replicaset-1" ,
513
525
"replicaset.creation_timestamp" : "0001-01-01T00:00:00Z" ,
526
+ "k8s.namespace.name" : "test-namespace" ,
514
527
},
515
528
},
516
529
},
@@ -534,6 +547,7 @@ func TestObjMetadata(t *testing.T) {
534
547
"k8s.workload.kind" : "ReplicationController" ,
535
548
"k8s.workload.name" : "test-replicationcontroller-1" ,
536
549
"replicationcontroller.creation_timestamp" : "0001-01-01T00:00:00Z" ,
550
+ "k8s.namespace.name" : "test-namespace" ,
537
551
},
538
552
},
539
553
},
0 commit comments