Skip to content

Commit

Permalink
Updated the doc to match with the latest doc format and updated the f…
Browse files Browse the repository at this point in the history
…ile name
  • Loading branch information
ParthaI committed Jan 18, 2024
1 parent b29b73e commit d278a21
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func tableAzureResourceHealthEmergingIssue(ctx context.Context) *plugin.Table {
Columns: azureColumns([]*plugin.Column{
{
Name: "name",
Type: proto.ColumnType_STRING,
Description: "The name of the resource.",
Type: proto.ColumnType_STRING,
},
{
Name: "id",
Expand Down Expand Up @@ -71,14 +71,6 @@ func tableAzureResourceHealthEmergingIssue(ctx context.Context) *plugin.Table {
Type: proto.ColumnType_JSON,
Transform: transform.FromField("ID").Transform(idToAkas),
},

// Azure standard columns
{
Name: "resource_group",
Description: ColumnDescriptionResourceGroup,
Type: proto.ColumnType_STRING,
Transform: transform.FromField("ID").Transform(extractResourceGroupFromID).Transform(toLower),
},
}),
}
}
Expand All @@ -88,6 +80,7 @@ func tableAzureResourceHealthEmergingIssue(ctx context.Context) *plugin.Table {
func listResourceHealthEmergingIssues(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) {
session, err := GetNewSession(ctx, d, "MANAGEMENT")
if err != nil {
plugin.Logger(ctx).Error("azure_resource_health_emerging_issue.listResourceHealthEmergingIssues", "session_error", err)
return nil, err
}
subscriptionID := session.SubscriptionID
Expand All @@ -96,6 +89,7 @@ func listResourceHealthEmergingIssues(ctx context.Context, d *plugin.QueryData,
emergingClient.Authorizer = session.Authorizer
result, err := emergingClient.List(ctx)
if err != nil {
plugin.Logger(ctx).Error("azure_resource_health_emerging_issue.listResourceHealthEmergingIssues", "api_error", err)
return nil, err
}
for _, item := range result.Values() {
Expand All @@ -111,6 +105,7 @@ func listResourceHealthEmergingIssues(ctx context.Context, d *plugin.QueryData,
for result.NotDone() {
err = result.NextWithContext(ctx)
if err != nil {
plugin.Logger(ctx).Error("azure_resource_health_emerging_issue.listResourceHealthEmergingIssues", "api_paging_error", err)
return nil, err
}
for _, item := range result.Values() {
Expand Down
67 changes: 53 additions & 14 deletions docs/tables/azure_resource_health_emerging_issue.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
# Table: azure_resource_health_emerging_issue
---
title: "Steampipe Table: azure_resource_health_emerging_issue - Query Azure Service Health Emerging Issues using SQL"
description: "Allows users to query Azure Service Health Emerging Issues, providing detailed information about the emerging issues."
---

An "emerging issue" in the context of Azure Resource Health refers to a situation where Azure identifies a potential problem or degradation of service that might impact your resources.
# Table: azure_resource_health_emerging_issue - Query Azure Service Health Emerging Issues using SQL

Azure Resource Health's "Emerging Issues" feature in Azure Service Health is designed to inform users about new service issues that might impact them. This tool surfaces issues where Azure acknowledges a widespread outage but may not have full clarity on its extent. Previously available only on the Azure Status page, these emerging issues are now integrated into the Service Health dashboard. This integration allows users to rely solely on Service Health for a comprehensive view of both personalized service health information and broader emerging issues, enhancing the overall awareness and management of Azure service health.

## Table Usage Guide

The `azure_resource_health_emerging_issue` table provides insights into Resource Health within Microsoft Azure. As a DevOps engineer, explore group-specific details through this table, including properties, name of the resource, resource type, refresh time, status banner, and status active events.

## Examples

### Basic info
This is useful for quickly identifying the issue at hand, the type of the emerging issue, which helps in categorizing and understanding the nature of the issue, and the last refresh timestamp for the issue’s data. This is important for understanding the recency of the information, ensuring that you are working with the latest data.

```sql+postgres
select
name,
id,
type,
refresh_timestamp
from
azure_resource_health_emerging_issue;
```

```sql
```sql+sqlite
select
name,
id,
type,
resource_group
refresh_timestamp
from
azure_resource_health_emerging_issue;
```

### Get status banner details of emerging issues
Extracting detailed information about emerging issues in Azure Resource Health.

```sql
```sql+postgres
select
name,
id,
Expand All @@ -31,9 +52,23 @@ from
jsonb_array_elements(status_banners) as s;
```

```sql+sqlite
select
name,
id,
json_extract(s.value, '$.Title') as status_banner_title,
json_extract(s.value, '$.Message') as status_banner_message,
json_extract(s.value, '$.Cloud') as status_banner_cloud,
json_extract(s.value, '$.LastModifiedTime') as status_banner_last_modified_time
from
azure_resource_health_emerging_issue,
json_each(status_banners) as s;
```

### Get status event details of emerging issues
This query is useful for monitoring and analysis purposes, enabling users to keep track of ongoing issues and their characteristics within the Azure environment.

```sql
```sql+postgres
select
name,
e ->> 'Title' as event_title,
Expand All @@ -51,16 +86,20 @@ from
jsonb_array_elements(status_active_events) as e;
```

### Get emerging issue details of virtual machines

```sql
```sql+sqlite
select
name,
id,
type,
status_banners,
json_extract(e.value, '$.Title') as event_title,
json_extract(e.value, '$.Description') as event_description,
json_extract(e.value, '$.TrackingID') as tracking_id,
json_extract(e.value, '$.StartTime') as start_time,
json_extract(e.value, '$.Cloud') as cloud,
json_extract(e.value, '$.Severity') as severity,
json_extract(e.value, '$.Stage') as stage,
json_extract(e.value, '$.Published') as published,
json_extract(e.value, '$.LastModifiedTime') as last_modified_time,
json_extract(e.value, '$.Impacts') as impacts
from
azure_resource_health_emerging_issue
where
type = 'Microsoft.Compute/virtualMachines';
json_each(status_active_events) as e;
```

0 comments on commit d278a21

Please sign in to comment.