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
[receiver/azureeventhub] Implements support to ingest app metrics (#41367)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
* Extends the metrics unmarshaler with support for parsing metrics with
type "AppMetrics" forwarded from Application Insights
* Moves the appending of attributes into each record, as if there could
be records from multiple resources within the same payload
* Implements an optional average aggregator, configured in the component
config
<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes#41343
<!--Describe what testing was performed and which tests were added.-->
#### Testing
Tests added for the parsing of both resource and app metrics.
Maybe not of value for you, but tested in my development environment in
Azure, receiving metrics from remote tenants and exporting to a managed
prometheus data collection rule using the Prometheus remote writer
exporter.
<!--Describe the documentation added.-->
#### Documentation
I'm happy to extend the documentation if this code and feature is of any
interest
<!--Please delete paragraphs that you did not use before submitting.-->
---------
Co-authored-by: Antoine Toulme <[email protected]>
# Use this changelog template to create an entry for release notes.
2
+
3
+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4
+
change_type: enhancement
5
+
6
+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7
+
component: receiver/azureeventhub
8
+
9
+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10
+
note: "Adds support for receiving Azure app metrics from Azure Event Hubs in the azureeventhubreceiver"
11
+
12
+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13
+
issues:
14
+
- 41343
15
+
- 41367
16
+
17
+
# (Optional) One or more lines of additional information to render under the primary note.
18
+
# These lines will be padded with 2 spaces and then inserted directly into the document.
19
+
# Use pipe (|) for multiline entries.
20
+
subtext: |
21
+
The azureeventhubreceiver now supports receiving custom metrics emitted by applications to Azure Insights and forwarded using Diagnostic Settings to Azure Event Hub.
22
+
There's also on optional setting to aggregate received metrics into a single metric to keep the original name, instead of multiply the metrics by added suffixes `_total`, `_sum`, `_max` etc.
23
+
24
+
# If your change doesn't affect end users or the exported elements of any package,
25
+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
26
+
# Optional: The change log or logs in which this entry should be included.
27
+
# e.g. '[user]' or '[user, api]'
28
+
# Include 'user' if the change is relevant to end users.
29
+
# Include 'api' if there is a change to a library API.
to send their logs to an Azure Event Hub. The Azure Event Hub receiver pulls logs from an Azure
21
+
to send their telemetry to an Azure Event Hub. The Azure Event Hub receiver pulls telemetry from an Azure
21
22
Event Hub, transforms them, and pushes them through the collector pipeline.
22
23
24
+
### Read further
25
+
26
+
*[Diagnostic settings in Azure Monitor](https://learn.microsoft.com/en-us/azure/azure-monitor/platform/diagnostic-settings?tabs=portal)
27
+
*[Stream Azure monitoring data to an event hub and external partner](https://learn.microsoft.com/en-us/azure/azure-monitor/platform/stream-monitoring-data-event-hubs)
28
+
23
29
## Configuration
24
30
25
31
### connection (Required)
@@ -58,6 +64,21 @@ All supported time format for logs, metrics and traces. Default is `nil` (unset)
58
64
59
65
Default: `nil`
60
66
67
+
### metric_aggregation (optional)
68
+
69
+
Metric records received from an Azure Event Hub will contain multiple aggregated datapoints. Depending on the
70
+
[type of metric](https://learn.microsoft.com/en-us/azure/azure-monitor/metrics/data-platform-metrics#types-of-metrics),
71
+
these datapoints will be slightly different, but all contain a total/sum, min, max and count. This setting will manage
72
+
these datapoints.
73
+
74
+
#### Possible values:
75
+
76
+
* By default, these datapoints will be mapped to metrics named with a corresponding suffix, like `_total`, `_min`, etc.
77
+
See [azure format](#azure).
78
+
* With `average`, datapoints will be aggregated into an average value (`sum/count`), and keep the original metric name.
79
+
80
+
Default: `nil`
81
+
61
82
> [!NOTE]
62
83
> You can opt-in to use the [`azeventhubs`](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/messaging/azeventhubs) sdk by enabling the feature gate
63
84
> `receiver.azureeventhubreceiver.UseAzeventhubs` when you run the OpenTelemetry Collector. See the following page
@@ -102,10 +123,13 @@ The "raw" format maps the AMQP properties and data into the
102
123
attributes and body of an OpenTelemetry LogRecord, respectively.
103
124
The body is represented as a raw byte array.
104
125
105
-
This format is not supported for Metrics.
126
+
> [!WARN]
127
+
> This format is not supported for Metrics.
106
128
107
129
### azure
108
130
131
+
#### Logs
132
+
109
133
The "azure" format extracts the Azure log records from the AMQP
110
134
message data, parses them, and maps the fields to OpenTelemetry
111
135
attributes. The table below summarizes the mapping between the
@@ -137,8 +161,18 @@ Notes:
137
161
* JSON does not distinguish between fixed and floating point numbers. All
138
162
JSON numbers are encoded as doubles.
139
163
164
+
#### Metrics
165
+
140
166
For Metrics the Azure Metric Records are an array
141
-
of "records" with the following fields.
167
+
of "records" with the following fields, by
168
+
[type of metric](https://learn.microsoft.com/en-us/azure/azure-monitor/metrics/data-platform-metrics#types-of-metrics).
169
+
170
+
From this data a Metric of type Gauge is created
171
+
with a Data Points that represents the values
172
+
for the Metric including: Total, Minimum, Maximum,
0 commit comments