You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/event-hubs/event-hubs-node-get-started-send.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ If you're new to Azure Event Hubs, see [Event Hubs overview](event-hubs-about.md
17
17
18
18
To complete this quickstart, you need the following prerequisites:
19
19
20
-
-**Microsoft Azure subscription**. To use Azure services, including Azure Event Hubs, you need a subscription. If you don't have an existing Azure account, you can sign up for a [free trial](https://azure.microsoft.com/free/) or use your MSDN subscriber benefits when you [create an account](https://azure.microsoft.com).
20
+
-**Microsoft Azure subscription**. To use Azure services, including Azure Event Hubs, you need a subscription. If you don't have an existing Azure account, you can sign up for a [free trial](https://azure.microsoft.com/free/).
21
21
- Node.js LTS. Download the latest [long-term support (LTS) version](https://nodejs.org).
22
22
- Visual Studio Code (recommended) or any other integrated development environment (IDE).
23
23
-**Create an Event Hubs namespace and an event hub**. The first step is to use the [Azure portal](https://portal.azure.com) to create a namespace of type Event Hubs, and obtain the management credentials your application needs to communicate with the event hub. To create a namespace and an event hub, follow the procedure in [this article](event-hubs-create.md).
@@ -139,16 +139,14 @@ In this section, you create a JavaScript application that sends events to an eve
139
139
---
140
140
141
141
1. Run `node send.js` to execute thisfile. This command sends a batch of three events to your eventhub. If you're using the Passwordless (Azure Active Directory's Role-based Access Control) authentication, you might want to run `az login` and sign into Azure using the account that was added to the Azure Event Hubs Data Owner role.
142
-
1. In the Azure portal, verify that the event hub has received the messages. Refresh the page to update the chart. It might take a few seconds for it to show that the messages have been received.
142
+
1. In the Azure portal, verify that the event hub received the messages. Refresh the page to update the chart. It might take a few seconds for it to show that the messages are received.
143
143
144
144
[](./media/node-get-started-send/verify-messages-portal.png#lightbox)
145
145
146
146
> [!NOTE]
147
147
> For the complete source code, including additional informational comments, go to the [GitHub sendEvents.js page](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/eventhub/event-hubs/samples/v5/javascript/sendEvents.js).
148
148
149
-
You have now sent events to an event hub.
150
-
151
-
149
+
152
150
## Receive events
153
151
In this section, you receive events from an event hub by using an Azure Blob storage checkpoint store in a JavaScript application. It performs metadata checkpoints on received messages at regular intervals in an Azure Storageblob. This approach makes it easy to continue receiving messages later from where you left off.
154
152
@@ -170,13 +168,13 @@ To create an Azure storage account and a blob container in it, do the following
170
168
171
169
[Get the connection string to the storage account](../storage/common/storage-configure-connection-string.md).
172
170
173
-
Note the connection string and the container name. You use them in the receive code.
171
+
Note the connection string and the container name. You use them in the code to receive events.
174
172
175
173
---
176
174
177
175
### Install the npm packages to receive events
178
176
179
-
For the receiving side, you need to install two more packages. Inthis quickstart, you use Azure Blob storage to persist checkpoints so that the program doesn't read the events that it has already read. It performs metadata checkpoints on received messages at regular intervals in a blob. This approach makes it easy to continue receiving messages later from where you left off.
177
+
For the receiving side, you need to install two more packages. Inthis quickstart, you use Azure Blob storage to persist checkpoints so that the program doesn't read the events that it already read. It performs metadata checkpoints on received messages at regular intervals in a blob. This approach makes it easy to continue receiving messages later from where you left off.
> For the complete source code, including additional informational comments, go to the [GitHub receiveEventsUsingCheckpointStore.js page](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/eventhub/eventhubs-checkpointstore-blob/samples/v1/javascript/receiveEventsUsingCheckpointStore.js).
363
361
364
-
You have now received events from your event hub. The receiver program receives events from all the partitions of the default consumer group in the event hub.
362
+
The receiver program receives events from all the partitions of the default consumer group in the event hub.
365
363
366
364
## Clean up resources
367
365
Delete the resource group that has the Event Hubs namespace or delete only the namespace if you want to keep the resource group.
description: Learn how to use Azure Monitor to view, analyze, and create alerts on metrics from Azure Event Hubs.
4
4
ms.topic: conceptual
5
5
ms.custom: subject-monitoring
6
-
ms.date: 03/01/2023
6
+
ms.date: 04/05/2024
7
7
---
8
8
9
9
# Monitor Azure Event Hubs
@@ -45,7 +45,7 @@ See [Create diagnostic setting to collect platform logs and metrics in Azure](..
45
45
If you use **Azure Storage** to store the diagnostic logging information, the information is stored in containers named **insights-logs-operationlogs** and **insights-metrics-pt1m**. Sample URL for an operation log: `https://<Azure Storage account>.blob.core.windows.net/insights-logs-operationallogs/resourceId=/SUBSCRIPTIONS/<Azure subscription ID>/RESOURCEGROUPS/<Resource group name>/PROVIDERS/MICROSOFT.SERVICEBUS/NAMESPACES/<Namespace name>/y=<YEAR>/m=<MONTH-NUMBER>/d=<DAY-NUMBER>/h=<HOUR>/m=<MINUTE>/PT1H.json`. The URL for a metric log is similar.
46
46
47
47
### Azure Event Hubs
48
-
If you use **Azure Event Hubs** to store the diagnostic logging information, the information is stored in Event Hubs instances named **insights-logs-operationlogs** and **insights-metrics-pt1m**. You can also select an existing event hub except for the event hub for which you are configuring diagnostic settings.
48
+
If you use **Azure Event Hubs** to store the diagnostic logging information, the information is stored in Event Hubs instances named **insights-logs-operationlogs** and **insights-metrics-pt1m**. You can also select an existing event hub except for the event hub for which you're configuring diagnostic settings.
49
49
50
50
### Log Analytics
51
51
If you use **Log Analytics** to store the diagnostic logging information, the information is stored in tables named **AzureDiagnostics** / **AzureMetrics** or **resource specific tables**
@@ -61,7 +61,7 @@ The metrics and logs you can collect are discussed in the following sections.
61
61
## Analyze metrics
62
62
You can analyze metrics for Azure Event Hubs, along with metrics from other Azure services, by selecting **Metrics** from the **Azure Monitor** section on the home page for your Event Hubs namespace. See [Analyze metrics with Azure Monitor metrics explorer](../azure-monitor/essentials/analyze-metrics.md) for details on using this tool. For a list of the platform metrics collected, see [Monitoring Azure Event Hubs data reference metrics](monitor-event-hubs-reference.md#metrics).
63
63
64
-

64
+
:::image type="content" source="./media/monitor-event-hubs/metrics.png" alt-text="Screenshot showing the Metrics Explorer for an Event Hubs namespace." lightbox="./media/monitor-event-hubs/metrics.png":::
65
65
66
66
For reference, you can see a list of [all resource metrics supported in Azure Monitor](../azure-monitor/essentials/metrics-supported.md).
67
67
@@ -71,7 +71,7 @@ For reference, you can see a list of [all resource metrics supported in Azure Mo
71
71
### Filter and split
72
72
For metrics that support dimensions, you can apply filters using a dimension value. For example, add a filter with `EntityName` set to the name of an event hub. You can also split a metric by dimension to visualize how different segments of the metric compare with each other. For more information of filtering and splitting, see [Advanced features of Azure Monitor](../azure-monitor/essentials/metrics-charts.md).
73
73
74
-
:::image type="content" source="./media/monitor-event-hubs/metrics-filter-split.png" alt-text="Image showing filtering and splitting metrics":::
74
+
:::image type="content" source="./media/monitor-event-hubs/metrics-filter-split.png" alt-text="Screenshot showing the Metrics Explorer for an Event Hubs namespace with a filter." lightbox="./media/monitor-event-hubs/metrics-filter-split.png":::
75
75
76
76
## Analyze logs
77
77
Using Azure Monitor Log Analytics requires you to create a diagnostic configuration and enable __Send information to Log Analytics__. For more information, see the [Collection and routing](#collection-and-routing) section. Data in Azure Monitor Logs is stored in tables, with each table having its own set of unique properties. Azure Event Hubs stores data in the following tables: **AzureDiagnostics** and **AzureMetrics**.
@@ -166,17 +166,18 @@ Using *Runtime audit logs* you can capture aggregated diagnostic information for
166
166
> Runtime audit logs are available only in **premium** and **dedicated** tiers.
167
167
168
168
### Enable runtime logs
169
-
You can enable either runtime audit logs or application metrics logs by selecting *Diagnostic settings* from the *Monitoring* section on the Event Hubs namespace page in Azure portal. Click on *Add diagnostic setting* as shown below.
169
+
You can enable either runtime audit or application metrics logging by selecting *Diagnostic settings* from the *Monitoring* section on the Event Hubs namespace page in Azure portal. Select **Add diagnostic setting** as shown in the following image.
170
170
171
-

171
+
:::image type="content" source="./media/monitor-event-hubs/add-diagnostic-settings.png" alt-text="Screenshot that shows the Diagnostic settings page for an Event Hubs namespace." lightbox="./media/monitor-event-hubs/add-diagnostic-settings.png":::
172
172
173
173
Then you can enable log categories *RuntimeAuditLogs* or *ApplicationMetricsLogs* as needed.
174
-

175
174
176
-
Once runtime logs are enabled, Event Hubs will start collecting and storing them according to the diagnostic setting configuration.
175
+
:::image type="content" source="./media/monitor-event-hubs/configure-diagnostic-settings.png" alt-text="Screenshot that shows the runtime audit and application metric logs enabled." lightbox="./media/monitor-event-hubs/configure-diagnostic-settings.png":::
176
+
177
+
Once runtime logs are enabled, Event Hubs start collecting and storing them according to the diagnostic setting configuration.
177
178
178
179
### Publish and consume sample data
179
-
To collect sample runtime audit logs in your Event Hubs namespace, you can publish and consume sample data using client applications which are based on [Event Hubs SDK](../event-hubs/event-hubs-dotnet-standard-getstarted-send.md) (AMQP) or using any [Apache Kafka client application](../event-hubs/event-hubs-quickstart-kafka-enabled-event-hubs.md).
180
+
To collect sample runtime audit logs in your Event Hubs namespace, you can publish and consume sample data using client applications, which are based on [Event Hubs SDK](../event-hubs/event-hubs-dotnet-standard-getstarted-send.md), which uses Advanced Message Queuing Protocol (AMQP) or using any [Apache Kafka client application](../event-hubs/event-hubs-quickstart-kafka-enabled-event-hubs.md).
180
181
181
182
182
183
### Analyze runtime audit logs
@@ -201,7 +202,7 @@ AZMSRuntimeAuditLogs
201
202
Up on the execution of the query you should be able to obtain corresponding audit logs in the following format.
202
203
:::image type="content" source="./media/monitor-event-hubs/runtime-audit-logs.png" alt-text="Image showing the result of a sample query to analyze runtime audit logs." lightbox="./media/monitor-event-hubs/runtime-audit-logs.png":::
203
204
204
-
By analyzing these logs you should be able to audit how each client application interacts with Event Hubs. Each field associated with runtime audit logs are defined in [runtime audit logs reference](../event-hubs/monitor-event-hubs-reference.md#runtime-audit-logs).
205
+
By analyzing these logs, you should be able to audit how each client application interacts with Event Hubs. Each field associated with runtime audit logs is defined in [runtime audit logs reference](../event-hubs/monitor-event-hubs-reference.md#runtime-audit-logs).
205
206
206
207
207
208
### Analyze application metrics
@@ -223,10 +224,10 @@ AZMSApplicationMetricLogs
223
224
| where Provider == "EVENTHUB"
224
225
```
225
226
---
226
-
Application metrics includes the following runtime metrics.
227
+
Application metrics include the following runtime metrics.
227
228
:::image type="content" source="./media/monitor-event-hubs/application-metrics-logs.png" alt-text="Image showing the result of a sample query to analyze application metrics." lightbox="./media/monitor-event-hubs/application-metrics-logs.png":::
228
229
229
-
Therefore you can use application metrics to monitor runtime metrics such as consumer lag or active connection from a given client application. Each field associated with runtime audit logs are defined in [application metrics logs reference](../event-hubs/monitor-event-hubs-reference.md#runtime-audit-logs).
230
+
Therefore you can use application metrics to monitor runtime metrics such as consumer lag or active connection from a given client application. Fields associated with runtime audit logs are defined in [application metrics logs reference](../event-hubs/monitor-event-hubs-reference.md#runtime-audit-logs).
0 commit comments