feat(outputs.azure_data_explorer): Set user agent string (#14047)

This commit is contained in:
Ramachandran A G 2023-10-04 13:26:31 +05:30 committed by GitHub
parent 360eeec3b6
commit 4759214471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import (
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/config"
"github.com/influxdata/telegraf/internal"
"github.com/influxdata/telegraf/internal/choice"
"github.com/influxdata/telegraf/plugins/outputs"
"github.com/influxdata/telegraf/plugins/serializers"
@ -58,6 +59,8 @@ func (*AzureDataExplorer) SampleConfig() string {
// Initialize the client and the ingestor
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, "")
client, err := kusto.New(conn)
if err != nil {
return err