From 2d163ab785376be5824130de712b356514140365 Mon Sep 17 00:00:00 2001 From: Abhishek-saharn Date: Fri, 18 Oct 2024 12:20:16 +0530 Subject: [PATCH 1/4] added connector name property to ADX --- .../outputs/azure_data_explorer/azure_data_explorer.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/outputs/azure_data_explorer/azure_data_explorer.go b/plugins/outputs/azure_data_explorer/azure_data_explorer.go index c89e56f9ca6e8..9cbb71fe1db09 100644 --- a/plugins/outputs/azure_data_explorer/azure_data_explorer.go +++ b/plugins/outputs/azure_data_explorer/azure_data_explorer.go @@ -38,6 +38,7 @@ type AzureDataExplorer struct { IngestionType string `toml:"ingestion_type"` serializer serializers.Serializer kustoClient *kusto.Client + connectorName string metricIngestors map[string]ingest.Ingestor } @@ -60,7 +61,7 @@ func (*AzureDataExplorer) SampleConfig() string { func (adx *AzureDataExplorer) Connect() error { conn := kusto.NewConnectionStringBuilder(adx.Endpoint).WithDefaultAzureCredential() // Since init is called before connect, we can set the connector details here including the type. This will be used for telemetry and tracing. - conn.SetConnectorDetails("Telegraf", internal.ProductToken(), "", "", false, "") + conn.SetConnectorDetails(adx.connectorName, internal.ProductToken(), "", "", false, "") client, err := kusto.New(conn) if err != nil { return err @@ -249,8 +250,9 @@ func (adx *AzureDataExplorer) Init() error { func init() { outputs.Add("azure_data_explorer", func() telegraf.Output { return &AzureDataExplorer{ - Timeout: config.Duration(20 * time.Second), - CreateTables: true, + Timeout: config.Duration(20 * time.Second), + connectorName: "Telegraf", + CreateTables: true, } }) } From deb7be64b18ae0c1f001001ee883c797c7661725 Mon Sep 17 00:00:00 2001 From: Abhishek-saharn Date: Fri, 18 Oct 2024 12:24:43 +0530 Subject: [PATCH 2/4] connector name feild access level change --- plugins/outputs/azure_data_explorer/azure_data_explorer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/outputs/azure_data_explorer/azure_data_explorer.go b/plugins/outputs/azure_data_explorer/azure_data_explorer.go index 9cbb71fe1db09..4fa9dbf4a406d 100644 --- a/plugins/outputs/azure_data_explorer/azure_data_explorer.go +++ b/plugins/outputs/azure_data_explorer/azure_data_explorer.go @@ -38,7 +38,7 @@ type AzureDataExplorer struct { IngestionType string `toml:"ingestion_type"` serializer serializers.Serializer kustoClient *kusto.Client - connectorName string + ConnectorName string metricIngestors map[string]ingest.Ingestor } @@ -61,7 +61,7 @@ func (*AzureDataExplorer) SampleConfig() string { func (adx *AzureDataExplorer) Connect() error { conn := kusto.NewConnectionStringBuilder(adx.Endpoint).WithDefaultAzureCredential() // Since init is called before connect, we can set the connector details here including the type. This will be used for telemetry and tracing. - conn.SetConnectorDetails(adx.connectorName, internal.ProductToken(), "", "", false, "") + conn.SetConnectorDetails(adx.ConnectorName, internal.ProductToken(), "", "", false, "") client, err := kusto.New(conn) if err != nil { return err @@ -251,7 +251,7 @@ func init() { outputs.Add("azure_data_explorer", func() telegraf.Output { return &AzureDataExplorer{ Timeout: config.Duration(20 * time.Second), - connectorName: "Telegraf", + ConnectorName: "Telegraf_ADX", CreateTables: true, } }) From 5fda970eee600460ec2578a057fb3c7e87cc7dc8 Mon Sep 17 00:00:00 2001 From: Abhishek-saharn Date: Fri, 18 Oct 2024 12:54:59 +0530 Subject: [PATCH 3/4] changes to have appName with Telegraf --- .../outputs/azure_data_explorer/azure_data_explorer.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/outputs/azure_data_explorer/azure_data_explorer.go b/plugins/outputs/azure_data_explorer/azure_data_explorer.go index 4fa9dbf4a406d..f53d6df986d57 100644 --- a/plugins/outputs/azure_data_explorer/azure_data_explorer.go +++ b/plugins/outputs/azure_data_explorer/azure_data_explorer.go @@ -38,7 +38,7 @@ type AzureDataExplorer struct { IngestionType string `toml:"ingestion_type"` serializer serializers.Serializer kustoClient *kusto.Client - ConnectorName string + AppName string metricIngestors map[string]ingest.Ingestor } @@ -61,7 +61,7 @@ func (*AzureDataExplorer) SampleConfig() string { func (adx *AzureDataExplorer) Connect() error { conn := kusto.NewConnectionStringBuilder(adx.Endpoint).WithDefaultAzureCredential() // Since init is called before connect, we can set the connector details here including the type. This will be used for telemetry and tracing. - conn.SetConnectorDetails(adx.ConnectorName, internal.ProductToken(), "", "", false, "") + conn.SetConnectorDetails("Telegraf", internal.ProductToken(), adx.AppName, "", false, "") client, err := kusto.New(conn) if err != nil { return err @@ -250,9 +250,9 @@ func (adx *AzureDataExplorer) Init() error { func init() { outputs.Add("azure_data_explorer", func() telegraf.Output { return &AzureDataExplorer{ - Timeout: config.Duration(20 * time.Second), - ConnectorName: "Telegraf_ADX", - CreateTables: true, + Timeout: config.Duration(20 * time.Second), + AppName: "Azure Data Explorer", + CreateTables: true, } }) } From 9d2b2b6b2e7e9b56200dc6dec5ad3484521023ff Mon Sep 17 00:00:00 2001 From: Abhishek Saharn Date: Wed, 23 Oct 2024 14:13:50 +0530 Subject: [PATCH 4/4] app name change --- plugins/outputs/azure_data_explorer/azure_data_explorer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/outputs/azure_data_explorer/azure_data_explorer.go b/plugins/outputs/azure_data_explorer/azure_data_explorer.go index f53d6df986d57..53a6154b8a4de 100644 --- a/plugins/outputs/azure_data_explorer/azure_data_explorer.go +++ b/plugins/outputs/azure_data_explorer/azure_data_explorer.go @@ -251,7 +251,7 @@ func init() { outputs.Add("azure_data_explorer", func() telegraf.Output { return &AzureDataExplorer{ Timeout: config.Duration(20 * time.Second), - AppName: "Azure Data Explorer", + AppName: "Kusto.Telegraf", CreateTables: true, } })