Skip to content

Commit 34ad322

Browse files
authored
Merge pull request #112967 from spelluru/relaydiag0427
Relay - Diagnostic logs
2 parents bbb515c + f0b37e5 commit 34ad322

File tree

5 files changed

+122
-3
lines changed

5 files changed

+122
-3
lines changed

articles/service-bus-relay/TOC.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
items:
99
- name: Hybrid Connections
1010
items:
11-
- name: Send and receive messages - .NET Websockets
11+
- name: Send and receive messages - .NET WebSockets
1212
href: relay-hybrid-connections-dotnet-get-started.md
1313
- name: Send and receive messages - .NET HTTP
1414
href: relay-hybrid-connections-http-requests-dotnet-get-started.md
15-
- name: Send and receive messages - Node Websockets
15+
- name: Send and receive messages - Node WebSockets
1616
href: relay-hybrid-connections-node-get-started.md
1717
- name: Send and receive messages - Node HTTP
1818
href: relay-hybrid-connections-http-requests-node-get-started.md
@@ -59,10 +59,12 @@
5959
href: relay-hybrid-connections-dotnet-api-overview.md
6060
- name: Node
6161
href: relay-hybrid-connections-node-ws-api-overview.md
62-
- name: Manage
62+
- name: Manage and monitor
6363
items:
6464
- name: Monitor Azure Relay with Azure Monitoring
6565
href: relay-metrics-azure-monitor.md
66+
- name: Set up diagnostic logs
67+
href: diagnostic-logs.md
6668
- name: Reference
6769
items:
6870
- name: .NET
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
title: Diagnostics logs for Hybrid Connections
3+
description: This article provides an overview of all the activity and diagnostics logs that are available for Azure Relay.
4+
services: service-bus-messaging
5+
author: spelluru
6+
editor:
7+
8+
ms.assetid:
9+
ms.service: service-bus-relay
10+
ms.devlang: na
11+
ms.topic: how-to
12+
ms.tgt_pltfrm: na
13+
ms.date: 04/27/2020
14+
ms.author: spelluru
15+
16+
---
17+
# Enable diagnostics logs for Azure Relay Hybrid Connections
18+
When you start using your Azure Relay Hybrid Connections, you might want to monitor how and when your listeners and senders are opened and closed, and how your Hybrid Connections are created and messages are sent. This article provides an overview of activity and diagnostics logs provided by the Azure Relay service.
19+
20+
You can view two types of logs for Azure Relay:
21+
22+
- [Activity logs](../azure-monitor/platform/platform-logs-overview.md): These logs have information about operations performed against your namespace in the Azure portal or through Azure Resource Manager template. These logs are always enabled. For example: "Create or update namespace", "Create or update hybrid connection".
23+
- [Diagnostic logs](../azure-monitor/platform/platform-logs-overview.md): You can configure diagnostic logs for a richer view of everything that happens with operations and actions that are conducted against your namespace by using the API, or through language SDK.
24+
25+
## View activity logs
26+
To view activity logs for your Azure Relay namespace, switch to the **Activity log** page in the Azure portal.
27+
28+
![Azure Relay - activity log](./media/diagnostic-logs/activity-log.png)
29+
30+
## Enable diagnostic logs
31+
32+
> [!NOTE]
33+
> Diagnostic logs are available only for Hybrid Connections, not for Windows Communication Foundation (WCF) Relay.
34+
35+
To enable diagnostics logs, do the following steps:
36+
37+
1. In the [Azure portal](https://portal.azure.com), go to your Azure Relay namespace and then, under **Monitoring**, select **Diagnostic settings**.
38+
1. On the **Diagnostics settings** page, select **Add diagnostic setting**.
39+
40+
![The "Add diagnostic setting" link](./media/diagnostic-logs/add-diagnostic-setting.png)
41+
42+
1. Configure the diagnostics settings by doing the following steps:
43+
1. In the **Name** box, enter a name for the diagnostics settings.
44+
2. Select **HybridConnectionsEvent** for the type of log.
45+
3. Select one of the following three **destinations** for your diagnostics logs:
46+
1. If you select **Archive to a storage account**, configure the storage account where the diagnostics logs will be stored.
47+
2. If you select **Stream to an event hub**, configure the event hub that you want to stream the diagnostics logs to.
48+
3. If you select **Send to Log Analytics**, specify which instance of Log Analytics the diagnostics will be sent to.
49+
50+
![Sample diagnostic settings](./media/diagnostic-logs/sample-diagnostic-settings.png)
51+
1. Select **Save** on the toolbar to save the settings.
52+
53+
The new settings take effect in about 10 minutes. The logs are displayed in the configured archival target, in the **Diagnostics logs** pane. For more information about configuring diagnostics settings, see the [overview of Azure diagnostics logs](../azure-monitor/platform/diagnostic-logs-overview.md).
54+
55+
56+
## Schema for hybrid connections events
57+
Hybrid connections event log JSON strings include the elements listed in the following table:
58+
59+
| Name | Description |
60+
| ------- | ------- |
61+
| ResourceId | Azure Resource Manager resource ID |
62+
| ActivityId | Internal ID, used to identify the specified operation. May also be known as "TrackingId" |
63+
| Endpoint | The address of the Relay resource |
64+
| OperationName | The type of the Hybrid Connections operation that’s  being logged |
65+
| EventTimeString | The UTC timestamp of the log record |
66+
| Message | The detailed message of the event |
67+
| Category | Category of the event. Currently, there is only `HybridConnectionsEvents`.
68+
69+
70+
## Sample hybrid connections event
71+
Here's a sample hybrid connections event in JSON format.
72+
73+
```json
74+
{
75+
"resourceId": "/SUBSCRIPTIONS/0000000000-0000-0000-0000-0000000000000/RESOURCEGROUPS/MyResourceGroup/PROVIDERS/MICROSOFT.RELAY/NAMESPACES/MyRelayNamespace",
76+
"ActivityId": "7006a0db-27eb-445c-939b-ce86133014cc",
77+
"endpoint": "sb://myrelaynamespace.servicebus.windows.net/myhybridconnection/7006a0db-27eb-445c-939b-ce86133014cc_G5",
78+
"operationName": "Microsoft.Relay/HybridConnections/NewSenderRegistering",
79+
"EventTimeString": "2020-04-27T20:27:57.3842810Z",
80+
"message": "A new sender is registering.",
81+
"category": "HybridConnectionsEvent"
82+
}
83+
```
84+
85+
## Events and operations captured in diagnostic logs
86+
87+
| Operation | Description |
88+
| --------- | ----------- |
89+
| AuthorizationFailed | Authorization failed.|
90+
| InvalidSasToken | Invalid SAS token. |
91+
| ListenerAcceptingConnection | The listener is accepting connection. |
92+
| ListenerAcceptingConnectionTimeout | The listener accepting connection has timed out. |
93+
| ListenerAcceptingHttpRequestFailed | The listener accepting HTTP request failed due to an exception. |
94+
| ListenerAcceptingRequestTimeout | The listener accepting request has timed out. |  
95+
| ListenerClosingFromExpiredToken | The listener is closing because the security token has expired. | 
96+
| ListenerRejectedConnection | The listener has rejected the connection. |
97+
| ListenerReturningHttpResponse | The listener is returning an HTTP response. |  
98+
| ListenerReturningHttpResponseFailed | The listener is returning an HTTP response with a failure code. |
99+
ListenerSentHttpResponse | Relay service has received an HTTP response from the listener. |
100+
| ListenerUnregistered | The listener is unregistered. |
101+
| ListenerUnresponsive | The listener is unresponsive when returning a response. |
102+
| MessageSendingToListener | Message is being sent to listener. |
103+
| MessageSentToListener | Message is sent to listener. |
104+
| NewListenerRegistered | New listener registered. |
105+
| NewSenderRegistering | New sender is registering. |
106+
| ProcessingRequestFailed | The processing of a Hybrid Connection operation has failed. |
107+
| SenderConnectionClosed | The sender connection is closed. |
108+
| SenderListenerConnectionEstablished | The sender and listener established connection successfully. |
109+
| SenderSentHttpRequest | The sender sent an HTTP request. |
110+
111+
112+
## Next steps
113+
114+
To learn more about Azure Relay, see:
115+
116+
* [Introduction to Azure Relay](relay-what-is-it.md)
117+
* [Get started with Relay Hybrid Connections](relay-hybrid-connections-dotnet-get-started.md)
62.2 KB
Loading
78.6 KB
Loading
76.7 KB
Loading

0 commit comments

Comments
 (0)