github.com/newrelic/go-agent@v3.26.0+incompatible/internal/crossagent/cross_agent_tests/utilization/utilization_json.json (about) 1 [ 2 { 3 "testname": "only agent derived data", 4 "input_total_ram_mib": 1024, 5 "input_logical_processors": 8, 6 "input_hostname": "myhost", 7 "input_full_hostname": "myhost.com", 8 "input_ip_address": ["1.2.3.4", "1.2.3.5"], 9 "expected_output_json": { 10 "metadata_version": 5, 11 "logical_processors": 8, 12 "total_ram_mib": 1024, 13 "hostname": "myhost", 14 "full_hostname": "myhost.com", 15 "ip_address": ["1.2.3.4", "1.2.3.5"] 16 } 17 }, 18 { 19 "testname": "only agent derived but bad data", 20 "input_total_ram_mib": null, 21 "input_logical_processors": null, 22 "input_hostname": "myotherhost", 23 "input_full_hostname": "myotherhost.com", 24 "input_ip_address": ["2001:0db8:0000:0042:0000:8a2e:0370:7334"], 25 "expected_output_json": { 26 "metadata_version": 5, 27 "logical_processors": null, 28 "total_ram_mib": null, 29 "hostname": "myotherhost", 30 "full_hostname": "myotherhost.com", 31 "ip_address": ["2001:0db8:0000:0042:0000:8a2e:0370:7334"] 32 } 33 }, 34 { 35 "testname": "agent derived null and some environment variables", 36 "input_total_ram_mib": null, 37 "input_logical_processors": null, 38 "input_hostname": "myotherhost", 39 "input_full_hostname": "myotherhost.com", 40 "input_ip_address": ["::FFFF:129.144.52.38"], 41 "input_environment_variables": { 42 "NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS": 8, 43 "NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB": 2048 44 }, 45 "expected_output_json": { 46 "metadata_version": 5, 47 "logical_processors": null, 48 "total_ram_mib": null, 49 "hostname": "myotherhost", 50 "full_hostname": "myotherhost.com", 51 "ip_address": ["::FFFF:129.144.52.38"], 52 "config": { 53 "logical_processors": 8, 54 "total_ram_mib": 2048 55 } 56 } 57 }, 58 { 59 "testname": "all environment variables", 60 "input_total_ram_mib": 1, 61 "input_logical_processors": 2, 62 "input_hostname": "myotherhost", 63 "input_full_hostname": "myotherhost.com", 64 "input_ip_address": ["8.8.8.8"], 65 "input_environment_variables": { 66 "NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS": 16, 67 "NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB": 4096, 68 "NEW_RELIC_UTILIZATION_BILLING_HOSTNAME": "localhost" 69 }, 70 "expected_output_json": { 71 "metadata_version": 5, 72 "logical_processors": 2, 73 "total_ram_mib": 1, 74 "hostname": "myotherhost", 75 "full_hostname": "myotherhost.com", 76 "ip_address": ["8.8.8.8"], 77 "config": { 78 "logical_processors": 16, 79 "total_ram_mib": 4096, 80 "hostname": "localhost" 81 } 82 } 83 }, 84 { 85 "testname": "all environment variables with error in processors", 86 "input_total_ram_mib": 1024, 87 "input_logical_processors": 4, 88 "input_hostname": "myotherhost", 89 "input_full_hostname": "myotherhost.com", 90 "input_ip_address": ["2001:0db8:0000:0042:0000:8a2e:0370:7334"], 91 "input_environment_variables": { 92 "NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS": "abc", 93 "NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB": 4096, 94 "NEW_RELIC_UTILIZATION_BILLING_HOSTNAME": "localhost" 95 }, 96 "expected_output_json": { 97 "metadata_version": 5, 98 "logical_processors": 4, 99 "total_ram_mib": 1024, 100 "hostname": "myotherhost", 101 "full_hostname": "myotherhost.com", 102 "ip_address": ["2001:0db8:0000:0042:0000:8a2e:0370:7334"], 103 "config": { 104 "total_ram_mib": 4096, 105 "hostname": "localhost" 106 } 107 } 108 }, 109 { 110 "testname": "all environment variables with error in ram", 111 "input_total_ram_mib": 1024, 112 "input_logical_processors": 4, 113 "input_hostname": "myotherhost", 114 "input_full_hostname": "myotherhost.com", 115 "input_ip_address": ["2001:0db8:0000:0042:0000:8a2e:0370:7334"], 116 "input_environment_variables": { 117 "NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS": 8, 118 "NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB": "notgood", 119 "NEW_RELIC_UTILIZATION_BILLING_HOSTNAME": "localhost" 120 }, 121 "expected_output_json": { 122 "metadata_version": 5, 123 "logical_processors": 4, 124 "total_ram_mib": 1024, 125 "hostname": "myotherhost", 126 "full_hostname": "myotherhost.com", 127 "ip_address": ["2001:0db8:0000:0042:0000:8a2e:0370:7334"], 128 "config": { 129 "logical_processors": 8, 130 "hostname": "localhost" 131 } 132 } 133 }, 134 { 135 "testname": "only agent derived data with aws", 136 "input_total_ram_mib": 2048, 137 "input_logical_processors": 8, 138 "input_hostname": "myotherhost", 139 "input_full_hostname": "myotherhost.com", 140 "input_ip_address": ["1.2.3.4"], 141 "input_aws_id": "8BADFOOD", 142 "input_aws_type": "t2.micro", 143 "input_aws_zone": "us-west-1", 144 "expected_output_json": { 145 "metadata_version": 5, 146 "logical_processors": 8, 147 "total_ram_mib": 2048, 148 "hostname": "myotherhost", 149 "full_hostname": "myotherhost.com", 150 "ip_address": ["1.2.3.4"], 151 "vendors": { 152 "aws": { 153 "instanceId": "8BADFOOD", 154 "instanceType": "t2.micro", 155 "availabilityZone": "us-west-1" 156 } 157 } 158 } 159 }, 160 { 161 "testname": "invalid agent derived data with aws", 162 "input_total_ram_mib": 2048, 163 "input_logical_processors": 8, 164 "input_hostname": "myotherhost", 165 "input_full_hostname": "myotherhost.com", 166 "input_ip_address": ["1.2.3.4"], 167 "input_aws_id": null, 168 "input_aws_type": "t2.micro", 169 "input_aws_zone": "us-west-1", 170 "expected_output_json": { 171 "metadata_version": 5, 172 "logical_processors": 8, 173 "total_ram_mib": 2048, 174 "hostname": "myotherhost", 175 "full_hostname": "myotherhost.com", 176 "ip_address": ["1.2.3.4"] 177 } 178 }, 179 { 180 "testname": "only agent derived data with gcp", 181 "input_total_ram_mib": 2048, 182 "input_logical_processors": 8, 183 "input_hostname": "myotherhost", 184 "input_full_hostname": "myotherhost.com", 185 "input_ip_address": ["1.2.3.4"], 186 "input_gcp_id": "3161347020215157000", 187 "input_gcp_type": "projects/492690098729/machineTypes/custom-1-1024", 188 "input_gcp_name": "aef-default-20170501t160547-7gh8", 189 "input_gcp_zone": "projects/492690098729/zones/us-central1-c", 190 "expected_output_json": { 191 "metadata_version": 5, 192 "logical_processors": 8, 193 "total_ram_mib": 2048, 194 "hostname": "myotherhost", 195 "full_hostname": "myotherhost.com", 196 "ip_address": ["1.2.3.4"], 197 "vendors": { 198 "gcp": { 199 "id": "3161347020215157000", 200 "machineType": "custom-1-1024", 201 "name": "aef-default-20170501t160547-7gh8", 202 "zone": "us-central1-c" 203 } 204 } 205 } 206 }, 207 { 208 "testname": "invalid agent derived data with gcp", 209 "input_total_ram_mib": 2048, 210 "input_logical_processors": 8, 211 "input_hostname": "myotherhost", 212 "input_full_hostname": "myotherhost.com", 213 "input_ip_address": ["1.2.3.4"], 214 "input_gcp_id": "3161347020215157000", 215 "input_gcp_type": "projects/492690098729/machineTypes/custom-1-1024", 216 "input_gcp_name": null, 217 "input_gcp_zone": "projects/492690098729/zones/us-central1-c", 218 "expected_output_json": { 219 "metadata_version": 5, 220 "logical_processors": 8, 221 "total_ram_mib": 2048, 222 "hostname": "myotherhost", 223 "full_hostname": "myotherhost.com", 224 "ip_address": ["1.2.3.4"] 225 } 226 }, 227 { 228 "testname": "only agent derived data with pcf", 229 "input_total_ram_mib": 2048, 230 "input_logical_processors": 8, 231 "input_hostname": "myotherhost", 232 "input_full_hostname": "myotherhost.com", 233 "input_ip_address": ["1.2.3.4"], 234 "input_pcf_guid": "b977d090-83db-4bdb-793a-bb77", 235 "input_pcf_ip": "10.10.147.130", 236 "input_pcf_mem_limit": "1024m", 237 "expected_output_json": { 238 "metadata_version": 5, 239 "logical_processors": 8, 240 "total_ram_mib": 2048, 241 "hostname": "myotherhost", 242 "full_hostname": "myotherhost.com", 243 "ip_address": ["1.2.3.4"], 244 "vendors": { 245 "pcf": { 246 "cf_instance_guid": "b977d090-83db-4bdb-793a-bb77", 247 "cf_instance_ip": "10.10.147.130", 248 "memory_limit": "1024m" 249 } 250 } 251 } 252 }, 253 { 254 "testname": "invalid agent derived data with pcf", 255 "input_total_ram_mib": 2048, 256 "input_logical_processors": 8, 257 "input_hostname": "myotherhost", 258 "input_full_hostname": "myotherhost.com", 259 "input_ip_address": ["1.2.3.4"], 260 "input_pcf_guid": null, 261 "input_pcf_ip": "10.10.147.130", 262 "input_pcf_mem_limit": "1024m", 263 "expected_output_json": { 264 "metadata_version": 5, 265 "logical_processors": 8, 266 "total_ram_mib": 2048, 267 "hostname": "myotherhost", 268 "full_hostname": "myotherhost.com", 269 "ip_address": ["1.2.3.4"] 270 } 271 }, 272 { 273 "testname": "only agent derived data with azure", 274 "input_total_ram_mib": 2048, 275 "input_logical_processors": 8, 276 "input_hostname": "myotherhost", 277 "input_full_hostname": "myotherhost.com", 278 "input_ip_address": ["1.2.3.4"], 279 "input_azure_location": "CentralUS", 280 "input_azure_name": "IMDSCanary", 281 "input_azure_id": "5c08b38e-4d57-4c23-ac45-aca61037f084", 282 "input_azure_size": "Standard_DS2", 283 "expected_output_json": { 284 "metadata_version": 5, 285 "logical_processors": 8, 286 "total_ram_mib": 2048, 287 "hostname": "myotherhost", 288 "full_hostname": "myotherhost.com", 289 "ip_address": ["1.2.3.4"], 290 "vendors": { 291 "azure": { 292 "location": "CentralUS", 293 "name": "IMDSCanary", 294 "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084", 295 "vmSize": "Standard_DS2" 296 } 297 } 298 } 299 }, 300 { 301 "testname": "invalid agent derived data with azure", 302 "input_total_ram_mib": 2048, 303 "input_logical_processors": 8, 304 "input_hostname": "myotherhost", 305 "input_full_hostname": "myotherhost.com", 306 "input_ip_address": ["1.2.3.4"], 307 "input_azure_location": "CentralUS", 308 "input_azure_name": "IMDSCanary", 309 "input_azure_id": null, 310 "input_azure_size": "Standard_DS2", 311 "expected_output_json": { 312 "metadata_version": 5, 313 "logical_processors": 8, 314 "total_ram_mib": 2048, 315 "hostname": "myotherhost", 316 "full_hostname": "myotherhost.com", 317 "ip_address": ["1.2.3.4"] 318 } 319 }, 320 { 321 "testname": "kubernetes service host environment variable", 322 "input_total_ram_mib": null, 323 "input_logical_processors": null, 324 "input_hostname": "myotherhost", 325 "input_full_hostname": "myotherhost.com", 326 "input_ip_address": ["::FFFF:129.144.52.38"], 327 "input_environment_variables": { 328 "NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS": 8, 329 "NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB": 2048, 330 "KUBERNETES_SERVICE_HOST": "10.96.0.1" 331 }, 332 "expected_output_json": { 333 "metadata_version": 5, 334 "logical_processors": null, 335 "total_ram_mib": null, 336 "hostname": "myotherhost", 337 "full_hostname": "myotherhost.com", 338 "ip_address": ["::FFFF:129.144.52.38"], 339 "config": { 340 "logical_processors": 8, 341 "total_ram_mib": 2048 342 }, 343 "vendors": { 344 "kubernetes": { 345 "kubernetes_service_host": "10.96.0.1" 346 } 347 } 348 } 349 }, 350 { 351 "testname": "only kubernetes service port environment variable", 352 "input_total_ram_mib": null, 353 "input_logical_processors": null, 354 "input_hostname": "myotherhost", 355 "input_full_hostname": "myotherhost.com", 356 "input_ip_address": ["::FFFF:129.144.52.38"], 357 "input_environment_variables": { 358 "NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS": 8, 359 "NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB": 2048, 360 "KUBERNETES_SERVICE_PORT": "8080" 361 }, 362 "expected_output_json": { 363 "metadata_version": 5, 364 "logical_processors": null, 365 "total_ram_mib": null, 366 "hostname": "myotherhost", 367 "full_hostname": "myotherhost.com", 368 "ip_address": ["::FFFF:129.144.52.38"], 369 "config": { 370 "logical_processors": 8, 371 "total_ram_mib": 2048 372 } 373 } 374 } 375 ]