2024-10-29 01:00:22 +08:00
|
|
|
# Azure Application Insights Output Plugin
|
2018-05-16 07:05:59 +08:00
|
|
|
|
2024-10-29 01:00:22 +08:00
|
|
|
This plugin writes metrics to the [Azure Application Insights][insights]
|
|
|
|
|
service.
|
|
|
|
|
|
|
|
|
|
⭐ Telegraf v1.7.0
|
|
|
|
|
🏷️ applications, cloud
|
|
|
|
|
💻 all
|
|
|
|
|
|
|
|
|
|
[insights]: https://azure.microsoft.com/en-us/services/application-insights/
|
2018-05-16 07:05:59 +08:00
|
|
|
|
2022-10-27 03:58:36 +08:00
|
|
|
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
|
|
|
|
|
|
|
|
|
|
In addition to the plugin-specific configuration settings, plugins support
|
|
|
|
|
additional global and plugin configuration settings. These settings are used to
|
|
|
|
|
modify metrics, tags, and field or create aliases and configure ordering, etc.
|
|
|
|
|
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
|
|
|
|
|
2023-01-12 23:55:21 +08:00
|
|
|
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md#plugins
|
2022-10-27 03:58:36 +08:00
|
|
|
|
2021-11-25 02:47:33 +08:00
|
|
|
## Configuration
|
|
|
|
|
|
2022-05-25 22:48:59 +08:00
|
|
|
```toml @sample.conf
|
2022-04-08 05:55:03 +08:00
|
|
|
# Send metrics to Azure Application Insights
|
2018-05-16 07:05:59 +08:00
|
|
|
[[outputs.application_insights]]
|
|
|
|
|
## Instrumentation key of the Application Insights resource.
|
2018-05-16 07:42:56 +08:00
|
|
|
instrumentation_key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
|
2021-11-25 02:47:33 +08:00
|
|
|
|
2020-08-20 06:04:24 +08:00
|
|
|
## Regions that require endpoint modification https://docs.microsoft.com/en-us/azure/azure-monitor/app/custom-endpoints
|
|
|
|
|
# endpoint_url = "https://dc.services.visualstudio.com/v2/track"
|
2018-05-16 07:05:59 +08:00
|
|
|
|
2018-05-16 07:42:56 +08:00
|
|
|
## Timeout for closing (default: 5s).
|
2018-05-16 07:05:59 +08:00
|
|
|
# timeout = "5s"
|
|
|
|
|
|
2018-05-16 07:42:56 +08:00
|
|
|
## Enable additional diagnostic logging.
|
2018-09-06 05:19:56 +08:00
|
|
|
# enable_diagnostic_logging = false
|
2018-05-16 07:05:59 +08:00
|
|
|
|
2023-08-29 04:07:45 +08:00
|
|
|
## NOTE: Due to the way TOML is parsed, tables must be at the END of the
|
|
|
|
|
## plugin definition, otherwise additional config options are read as part of
|
|
|
|
|
## the table
|
|
|
|
|
|
2018-05-16 07:42:56 +08:00
|
|
|
## Context Tag Sources add Application Insights context tags to a tag value.
|
|
|
|
|
##
|
|
|
|
|
## For list of allowed context tag keys see:
|
2021-04-28 06:01:45 +08:00
|
|
|
## https://github.com/microsoft/ApplicationInsights-Go/blob/master/appinsights/contracts/contexttagkeys.go
|
2018-05-16 07:05:59 +08:00
|
|
|
# [outputs.application_insights.context_tag_sources]
|
2018-05-16 07:42:56 +08:00
|
|
|
# "ai.cloud.role" = "kubernetes_container_name"
|
|
|
|
|
# "ai.cloud.roleInstance" = "kubernetes_pod_name"
|
2018-05-16 07:05:59 +08:00
|
|
|
```
|
|
|
|
|
|
2021-11-25 02:47:33 +08:00
|
|
|
## Metric Encoding
|
2018-05-16 07:42:56 +08:00
|
|
|
|
|
|
|
|
For each field an Application Insights Telemetry record is created named based
|
|
|
|
|
on the measurement name and field.
|
|
|
|
|
|
|
|
|
|
**Example:** Create the telemetry records `foo_first` and `foo_second`:
|
2021-11-25 02:47:33 +08:00
|
|
|
|
|
|
|
|
```text
|
2018-05-16 07:42:56 +08:00
|
|
|
foo,host=a first=42,second=43 1525293034000000000
|
|
|
|
|
```
|
|
|
|
|
|
2022-04-21 23:45:47 +08:00
|
|
|
In the special case of a single field named `value`, a single telemetry record
|
|
|
|
|
is created named using only the measurement name
|
2018-05-16 07:42:56 +08:00
|
|
|
|
2018-09-06 05:19:56 +08:00
|
|
|
**Example:** Create a telemetry record `bar`:
|
2021-11-25 02:47:33 +08:00
|
|
|
|
|
|
|
|
```text
|
2018-05-16 07:42:56 +08:00
|
|
|
bar,host=a value=42 1525293034000000000
|
|
|
|
|
```
|