Skip to content

Commit

Permalink
added connector name property to ADX
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-saharn committed Oct 18, 2024
1 parent 62b44b7 commit 2d163ab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/outputs/azure_data_explorer/azure_data_explorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
Expand Down Expand Up @@ -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,
}
})
}
Expand Down

0 comments on commit 2d163ab

Please sign in to comment.