Skip to content

Commit

Permalink
Merge pull request #18554 from newrelic/daily-release/Sep-3--2024-12_14
Browse files Browse the repository at this point in the history
Daily release/sep 3  2024 12 14
  • Loading branch information
ally-sassman authored Sep 3, 2024
2 parents 0ec5df9 + 0fb2d93 commit 63cc75b
Show file tree
Hide file tree
Showing 55 changed files with 2,403 additions and 4,058 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Description template for alert conditions
tags:
- Alerts
- Alerts
- Alert conditions
metaDescription: 'Some alert conditions allow you to write a Description, which adds context to your incidents and notifications.'
redirects:
Expand Down Expand Up @@ -37,7 +37,7 @@ The <DNT>**Description template**</DNT> field allows you to use a general templa

```handlebars
This is my condition name : {{conditionName}}
The hostname is : {{tag.fullHostname}}
The hostname is : {{tags.fullHostname}}
```

An incident resulting from this condition would fill in the details and you'd receive a notification like this:
Expand Down Expand Up @@ -67,21 +67,21 @@ Here's a description template template example:

```handlebars
This is my condition name : {{conditionName}}
The hostname is : {{tag.fullHostname}}
Owning Team: {{tag.label.owning_team}}
Product: {{tag.label.product}}
ec2VpcId: {{tag.aws.ec2VpcId}}
Service name : {{tag.label.Name}}
AWS Region : {{tag.aws.awsRegion}}
AWS Availability Zone: {{tag.aws.awsAvailabilityZone}}
Department : {{tag.label.department}}
Environment: {{tag.label.environment}}
Cluster: {{tag.clusterName}}
Cluster Role: {{tag.clusterRole}}
EC2 Instance Type: {{tag.instanceType}}
EC2 InstanceID: {{tag.aws.ec2InstanceId}}
EC2 AmiId: {{tag.aws.ec2AmiId}}
EC2 Root Device Type: {{tag.aws.ec2RootDeviceType}}
The hostname is : {{tags.fullHostname}}
Owning Team: {{tags.label.owning_team}}
Product: {{tags.label.product}}
ec2VpcId: {{tags.aws.ec2VpcId}}
Service name : {{tags.label.Name}}
AWS Region : {{tags.aws.awsRegion}}
AWS Availability Zone: {{tags.aws.awsAvailabilityZone}}
Department : {{tags.label.department}}
Environment: {{tags.label.environment}}
Cluster: {{tags.clusterName}}
Cluster Role: {{tags.clusterRole}}
EC2 Instance Type: {{tags.instanceType}}
EC2 InstanceID: {{tags.aws.ec2InstanceId}}
EC2 AmiId: {{tags.aws.ec2AmiId}}
EC2 Root Device Type: {{tags.aws.ec2RootDeviceType}}
```

## How to use attributes [#attributes-tags]
Expand All @@ -93,19 +93,19 @@ The attributes you can use in a description template are a subset of attributes
```handlebars
The target name is : {{targetName}}
```
* Tag attributes: For tags, you would use the format `{{tag.TAG_NAME}}`. There are two types of tags:
* Tag attributes: For tags, you would use the format `{{tags.TAG_NAME}}`. There are two types of tags:

* Entity-related tags: <DNT>**For infrastructure conditions only.**</DNT> You can find available [entity-related tags](/docs/new-relic-one/use-new-relic-one/core-concepts/tagging-use-tags-organize-group-what-you-monitor#) by going to the [entity explorer](/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts) and looking under a service's <DNT>**Metadata and tags**</DNT>, or by viewing incident details. Here's an example of using tags in a description template:

```handlebars
The AWS region is : {{tag.aws.awsRegion}}
Responsible team : {{tag.label.owning_team}}
The AWS region is : {{tags.aws.awsRegion}}
Responsible team : {{tags.label.owning_team}}
```
* Facet clause tags: <DNT>**For NRQL conditions only.**</DNT> If a NRQL condition uses a `FACET` clause, you can use `tag` formatting to use those values in your description template. For example, if the NRQL query included `FACET hostName, cluster`, you could then use this:
* Facet clause tags: <DNT>**For NRQL conditions only.**</DNT> If a NRQL condition uses a `FACET` clause, you can use `tags` formatting to use those values in your description template. For example, if the NRQL query included `FACET hostName, cluster`, you could then use this:

```handlebars
The host is : {{tag.hostName}}
The cluster is : {{tag.cluster}}
The host is : {{tags.hostName}}
The cluster is : {{tags.cluster}}
```

Please note that tag names cannot include whitespace. The expanded values can include whitespace, but not the names of the tags themselves.
Expand Down Expand Up @@ -135,7 +135,7 @@ mutation {
alertsNrqlConditionStaticUpdate(
accountId: 123456
id: "123456"
condition: {description: "timestamp : {{timestamp}} \n accountId : {{accountId}} \n type : {{type}} \n event : {{event}} \n description : {{description}} \n policyId : {{policyId}} \n policyName: {{policyName}} \n conditionName : {{conditionName}} \n conditionId : {{conditionId}} \n product : {{product}} \n conditionType : {{conditionType}} \n RunbookUrl : {{runbookUrl}} \n nrqlQuery : {{nrqlQuery}} \n nrqlEventType : {{nrqlEventType}} \n targetID : {{targetId}} \n targetName : {{targetName}} \n commandLine : {{tag.commandLine}} \n entityGuid : {{tag.entityGuid}} \n entityName : {{tag.entityName}} \n fullHostname : {{tag.fullHostname}} \n instanceType : {{tag.instanceType}} \n processDisplayName : {{tag.processDisplayName}}"}
condition: {description: "timestamp : {{timestamp}} \n accountId : {{accountId}} \n type : {{type}} \n event : {{event}} \n description : {{description}} \n policyId : {{policyId}} \n policyName: {{policyName}} \n conditionName : {{conditionName}} \n conditionId : {{conditionId}} \n product : {{product}} \n conditionType : {{conditionType}} \n RunbookUrl : {{runbookUrl}} \n nrqlQuery : {{nrqlQuery}} \n nrqlEventType : {{nrqlEventType}} \n targetID : {{targetId}} \n targetName : {{targetName}} \n commandLine : {{tags.commandLine}} \n entityGuid : {{tags.entityGuid}} \n entityName : {{tags.entityName}} \n fullHostname : {{tags.fullHostname}} \n instanceType : {{tags.instanceType}} \n processDisplayName : {{tags.processDisplayName}}"}
) {
description
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ Here's how:
```handlebars
{{conditionName}} has triggered an incident
```
* **Tag attributes**: For tags, use the format `{{tag.TAG_NAME}}`.
* **Facet clause tags**: If a NRQL condition uses a `FACET` clause, you can use `tag` formatting to use those values in your title template. For example, if the NRQL query included `FACET hostName, cluster`, you could then use this:
* **Tag attributes**: For tags, use the format `{{tags.TAG_NAME}}`.
* **Facet clause tags**: If a NRQL condition uses a `FACET` clause, you can use `tags` formatting to use those values in your title template. For example, if the NRQL query included `FACET hostName, cluster`, you could then use this:

```handlebars
Host {{tag.hostName}}, cluster {{tag.cluster}} incident
Host {{tags.hostName}}, cluster {{tags.cluster}} incident
```

Tag names cannot contain spaces, but the expanded values can. For a full list of available attributes, see [Incident event attributes](/docs/alerts-applied-intelligence/new-relic-alerts/advanced-alerts/understand-technical-concepts/incident-event-attributes).
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Here are operations related to creating, reading, updating, and deleting (CRUD).
</td>

<td>
Update dashboard operation. You can update an existing dashboard given a dashboard entity GUID. You need to specify the complete, updated dashboard elements, from metadata to widget configuration.
Update dashboard operation. You can update an existing dashboard using the dashboard entity GUID. To do this, you need to include all the elements in that dashboard, even if you're not updating every element. For example, to update only one of several widgets in a dashboard, you'll need to include all the other widgets and dashboard metadata in your mutation.
</td>
</tr>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,69 +46,82 @@ NRQL requirements:

To set up streaming data export to AWS, you must first set up an Amazon Kinesis Firehose. We'll walk you through that procedure in the next three steps.

### Step 1. Create a Firehose for streaming export [#create-firehose]
<Steps>
<Step>
### Create a Firehose for streaming export [#create-firehose]

Create a dedicated Firehose to stream your New Relic data to:

1. Go to Amazon Kineses Data Firehose.
1. Go to Amazon Kinesis Data Firehose.
2. Create a delivery stream.
3. Name the stream (you will use this name later in the rule registration).
4. Use <DNT>**Direct PUT or other sources**</DNT> and specify a destination compatible with New Relic's JSON event format (for example, S3, Redshift, or OpenSearch).
</Step>
<Step>
### Create IAM Firehose write access policy [#create-policy]

### Step 2. Create IAM Firehose write access policy [#create-policy]

1. Go to the IAM and select <DNT>**Policies**</DNT>.
2. Create a policy.
1. Go to the IAM console and sign in with your user.
2. Click **Policies** in the left navigation, and then click **Create policy**.
3. Select the Firehose service, and then select `PutRecord` and `PutRecordBatch`.
4. For `Resources`, select the delivery stream, add ARN, and select the region of your stream.
5. Enter your AWS account number, and then enter your desired delivery stream name in the name box.
6. Create the policy.

### Step 3. Create IAM role for granting New Relic write access [#iam-role]

</Step>
<Step>
### Create IAM role for granting New Relic write access [#iam-role]

To set up the IAM role:

1. Navigate to the IAM and click on <DNT>**Roles**</DNT>.
2. Create a role for an AWS account, and then select <DNT>**for another AWS account**</DNT>.
3. Enter the New Relic export account ID: `888632727556`.
4. Select <DNT>**Require external ID**</DNT> and enter the [account ID](/docs/accounts/accounts-billing/account-structure/account-id) of the New Relic account you want to export from.
5. Click <DNT>**Permissions**</DNT>, and then select the policy you created above.
6. Add a role name (this will be used in the export registration) and description.
7. Create the role.

When that's done, you can work on setting up your export rules using NerdGraph. For more on that, keep reading.
</Step>
</Steps>

When you're done with these steps, you can set up your export rules using NerdGraph. For more on that, jump to [Important fields for NerdGraph calls](#fields).


## Set up an Azure Event Hub [#event-hub-setup]

To set up streaming data export to Azure, you must first set up an Event Hub. We'll walk you through that procedure in the next three steps.

Alternatively, you can follow the Azure guide [here](https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-create).

### Step 1. Create an Event Hubs namespace [#create-event-hubs-namespace]
<Steps>
<Step>
### Create an Event Hubs namespace [#create-event-hubs-namespace]

1. Navigate to Event Hubs within your Microsoft Azure account.
2. Follow the steps to create an Event Hubs namespace. We recommend enabling auto-inflate to ensure you receive all of your data.
3. Ensure public access is enabled, we will be using a Shared Access Policy to authenticate securely with your Event Hub.
4. Once your Event Hubs namespace is deployed, click <DNT>**Go to resource**</DNT>.

### Step 2. Create an Event Hub[#create-event-hub]
</Step>
<Step>
### Create an Event Hub[#create-event-hub]

1. In the left column, click <DNT>**Event Hubs**</DNT>.
2. Then click <DNT>**+Event Hub**</DNT> to create an Event Hub.
3. Enter the desired Event Hub Name. Save this, as you'll need it later to create the streaming export rule.
4. Once the Event Hub is created, click on the Event Hub.

### Step 3. Create and attach a shared access policy [#event-hub-policy]
</Step>
<Step>
### Create and attach a shared access policy [#event-hub-policy]

1. In the left column, go to <DNT>**Shared access policies**</DNT>.
2. Click <DNT>**+Add**</DNT> near the top of the page.
3. Choose a name for your shared access policy.
4. Check <DNT>**Send**</DNT>, and click <DNT>**Create**</DNT>.
5. Click the created policy, and copy the <DNT>**Connection string–primary key**</DNT>. Save this, as we'll use this to authenticate and send data to your Event Hub.
</Step>
</Steps>

When that's done, you can work on setting up your export rules using NerdGraph. For more on that, keep reading.
When you're done with these steps, see the next section about important fields for your Nerdgraph calls.

## Important fields [#fields]
## Important fields for NerdGraph calls [#fields]

Most of the streaming data export NerdGraph calls we'll be covering use a few fields that are related to your account:

Expand Down Expand Up @@ -196,7 +209,7 @@ See these details on the values:

Once a streaming rule is created, you can [view it](#view-stream).

### Update a stream [#update-stream]
## Update a stream [#update-stream]

When you update a new streaming rule, you'll need all of the following fields. Here's an example of updating a streaming rule:

Expand Down Expand Up @@ -252,7 +265,7 @@ When updating, you'll get a message in the message field: “The export rule is

You can check if the rule is updated by calling `streamingRule` to retrieve the rule. During the period that the rule is under updating, the rule is locked, and no other mutation action can act on the rule. If you are trying to perform another mutation action on the same rule, you will get a message saying, “The export rule is currently being updated by another request, please wait and try again later.” A user can update a rule of any status except a deleted rule.

### Disable a stream [#disable-stream]
## Disable a stream [#disable-stream]

To disable a rule, you only need to provide the rule ID. Here's an example of disabling a stream:

Expand All @@ -268,7 +281,7 @@ mutation {

You can only disable the rule when the rule has a status of `ENABLED`. If you're trying to disable a rule that's in another state, it returns the error message, "The export rule can't be enabled or disabled due to status not being allowed." You can't disable the rule if the rule is locked due to another mutation being done.

### Enable a stream [#enable-stream]
## Enable a stream [#enable-stream]

If you want to enable a rule, you only need to provide the rule ID. Here's an example of enabling a stream:

Expand All @@ -284,7 +297,7 @@ mutation {

You can only enable the rule when it has a status of `DISABLED`. If you're trying to enable a rule that's in another state, it returns the error message like, "The export rule can't be enabled or disabled due to status not being allowed." You can't enable the rule if the rule is locked due to another mutation being done.

### Delete a stream [#delete-stream]
## Delete a stream [#delete-stream]

You'll need to provide a rule ID to delete a stream. Here's an example:

Expand Down Expand Up @@ -395,9 +408,9 @@ You can also query for all existing streams. Here's an example:
}
```

## Export compression [#compression]
## Understand export compression [#compression]

Optionally, we can compress payloads before they are exported, though this is disabled by default. This can help avoid hitting your ingested data limit and save money on ingress costs.
Optionally, we can compress payloads before they are exported, though this is disabled by default. This can help avoid hitting your ingested data limit and save money on egress costs.

You can enable compression using the `payloadCompression` field under `ruleParameters`. This field can be any of the following values:

Expand Down
Loading

0 comments on commit 63cc75b

Please sign in to comment.