Technology | Category | Product | Languages |
---|---|---|---|
Cloud | Data Center,Open Source | AppDynamics | Hashicorp Configuration Language (HCL) |
This solution is an example of how to get started with monitoring and observability using AppDynamics's Machine Agent. The example details how to:
The main objective is to get started with monitoring your infrastructure by showing an automated way of getting the AppDynamics agent installed, so that you have observability baked into an environment from the onset. We first start with the use case of monitoring virtual machines with follow-on use cases showing how Kubernetes clusters, databases, and applications are brought into the fold to ultimately provide a full-stack view of your operations in real time.
Here is a list of dependencies to make this work in your environment:
We purposely did not add credentials and other sensitive information to the repo by including them in the .gitignore
file. As such, if you clone this repo, you must create two files.
secret.tfvars
contains sensitive Terraform variables.variables.yml
is used by Ansible.variables.yml
using the command ansible-vault
command and decrypt it as needed locally. You could take the same approach or leave the file unencrypted if you are confident it will not be shared or inadvertently uploaded to a repo.Here is a list of variables you must include and define for each file.
secret.tfvars
in HCL format (file is in the same directory as the terraform.tfvars
file):
vsphere_vm_firmware = bios
)variables.yml
(written in YAML) file:
In this example, Terraform uses the vsphere
provider and a vsphere_virtual_machine
resource to:
After Terraform creates five virtual machines, the Ansible playbook installs and configures:
Each Apache Web Server is configured with a custom (using a Jinja template) index.html
page that displays the hostname.
The same approach is taken with the AppDynamics Machine Agent. In other words, a Jinja template creates a custom file for each containing the hostname.
Here are the steps that guide you to run Terraform along with examples of each:
terraform init -var-file="secret.tfvars"
terraform plan -out appd-machine-agent-installation.tfplan -var-file="secret.tfvars"
terraform apply -var-file="secret.tfvars"
Each of these commands includes the secret.tfvars
containing the sensitive variables that are needed to connect to the different resources as described in the previous section.
You see five virtual machines that are created with static IP addresses in vSphere.
Each Apache server has a custom index.html
file that includes the hostname of the machine.
The five virtual machines appear in the AppDynamics controller, each running an Apache Web Server, and all five appearing in the AppDynamics controller.
Click any of the check box available just before the OS
column; then click View Details
to see that the data reported by the Machine Agent to the AppDynamics Controller.
You can see the data that is reported by the Machine Agent on apache-webserver-1
.
Now that you have an Apache Web Server running and you have a Machine Agent onboarded your newly created hosts, you can monitor HTTP as a service. Here's how:
Servers
on the top navigation bar followed by Service Availability
on the left-hand side of the AppDynamics controller user interface.Add
.apache-web-server-2
is used to run a check against the HTTP service running on apache-web-server-1
.Response Validtor
tab followed by selecting Add Response Validator
.Status Code
and select Equals
for the condition followed by entering a value of 200
.After saving the configuration, you are returned to the Service Availability page where you will see your newly created Service Availability check displayed. After a few minutes, you will data about the service reported back by the machine agent as it periodically checks the health of the HTTP service running on apache-webserver-1
.
The server running the check is listed under the Server
column and the monitored service is listed in the Monitored Service
column.
Details
.Now that you are collecting metrics for machines hosting applications and their infrastructure, check out how to integrate agents into applications with a hands-on sample.
Cloud Native Sample Bookinfo App Observability
Owner
Contributors
Categories
Products
AppDynamicsProgramming Languages
HCLLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community