This repository contains the hands on for the Day 2 Operations - Cloud Native Observability Workshop.
The following steps are used for this lab:
In this exercise, we will deploy the OneAgent to a Linux instance running Kubernetes(Microk8s) and let the OneAgent discover what is running in that instance.
To faciliate the labs, we will access the Linux instance via terminal through a web browser.
Use the URL was provided in your email to access the SSH terminal. Make sure the URL looks like Public IP Address:8080/wetty
Use the login name and password as provided in your email.
Open your browser and access the Dynatrace URL.
Follow these steps below:
Within the Monitor Kubernetes / Openshift page, follow these steps below:
k8s
Example:
Connecting to github-releases.githubusercontent.com (github-releases.githubusercontent.com)|185.199.108.154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7310 (7.1K) [application/octet-stream]
Saving to: ‘install.sh'
install.sh 100%[=====================================================>] 7.14K --.-KB/s in 0s
2021-06-01 05:46:36 (40.7 MB/s) - ‘install.sh' saved [7310/7310]
Check for token scopes...
Check if cluster already exists...
Creating Dynatrace namespace...
Applying Dynatrace Operator...
Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
customresourcedefinition.apiextensions.k8s.io/dynakubes.dynatrace.com created
serviceaccount/dynatrace-dynakube-oneagent created
serviceaccount/dynatrace-dynakube-oneagent-unprivileged created
serviceaccount/dynatrace-kubernetes-monitoring created
serviceaccount/dynatrace-operator created
serviceaccount/dynatrace-routing created
podsecuritypolicy.policy/dynatrace-dynakube-oneagent created
podsecuritypolicy.policy/dynatrace-dynakube-oneagent-unprivileged created
podsecuritypolicy.policy/dynatrace-kubernetes-monitoring created
podsecuritypolicy.policy/dynatrace-operator created
podsecuritypolicy.policy/dynatrace-routing created
role.rbac.authorization.k8s.io/dynatrace-dynakube-oneagent created
role.rbac.authorization.k8s.io/dynatrace-dynakube-oneagent-unprivileged created
role.rbac.authorization.k8s.io/dynatrace-kubernetes-monitoring created
role.rbac.authorization.k8s.io/dynatrace-operator created
role.rbac.authorization.k8s.io/dynatrace-routing created
clusterrole.rbac.authorization.k8s.io/dynatrace-kubernetes-monitoring created
clusterrole.rbac.authorization.k8s.io/dynatrace-operator created
rolebinding.rbac.authorization.k8s.io/dynatrace-dynakube-oneagent created
rolebinding.rbac.authorization.k8s.io/dynatrace-dynakube-oneagent-unprivileged created
rolebinding.rbac.authorization.k8s.io/dynatrace-kubernetes-monitoring created
rolebinding.rbac.authorization.k8s.io/dynatrace-operator created
rolebinding.rbac.authorization.k8s.io/dynatrace-routing created
clusterrolebinding.rbac.authorization.k8s.io/dynatrace-kubernetes-monitoring created
clusterrolebinding.rbac.authorization.k8s.io/dynatrace-operator created
deployment.apps/dynatrace-operator created
W0601 05:46:39.025776 29593 helpers.go:553] --dry-run is deprecated and can be replaced with --dry-run=client.
secret/dynakube configured
Applying DynaKube CustomResource...
dynakube.dynatrace.com/dynakube created
Adding cluster to Dynatrace...
Kubernetes monitoring successfully setup.
$
Click on Show deployment status to check the status of the connected host.
You should be able to see a connected host as per the image below.
To restart the sample app Sockshop execute the following command:
kubectl delete po --all -n dev
kubectl delete po --all -n production
Within Dynatrace, follow the steps below to get Sockshop URL:
http://production.front-end.PUBLIC-IP.nip.io/
http://dev.front-end.PUBLIC-IP.nip.io
While waiting for Easy Travel to start, you can explore Dynatrace and using the Smartscape, Dynatrace will automatically discover the processes and dependencies that comprises the Easy Travel application!
4 things that you will love about Dynatrace!
In this exercise, we will automate configuration of Dynatrace environment.
Using Dynatrace Monitoring as Code (Monaco), you can automate the configuration of all global Dynatrace environments without human intervention. Various use cases include:
To faciliate the session, you can run the monaco code with the below:
cd sockshop
./deploy-monaco.sh
After setting it up, configure the DT_TENANT and DT_API_TOKEN and DT_DASHBOARD_OWNER variables. These can be found within the lab registration email.
export DT_TENANT= https://mou612.managed-sprint.dynalabs.io/e/<ENV>
export DT_API_TOKEN=dt0c01.IH6********************************************
export DT_DASHBOARD_OWNER=<your email address>
After setting up, run the following command to configure Dynatrace:
./push-monaco.sh
Below are the configurations done:
In this exercise, we will cover the setting up basic Service Level Objectives (SLO). These objectives are based on a target of our measured Service Level Indicators (SLI) to fulfill the business's Service Level Agreement (SLA).
On the left nav, go to Service level objectives > Add new SLO
We will be creating a SLO for Sockshop Frontend. Use the following:
Sockshop Frontend Error SLO
builtin:service.errors.server.successCount
builtin:service.requestCount.server
type("SERVICE"),tag("[Kubernetes]tier:frontend"),tag("[Kubernetes]stage:prod")
-1h
under TimeframeIn this exercise, we will cover the setting up an advance Service Level Objectives (SLO). These objectives would require creating a custom metric first, followed by targeting the measured Service Level Indicators (SLI) to fulfill the business's Service Level Agreement (SLA).
Next, we will be creating a custom metric for successful requests count to Catalogue page
Transactions and services
front-end
servicecataloguesuccesscount
cataloguecount
Catalogue Availability SLO
calc:service.cataloguesuccesscount
calc:service.cataloguecount
85
for Failure90
for Warning-15m
under TimeframeRefer to the left navigation bar and go to Dashboards. Dynatrace has now prebuilt dashboard templates such as Kubernetes Dashboards and Real User Monitoring dashboards.
As part of the Monaco rollout, you should also see dashboards created such as Environment Overview Dashboard and Prometheus - Environment Overview Dashboard
Drill down into each of these dashboards and explore the various dashboard widgets for App Owners and Business Users.
We will now add a new SLO widget based on the new SLO we've created.
On the left nav, go to Service level objectives
You can use the pin icon to pin the dashboard to Environment Overview Dashboard
Within the Environment Overview Dashboard dashboard, click on Edit
Drag the Custom Chart widget onto the dashboard and click on configure custom chart
Number of calls without server side errors
metricService: Tag: [Kubernetes]app: catalogue
Back at the dashboard view, click on the newly created widget to clone another custom chart
On the new widget, click on configure custom chart
Back in the Data Explorer view, following the below:
((calc:service.cataloguesuccesscount) / (calc:service.cataloguecount)) * (100)
15
10
5
Dynatrace also offers a built-in release-analysis solution that helps you determine the versions or stages of your deployed applications.
On the left nav, go to Releases
This provides an overview of deployed component versions and their release events.
Drilling into each component, you will find additional metadata from the respective component. This provides context to the monitored component as well as information regarding it's lifecycle and tracking issues.
We hope you enjoyed this lab and found it useful. We would love your feedback!