Add cloud provider metadata#871
Merged
mikker merged 16 commits intoelastic:masterfrom Oct 7, 2020
mikker:fetch-cloud-info
Merged
Add cloud provider metadata#871mikker merged 16 commits intoelastic:masterfrom mikker:fetch-cloud-info
mikker merged 16 commits intoelastic:masterfrom
mikker:fetch-cloud-info
Conversation
Contributor
|
Overall, it looks good but why do we have flat values for some fields while other agents (for ex python) and the documentation has embedded values? I might be missing something in the issue comments... For example, this shows |
Contributor
Author
|
Good catch! I just didn't want to add nested objects when storing them internally. I need to add the nested objects again when turning into json. |
Contributor
Author
|
AWS confirmed: {
"metadata": {
"service": {
"name": "App",
"environment": "development",
"version": null,
"agent": { "name": "ruby", "version": "3.10.1" },
"framework": { "name": "Sinatra", "version": "2.1.0" },
"language": { "name": "ruby", "version": "2.7.2" },
"runtime": { "name": "ruby", "version": "2.7.2" }
},
"process": {
"pid": 18346,
"title": "/home/ec2-user/.rvm/gems/ruby-2.7.2/bin/rackup",
"argv": []
},
"system": {
"hostname": "ip-172-31-4-63.eu-west-1.compute.internal",
"architecture": "x86_64",
"platform": "linux",
"kubernetes": {
"namespace": null,
"node": { "name": null },
"pod": { "name": null, "uid": null }
}
},
"labels": null,
"cloud": {
"provider": "aws",
"account": { "id": "907075276364", "name": null },
"availability_zone": "eu-west-1b",
"instance": { "id": "i-0f0165f84e8d411be", "name": null },
"machine": { "type": "t2.micro" },
"project": { "id": null, "name": null },
"region": "eu-west-1"
}
}
} |
Contributor
Author
|
GCE: {
"metadata": {
"service": {
"name": "App",
"environment": "development",
"version": null,
"agent": { "name": "ruby", "version": "3.10.1" },
"framework": { "name": "Sinatra", "version": "2.1.0" },
"language": { "name": "ruby", "version": "2.7.0" },
"runtime": { "name": "ruby", "version": "2.7.0" }
},
"process": {
"pid": 31623,
"title": "/home/mikkelmalmberg/.rvm/gems/ruby-2.7.0/bin/rackup",
"argv": []
},
"system": {
"hostname": "instance-1",
"architecture": "x86_64",
"platform": "linux",
"kubernetes": {
"namespace": null,
"node": "{:name=>nil}",
"pod": "{:name=>nil, :uid=>nil}"
}
},
"labels": null,
"cloud": {
"provider": "gcp",
"account": { "id": null, "name": null },
"availability_zone": "us-central1-a",
"instance": { "id": "1558417203220877769", "name": "instance-1" },
"machine": { "type": "projects/944210798271/machineTypes/e2-micro" },
"project": { "id": "944210798271", "name": "brnbw-10er" },
"region": "us-central1"
}
}
} |
Contributor
Author
|
Azure: {
"metadata": {
"service": {
"name": "App",
"environment": "development",
"version": null,
"agent": { "name": "ruby", "version": "3.10.1" },
"framework": { "name": "Sinatra", "version": "2.1.0" },
"language": { "name": "ruby", "version": "2.7.0" },
"runtime": { "name": "ruby", "version": "2.7.0" }
},
"process": {
"pid": 2209,
"title": "/home/azureuser/.rvm/gems/ruby-2.7.0/bin/rackup",
"argv": []
},
"system": {
"hostname": "apm-test",
"architecture": "x86_64",
"platform": "linux",
"kubernetes": {
"namespace": null,
"node": "{:name=>nil}",
"pod": "{:name=>nil, :uid=>nil}"
}
},
"labels": null,
"cloud": {
"provider": "azure",
"account": { "id": "81cf7b1d-04ab-440e-9802-5d0fb07d31ce", "name": null },
"availability_zone": "",
"instance": {
"id": "b06fe3ff-4294-4422-aefa-71bccbbf8a51",
"name": "apm-test"
},
"machine": { "type": "Standard_B2s" },
"project": { "id": null, "name": "apm-test_group" },
"region": "westeurope"
}
}
} |
estolfo
approved these changes
Oct 7, 2020
| it 'tries all three' do | ||
| WebMock.stub_request(:get, Metadata::CloudInfo::AWS_URI).to_timeout | ||
| WebMock.stub_request(:get, Metadata::CloudInfo::GCP_URI).to_timeout | ||
| WebMock.stub_request(:get, Metadata::CloudInfo::AZURE_URI).to_timeout |
Contributor
There was a problem hiding this comment.
cool, didn't know about the to_timeout expectation :)
Contributor
Author
There was a problem hiding this comment.
Me neither! Found it when writing this PR.
added 15 commits
October 7, 2020 12:09
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #841