2 - 24/7 Service Guard for Stackdriver

Updated 2 days ago by Michael Cretzman

Harness 24/7 Service Guard monitors your live applications, catching problems that surface minutes or hours following deployment. For more information, see 24/7 Service Guard Overview.

You can add your Stackdriver monitoring to Harness 24/7 Service Guard in your Harness Application Environment. See 1- Stackdriver Connection Setup.

For more information on 24/7 Service Guard, see 24/7 Service Guard.

24/7 Service Guard Setup

To set up 24/7 Service Guard for Stackdriver, do the following:

  1. Ensure that you have added Stackdriver as a Harness Verification Provider, as described in 1- Stackdriver Connection Setup.
  2. In your Harness Application, ensure that you have added a Service, as described in Services. For 24/7 Service Guard, you do not need to add an Artifact Source to the Service, or configure its settings. You simply need to create a Service and name it. It will represent your application for 24/7 Service Guard.
  3. In your Harness Application, click Environments.
  4. In Environments, ensure that you have added an Environment for the Service you added. For steps on adding an Environment, see Environments.
  5. Click the Environment for your Service. Typically, the Environment Type is Production.
  6. In the Environment page, locate 24/7 Service Guard.
  7. In 24/7 Service Guard, click Add Service Verification, and then click Stackdriver. The Stackdriver dialog appears.

  1. Fill out the dialog. The dialog has the following fields. For information on the log entries used, see Viewing Logs from GCP.
For 24/7 Service Guard, the queries you define to collect logs are specific to the application or service you want monitored. Verification is application/service level. This is unlike Workflows, where verification is performed at the host/node/pod level.

Field

Description

Display Name

The name that will identify this service on the Continuous Verification dashboard. Use a name that indicates the environment and monitoring tool, such as Stackdriver.

Service

The Harness Service to monitor with 24/7 Service Guard.

GCP Cloud Provider

Select the GCP Cloud Provider to use, as described in Stackdriver Connection Setup. If you currently connect to GCP via a Kubernetes Cluster Cloud Provider, you must set up a GCP Cloud Provider for access to the Stackdriver data on your cluster.

Search Keywords

Enter search keywords for your query. You can use the same filters you have in GCP Logs Viewer.

Simply copy a filer entry into Search Keywords:

To use multiple filter entries, place an AND between them or use multiline entries. For example:

For advanced filter examples, see Advanced filters library from GCP.

Host Name Field

Enter the log field that contains the name of the host/pod/container for which you want logs. You can enter a pod ID or field name for example.

Harness uses this field to group data and perform analysis at the container-level.

For example, the query in Search Keywords looks for pods labelled nginx-deployment:

resource.type="container"
resource.labels.pod_id:"nginx-deployment-"

In Host Name Field, you would enter pod_id because it is the log field containing the pod name. In a log, this field will be in the resource section:

...
resource: {
labels: {
cluster_name: "doc-example"
container_name: "harness-delegate-instance"
instance_id: "1733097732247470454"
namespace_id: "harness-delegate"
pod_id: "harness-sample-k8s-delegate-wverks-0"
project_id: "exploration-161417"
zone: "us-central1-a"
}
type: "container"
}
...

Enable 24/7 Service Guard

Click the checkbox to enable 24/7 Service Guard.

Baseline

Select the baseline time unit for monitoring. For example, if you select For 4 hours, Harness will collect the logs for the last 4 hours as the baseline for comparisons with future logs. If you select Custom Range you can enter a Start Time and End Time.

When you are finished, the dialog will look something like this:

  1. Click TEST. Harness verifies the settings you entered.
  2. Click SUBMIT. The Stackdriver 24/7 Service Guard is configured.

To see the running 24/7 Service Guard analysis, click Continuous Verification. The 24/7 Service Guard dashboard displays the production verification results.

For more information, see 24/7 Service Guard Overview.

Next Step


How did we do?