Introduction
Google Stackdriver provides powerful monitoring, logging, and diagnostics. OpsRamp integration supports to accept incidents from Stackdriver as alerts.
OpsRamp configuration
Configuration involves the following:
- Installing the integration.
- Configuring the integration.
Step 1: Install the integration
To install:
- From All Clients, select a client.
- Go to Setup > Integrations > Integrations.
- From Available Integrations, select Monitoring > Stackdriver.
- Click Install.
Step 2: Configure the integration
To configure the integration:
- From the API tab, provide the following:
- Authentication: Copy Tenant Id, Token and Webhook URL for configuration. These settings are used for creating a HTTP Request template.
- Map Attributes: Provide the mapping information for the third-party.
- From the Monitoring of Integration tab, click Assign Templates.
- From the Audit Logs, set up audit log criteria and time frame.
Configuring the map attributes
To configure the mapping attributes:
- Select the required OpsRamp property from the drop-down.
- Click Add Mapping Attributes to map attributes for the specific OpsRamp alert property.
- Click + to define the mappings.
- From Create Alert Mappings on Status, define the mappings, parsing conditions, and default values, and Save.
Note
Attributes can be modified at any time.
The following tables shows attribute mappings.
Stackdriver Property | OpsRamp Property | ||||||
---|---|---|---|---|---|---|---|
incident.started_at | Alert time | ||||||
incident.state | Alert state
| ||||||
incident.policy_name | Alert metric | ||||||
incident.resource_name | Alert resource name | ||||||
incident.condition_name | Alert description | ||||||
incident.summary | Alert subject |
Sample payload
{
"incident": {
"incident_id": "0.kojklrfwei9s",
"resource_id": "",
"resource_name": "gce-integration Uptime Monitoring URL labels{host = opsramp.dev-instance.com}",
"state ": "open",
"started_at ": 1518762381,
"ended_at ": null,
"policy_name ": "Staging Uptime Check Policy ",
"condition_name ": "Generic HTTPS check on opsramp.dev-instance.com at / login.do ",
"url ": "https: //app.google.stackdriver.com/incidents/0.kojklrfwei9s?project=gce-integration",
"summary": "An uptime check on gce-integration Uptime Monitoring URL labels { host=opsramp.dev-instance.com } is failing."
},
"version": "1.1"
}
Stackdriver configuration
Configuration includes:
- Creating Webhook notifications.
- Creating uptime check.
- Creating alerting policy.
Step 1: Create Webhook notification
To create a Webhook notification:
- Log into Stackdriver.
- Go to Account Settings > Notifications > Webhooks, click Add Webhook.
- Configure the Webhook details:
- ENDPOINT URL:
https://{Your_OpsRamp_domain}/integrations/alertsWebhook/{tenantId}/alerts?vtoken={token}
Note: Provide the TenantId and Token from the OpsRamp configuration. - Webhook name: Provide name for Webhook. Example: OpsRamp Webhook
- Basic Auth: Not required
- ENDPOINT URL:
- Click Save. This Webhook is used while creating an Alerting policy.
Step 2: Create uptime check
Stackdriver checks the availability of your service by accessing it from different geographical locations. An uptime check periodically makes an automated request to a URL, or a resource on regular basis. If the resource fails to respond to a request sent from at least two geographical locations, then the uptime check fails thereby creating an incident in Stackdriver. The incident is notified to OpsRamp as an alert.
To create an uptime check:
- From Uptime Checks, click Add Uptime Check. New Uptime Check window appears.
- Configure the following for the check:
- Title: Provide name for uptime check. Example: OpsRamp Staging
- Check Type: Select a protocol: HTTP, HTTPS, TCP. Example: HTTPS
- Resource Type: Select resource type. Example: URL
- Hostname: Provide name of the host you want to add uptime check.
Note: This field is applicable only if the resource type is URL. - Path: Enter a path within the host or use the default path.
- Check every: Select the time frequency at which the check should send requests to the resource. Example: 5 minutes. Each geographic location attempts to reach the resource for every 5 minutes.
- Click Test to ensure Uptime Check works correctly.
- Click Save to save the Uptime Check.
Uptime check is created and is available on the Uptime Checks page. Create an alerting policy for the check to send notifications to OpsRamp.
Step 3: Create alerting policy
Alerting policy is a set of conditions that determine a resource is functioning normally and to send notifications if a problem occurs in the functioning process.
To create an alerting policy:
- Go to Uptime Checks, select the required Uptime check, click the Menu icon, and then click Create Alerting Policy.
- Configure the policy details:
- Condition: Click Add Condition, select the required Uptime Check condition, provide the details for the check and then click Save Condition.
- Notification: Select Notification type - Webhook and value - configured webhook name. Example: OpsRamp Webhook.
- Documentation: Not required.
- Name: Provide a name for alerting policy. Example: Uptime Check Policy.
- Click Save Policy. The alerting policy is created and attached to the Uptime Check.
When the configured conditions in the alerting policy are met, an event is triggered thereby creating an incident. The incident is notified to OpsRamp as an alert using Webhook mechanism. OpsRamp displays the alerts in the Alerts tab.