diff --git a/plugins/common/adx/adx_commons_test.go b/plugins/common/adx/adx_commons_test.go index d3bb9fa71297f..f25dcfbf11dc4 100644 --- a/plugins/common/adx/adx_commons_test.go +++ b/plugins/common/adx/adx_commons_test.go @@ -137,19 +137,13 @@ func TestWrite(t *testing.T) { require.EqualError(t, errorInWrite, tC.expectedWriteError) } else { require.NoError(t, errorInWrite) - expectedNameOfMetric := tC.expected["metricName"].(string) - createdFakeIngestor := localFakeIngestor - require.Equal(t, expectedNameOfMetric, createdFakeIngestor.actualOutputMetric["name"]) - expectedFields := tC.expected["fields"].(map[string]interface{}) require.Equal(t, expectedFields, createdFakeIngestor.actualOutputMetric["fields"]) - expectedTags := tC.expected["tags"].(map[string]interface{}) require.Equal(t, expectedTags, createdFakeIngestor.actualOutputMetric["tags"]) - expectedTime := tC.expected["timestamp"].(float64) require.InDelta(t, expectedTime, createdFakeIngestor.actualOutputMetric["timestamp"], testutil.DefaultDelta) } diff --git a/plugins/outputs/microsoft_fabric/microsoft_fabric.go b/plugins/outputs/microsoft_fabric/microsoft_fabric.go index dc182c8b64356..1083b73e60727 100644 --- a/plugins/outputs/microsoft_fabric/microsoft_fabric.go +++ b/plugins/outputs/microsoft_fabric/microsoft_fabric.go @@ -21,8 +21,8 @@ var sampleConfig string type MicrosoftFabric struct { ConnectionString string `toml:"connection_string"` Log telegraf.Logger `toml:"-"` - ADXConf *adx_commons.AzureDataExplorer `toml:"adx_conf"` - EHConf *eh_commons.EventHubs `toml:"eh_conf"` + EventHouseConf *adx_commons.AzureDataExplorer `toml:"eh_conf"` + EventStreamConf *eh_commons.EventHubs `toml:"es_conf"` FabricSinkService telegraf.Output } @@ -50,7 +50,7 @@ func (m *MicrosoftFabric) Init() error { ConnectionString := m.ConnectionString if ConnectionString == "" { - return errors.New("endpoint must not be empty. For Kusto refer : https://learn.microsoft.com/kusto/api/connection-strings/kusto?view=microsoft-fabric for EventHouse refer : https://learn.microsoft.com/fabric/real-time-intelligence/event-streams/add-manage-eventstream-sources?pivots=enhanced-capabilities") + return errors.New("endpoint must not be empty. For Eventhouse refer : https://learn.microsoft.com/kusto/api/connection-strings/kusto?view=microsoft-fabric .For Eventstream refer : https://learn.microsoft.com/fabric/real-time-intelligence/event-streams/add-manage-eventstream-sources?pivots=enhanced-capabilities") } if strings.HasPrefix(ConnectionString, "Endpoint=sb") { @@ -61,18 +61,18 @@ func (m *MicrosoftFabric) Init() error { TimestampUnits: config.Duration(time.Nanosecond), TimestampFormat: time.RFC3339Nano, } - m.EHConf.ConnectionString = ConnectionString - m.EHConf.Log = m.Log - m.EHConf.SetSerializer(serializer) - m.EHConf.Init() - m.FabricSinkService = m.EHConf + m.EventStreamConf.ConnectionString = ConnectionString + m.EventStreamConf.Log = m.Log + m.EventStreamConf.SetSerializer(serializer) + m.EventStreamConf.Init() + m.FabricSinkService = m.EventStreamConf } else if isKustoEndpoint(strings.ToLower(ConnectionString)) { m.Log.Info("Detected Kusto endpoint, using Kusto output plugin") //Setting up the AzureDataExplorer plugin initial properties - m.ADXConf.Endpoint = ConnectionString - m.ADXConf.Log = m.Log - m.ADXConf.Init() - m.FabricSinkService = m.ADXConf + m.EventHouseConf.Endpoint = ConnectionString + m.EventHouseConf.Log = m.Log + m.EventHouseConf.Init() + m.FabricSinkService = m.EventHouseConf } else { return errors.New("invalid connection string. For Kusto refer : https://learn.microsoft.com/kusto/api/connection-strings/kusto?view=microsoft-fabric for EventHouse refer : https://learn.microsoft.com/fabric/real-time-intelligence/event-streams/add-manage-eventstream-sources?pivots=enhanced-capabilities") } @@ -100,12 +100,12 @@ func init() { outputs.Add("microsoft_fabric", func() telegraf.Output { return &MicrosoftFabric{ - ADXConf: &adx_commons.AzureDataExplorer{ + EventHouseConf: &adx_commons.AzureDataExplorer{ Timeout: config.Duration(20 * time.Second), CreateTables: true, AppName: "Fabric.Telegraf", }, - EHConf: &eh_commons.EventHubs{ + EventStreamConf: &eh_commons.EventHubs{ Hub: &eh_commons.EventHub{}, Timeout: config.Duration(30 * time.Second), }, diff --git a/plugins/outputs/microsoft_fabric/microsoft_fabric_test.go b/plugins/outputs/microsoft_fabric/microsoft_fabric_test.go index 196ba51ee6006..0c8b9d38a6869 100644 --- a/plugins/outputs/microsoft_fabric/microsoft_fabric_test.go +++ b/plugins/outputs/microsoft_fabric/microsoft_fabric_test.go @@ -156,8 +156,8 @@ func TestMicrosoftFabric_Init(t *testing.T) { mf := &MicrosoftFabric{ ConnectionString: tt.connectionString, Log: testutil.Logger{}, - ADXConf: &adx_commons.AzureDataExplorer{}, - EHConf: &eh_commons.EventHubs{ + EventHouseConf: &adx_commons.AzureDataExplorer{}, + EventStreamConf: &eh_commons.EventHubs{ Hub: &eh_commons.EventHub{}, Timeout: config.Duration(30 * time.Second), }, diff --git a/plugins/outputs/microsoft_fabric/sample.conf b/plugins/outputs/microsoft_fabric/sample.conf index b739e4d225244..a6f5cf07f9c2b 100644 --- a/plugins/outputs/microsoft_fabric/sample.conf +++ b/plugins/outputs/microsoft_fabric/sample.conf @@ -1,20 +1,20 @@ # Sends metrics to Microsoft Fabric [[outputs.microsoft_fabric]] - ## The URI property of the Azure Data Explorer resource on Azure + ## The URI property of the Eventhouse resource on Azure ## ex: connection_string = https://myadxresource.australiasoutheast.kusto.windows.net connection_string = "" - [outputs.microsoft_fabric.adx_conf] - ## The Azure Data Explorer database that the metrics will be ingested into. + [outputs.microsoft_fabric.eh_conf] + ## The Eventhouse database that the metrics will be ingested into. ## The plugin will NOT generate this database automatically, it's expected that this database already exists before ingestion. ## ex: "exampledatabase" database = "" - ## Timeout for Azure Data Explorer operations + ## Timeout for Eventhouse operations # timeout = "20s" - ## Type of metrics grouping used when pushing to Azure Data Explorer. + ## Type of metrics grouping used when pushing to Eventhouse. ## Default is "TablePerMetric" for one table per different metric. ## For more information, please check the plugin README. # metrics_grouping_type = "TablePerMetric" @@ -32,9 +32,9 @@ ## - queued -- queue up metrics data and process sequentially # ingestion_type = "queued" - [outputs.microsoft_fabric.eh_conf] - ## The full connection string to the Event Hub (required) - ## The shared access key must have "Send" permissions on the target Event Hub. + [outputs.microsoft_fabric.es_conf] + ## The full connection string to the Event stream (required) + ## The shared access key must have "Send" permissions on the target Event stream. ## Client timeout (defaults to 30s) # timeout = "30s" @@ -46,9 +46,9 @@ # partition_key = "" ## Set the maximum batch message size in bytes - ## The allowable size depends on the Event Hub tier + ## The allowable size depends on the Event stream tier ## See: https://learn.microsoft.com/azure/event-hubs/event-hubs-quotas#basic-vs-standard-vs-premium-vs-dedicated-tiers - ## Setting this to 0 means using the default size from the Azure Event Hubs Client library (1000000 bytes) + ## Setting this to 0 means using the default size from the Azure Event streams Client library (1000000 bytes) # max_message_size = 1000000 ## Data format to output.