@@ -47,6 +47,27 @@ export class TaskContextAPI {
4747 return { } ;
4848 }
4949
50+ get resourceAttributes ( ) : Attributes {
51+ if ( this . ctx ) {
52+ return {
53+ [ SemanticInternalAttributes . ENVIRONMENT_ID ] : this . ctx . environment . id ,
54+ [ SemanticInternalAttributes . ENVIRONMENT_TYPE ] : this . ctx . environment . type ,
55+ [ SemanticInternalAttributes . ORGANIZATION_ID ] : this . ctx . organization . id ,
56+ [ SemanticInternalAttributes . PROJECT_ID ] : this . ctx . project . id ,
57+ [ SemanticInternalAttributes . PROJECT_REF ] : this . ctx . project . ref ,
58+ [ SemanticInternalAttributes . PROJECT_NAME ] : this . ctx . project . name ,
59+ [ SemanticInternalAttributes . ORGANIZATION_SLUG ] : this . ctx . organization . slug ,
60+ [ SemanticInternalAttributes . ORGANIZATION_NAME ] : this . ctx . organization . name ,
61+ [ SemanticInternalAttributes . MACHINE_PRESET_NAME ] : this . ctx . machine ?. name ,
62+ [ SemanticInternalAttributes . MACHINE_PRESET_CPU ] : this . ctx . machine ?. cpu ,
63+ [ SemanticInternalAttributes . MACHINE_PRESET_MEMORY ] : this . ctx . machine ?. memory ,
64+ [ SemanticInternalAttributes . MACHINE_PRESET_CENTS_PER_MS ] : this . ctx . machine ?. centsPerMs ,
65+ } ;
66+ }
67+
68+ return { } ;
69+ }
70+
5071 get workerAttributes ( ) : Attributes {
5172 if ( this . worker ) {
5273 return {
@@ -68,22 +89,10 @@ export class TaskContextAPI {
6889 [ SemanticInternalAttributes . TASK_EXPORT_NAME ] : this . ctx . task . exportName ,
6990 [ SemanticInternalAttributes . QUEUE_NAME ] : this . ctx . queue . name ,
7091 [ SemanticInternalAttributes . QUEUE_ID ] : this . ctx . queue . id ,
71- [ SemanticInternalAttributes . ENVIRONMENT_ID ] : this . ctx . environment . id ,
72- [ SemanticInternalAttributes . ENVIRONMENT_TYPE ] : this . ctx . environment . type ,
73- [ SemanticInternalAttributes . ORGANIZATION_ID ] : this . ctx . organization . id ,
74- [ SemanticInternalAttributes . PROJECT_ID ] : this . ctx . project . id ,
75- [ SemanticInternalAttributes . PROJECT_REF ] : this . ctx . project . ref ,
76- [ SemanticInternalAttributes . PROJECT_NAME ] : this . ctx . project . name ,
7792 [ SemanticInternalAttributes . RUN_ID ] : this . ctx . run . id ,
7893 [ SemanticInternalAttributes . RUN_IS_TEST ] : this . ctx . run . isTest ,
79- [ SemanticInternalAttributes . ORGANIZATION_SLUG ] : this . ctx . organization . slug ,
80- [ SemanticInternalAttributes . ORGANIZATION_NAME ] : this . ctx . organization . name ,
8194 [ SemanticInternalAttributes . BATCH_ID ] : this . ctx . batch ?. id ,
8295 [ SemanticInternalAttributes . IDEMPOTENCY_KEY ] : this . ctx . run . idempotencyKey ,
83- [ SemanticInternalAttributes . MACHINE_PRESET_NAME ] : this . ctx . machine ?. name ,
84- [ SemanticInternalAttributes . MACHINE_PRESET_CPU ] : this . ctx . machine ?. cpu ,
85- [ SemanticInternalAttributes . MACHINE_PRESET_MEMORY ] : this . ctx . machine ?. memory ,
86- [ SemanticInternalAttributes . MACHINE_PRESET_CENTS_PER_MS ] : this . ctx . machine ?. centsPerMs ,
8796 } ;
8897 }
8998
0 commit comments