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
[exporter/azuremonitor] Add support for custom events in Azure Monitor exporter (#38609)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add support for custom events in Azure Monitor exporter. Added a new
config `custom_events_enabled ` (default = `false`): Enables export log
record to custom events when there's attribute
`microsoft.custom_event.name` or
`APPLICATION_INSIGHTS_EVENT_MARKER_ATTRIBUTE`. Since the
`custom_events_enabled ` is false by default, it'll not break current
behavior.
The logic is align with current azure-sdk-for-js.
https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/monitor/monitor-opentelemetry-exporter/src/utils/logUtils.ts#L78C3-L78C67
<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes#37422
<!--Describe what testing was performed and which tests were added.-->
#### Testing
- added new tests for custom event data
- validated using multiple azure application insights, with enable or
not enable `custom_events_enabled `.
<!--Describe the documentation added.-->
#### Documentation
added new optional configuration
```
- `custom_events_enabled ` (default = `false`): Enables export log record to custom events when there's attribute `microsoft.custom_event.name` or `APPLICATION_INSIGHTS_EVENT_MARKER_ATTRIBUTE`.
```
added document for custom events
```
#### Custom Events
When `custom_events_enabled ` = `true`, azure monitor exporter will export log record to custom events when there's attribute `microsoft.custom_event.name` or `APPLICATION_INSIGHTS_EVENT_MARKER_ATTRIBUTE`.
```
<!--Please delete paragraphs that you did not use before submitting.-->
Copy file name to clipboardExpand all lines: exporter/azureblobexporter/README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -30,11 +30,11 @@ The following settings can be optionally configured and have default values:
30
30
- metrics (default `metrics`): container to store metrics. default value is `metrics`.
31
31
- logs (default `logs`): container to store logs. default value is `logs`.
32
32
- traces (default `traces`): container to store traces. default value is `traces`.
33
-
- blob_name_format:
34
-
- metrics_format (default `2006/01/02/metrics_15_04_05_{{.SerialNum}}.{{.FileExtension}}`): blob name format. The date format follows constants in Golang, refer [here](https://go.dev/src/time/format.go).
35
-
- logs_format (default `2006/01/02/logs_15_04_05_{{.SerialNum}}.{{.FileExtension}}`): blob name format.
36
-
- traces_format (default `2006/01/02/traces_15_04_05_{{.SerialNum}}.{{.FileExtension}}`): blob name format.
37
-
- serial_num_range (default `10000`): a range of random number for SerialNum.
33
+
- blob_name_format: the final blob name will be blob_name +
34
+
- metrics_format (default `2006/01/02/metrics_15_04_05.json`): blob name format. The date format follows constants in Golang, refer [here](https://go.dev/src/time/format.go).
35
+
- logs_format (default `2006/01/02/logs_15_04_05.json`): blob name format.
36
+
- traces_format (default `2006/01/02/traces_15_04_05.json`): blob name format.
37
+
- serial_num_range (default `10000`): a range of random number to be appended after blob_name. e.g. `blob_name_{serial_num}`.
38
38
- format (default `json`): `json` or `proto`. which present otel json or otel protobuf format, the file extension will be `json` or `pb`.
39
39
- encodings (default using encoding specified in `format`, which is `json`): if specified, uses the encoding extension to encode telemetry data. Overrides format.
Copy file name to clipboardExpand all lines: exporter/azuremonitorexporter/README.md
+5
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,7 @@ The following settings can be optionally configured:
43
43
-`queue_size` (default = 1000): Maximum number of batches kept in memory before data; ignored if `enabled` is `false`
44
44
-`storage` (default = `none`): When set, enables persistence and uses the component specified as a storage extension for the persistent queue
45
45
-`shutdown_timeout` (default = 1s): Timeout to wait for graceful shutdown. Once exceeded, the component will shut down forcibly, dropping any element in queue.
46
+
-`custom_events_enabled` (default = `false`): Enables export log record to custom events when there's attribute `microsoft.custom_event.name` or `APPLICATION_INSIGHTS_EVENT_MARKER_ATTRIBUTE`.
46
47
47
48
Example:
48
49
@@ -118,6 +119,10 @@ Exception events are saved to the Application Insights `exception` table.
118
119
This exporter saves log records to Application Insights `traces` table.
119
120
[TraceId](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-traceid) is mapped to `operation_id` column and [SpanId](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-spanid) is mapped to `operation_parentId` column.
120
121
122
+
#### Custom Events
123
+
124
+
When `custom_events_enabled` = `true`, azure monitor exporter will export log record to custom events when there's attribute `microsoft.custom_event.name` or `APPLICATION_INSIGHTS_EVENT_MARKER_ATTRIBUTE`.
125
+
121
126
### Metrics
122
127
123
128
This exporter saves metrics to Application Insights `customMetrics` table.
0 commit comments