-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: changes to metadata.cloud.project.* fields collected for GCP
- cloud.project.id per the shared APM spec change - fix the bignum parsing of instance.id (we were losing precision before this change) - add instance.name (missed in the original impl?) Closes: #3614
- Loading branch information
Showing
7 changed files
with
105 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,128 +64,11 @@ module.exports = { | |
}, | ||
], | ||
gcp: [ | ||
{ | ||
name: 'gcp does not crash on empty response', | ||
response: {}, | ||
}, | ||
{ | ||
name: 'gcp unexpected string fixture', | ||
response: { | ||
instance: { | ||
zone: 123456, | ||
machineType: 123456, | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: 'default gcp fixture', | ||
response: { | ||
instance: { | ||
attributes: {}, | ||
cpuPlatform: 'Intel Broadwell', | ||
description: '', | ||
disks: [ | ||
{ | ||
deviceName: 'username-temp-delete-me-cloud-metadata', | ||
index: 0, | ||
interface: 'SCSI', | ||
mode: 'READ_WRITE', | ||
type: 'PERSISTENT', | ||
}, | ||
], | ||
guestAttributes: {}, | ||
hostname: | ||
'username-temp-delete-me-cloud-metadata.c.elastic-apm.internal', | ||
id: 7684572792595385000, | ||
image: | ||
'projects/debian-cloud/global/images/debian-10-buster-v20201216', | ||
legacyEndpointAccess: { | ||
0.1: 0, | ||
v1beta1: 0, | ||
}, | ||
licenses: [ | ||
{ | ||
id: '5543610867827062957', | ||
}, | ||
], | ||
machineType: 'projects/513326162531/machineTypes/e2-micro', | ||
maintenanceEvent: 'NONE', | ||
name: 'username-temp-delete-me-cloud-metadata', | ||
networkInterfaces: [ | ||
{ | ||
accessConfigs: [ | ||
{ | ||
externalIp: '35.247.28.180', | ||
type: 'ONE_TO_ONE_NAT', | ||
}, | ||
], | ||
dnsServers: ['169.254.169.254'], | ||
forwardedIps: [], | ||
gateway: '10.138.0.1', | ||
ip: '10.138.0.2', | ||
ipAliases: [], | ||
mac: '42:01:0a:8a:00:02', | ||
mtu: 1460, | ||
network: 'projects/513326162531/networks/default', | ||
subnetmask: '255.255.240.0', | ||
targetInstanceIps: [], | ||
}, | ||
], | ||
preempted: 'FALSE', | ||
remainingCpuTime: -1, | ||
scheduling: { | ||
automaticRestart: 'TRUE', | ||
onHostMaintenance: 'MIGRATE', | ||
preemptible: 'FALSE', | ||
}, | ||
serviceAccounts: { | ||
'[email protected]': { | ||
aliases: ['default'], | ||
email: '[email protected]', | ||
scopes: [ | ||
'https://www.googleapis.com/auth/devstorage.read_only', | ||
'https://www.googleapis.com/auth/logging.write', | ||
'https://www.googleapis.com/auth/monitoring.write', | ||
'https://www.googleapis.com/auth/servicecontrol', | ||
'https://www.googleapis.com/auth/service.management.readonly', | ||
'https://www.googleapis.com/auth/trace.append', | ||
], | ||
}, | ||
default: { | ||
aliases: ['default'], | ||
email: '[email protected]', | ||
scopes: [ | ||
'https://www.googleapis.com/auth/devstorage.read_only', | ||
'https://www.googleapis.com/auth/logging.write', | ||
'https://www.googleapis.com/auth/monitoring.write', | ||
'https://www.googleapis.com/auth/servicecontrol', | ||
'https://www.googleapis.com/auth/service.management.readonly', | ||
'https://www.googleapis.com/auth/trace.append', | ||
], | ||
}, | ||
}, | ||
tags: ['http-server'], | ||
virtualClock: { | ||
driftToken: '0', | ||
}, | ||
zone: 'projects/513326162531/zones/us-west1-b', | ||
}, | ||
oslogin: { | ||
authenticate: { | ||
sessions: {}, | ||
}, | ||
}, | ||
project: { | ||
attributes: { | ||
'gke-smith-de35da35-secondary-ranges': | ||
'services:default:default:gke-smith-services-de35da35,pods:default:default:gke-smith-pods-de35da35', | ||
'serial-port-enable': '1', | ||
'ssh-keys': '... public keys snipped ...', | ||
}, | ||
numericProjectId: 513326162531, | ||
projectId: 'elastic-apm', | ||
}, | ||
}, | ||
// This is an actual response from a dev VM, edited slightly for size and privacy. | ||
response: | ||
'{"instance":{"attributes":{},"cpuPlatform":"Intel Broadwell","description":"","disks":[{"deviceName":"trentm-play-vm0","index":0,"interface":"SCSI","mode":"READ_WRITE","type":"PERSISTENT-BALANCED"}],"guestAttributes":{},"hostname":"trentm-play-vm0.c.acme-eng.internal","id":5737554347302044216,"image":"projects/debian-cloud/global/images/debian-11-bullseye-v20230814","licenses":[{"id":"3853522013536123851"}],"machineType":"projects/523926462582/machineTypes/e2-medium","maintenanceEvent":"NONE","name":"trentm-play-vm0","networkInterfaces":[{"accessConfigs":[{"externalIp":"33.162.212.82","type":"ONE_TO_ONE_NAT"}],"dnsServers":["169.254.169.254"],"forwardedIps":[],"gateway":"10.138.0.1","ip":"10.138.0.7","ipAliases":[],"mac":"42:01:0a:9a:0e:27","mtu":1460,"network":"projects/523926462582/networks/default","subnetmask":"255.255.240.0","targetInstanceIps":[]}],"preempted":"FALSE","remainingCpuTime":-1,"scheduling":{"automaticRestart":"TRUE","onHostMaintenance":"MIGRATE","preemptible":"FALSE"},"serviceAccounts":{"[email protected]":{"aliases":["default"],"email":"[email protected]","scopes":["https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring.write","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append"]},"default":{"aliases":["default"],"email":"[email protected]","scopes":["https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring.write","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append"]}},"tags":[],"virtualClock":{"driftToken":"0"},"zone":"projects/523926462582/zones/us-west1-b"},"oslogin":{"authenticate":{"sessions":{}}},"project":{"attributes":{"gke-kk-dev-cluster-8264c0ad-secondary-ranges":"services:default:gke-kk-dev-cluster-subnet-8264c0ad:gke-kk-dev-cluster-services-8264c0ad,pods:default:gke-kk-dev-cluster-subnet-8264c0ad:gke-kk-dev-cluster-pods-8264c0ad","serial-port-enable":"1","ssh-keys":"[REDACTED]","sshKeys":"[REDACTED]"},"numericProjectId":523926462582,"projectId":"acme-eng"}}', | ||
}, | ||
], | ||
azure: [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.