sreekanth-db commented on code in PR #3664: URL: https://github.com/apache/arrow-adbc/pull/3664#discussion_r2489688171
########## csharp/src/Drivers/Databricks/Telemetry/DatabricksTelemetryExporter.cs: ########## @@ -0,0 +1,82 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using System.Text; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; + +namespace Apache.Arrow.Adbc.Drivers.Databricks.Telemetry +{ + internal sealed class DatabricksTelemetryExporter : ITelemetryExporter + { + private const string TelemetryEndpoint = "/telemetry-ext"; + + private readonly HttpClient _httpClient; + private readonly string _hostUrl; + + public DatabricksTelemetryExporter(HttpClient httpClient, string hostUrl) + { + _httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); + _hostUrl = !string.IsNullOrEmpty(hostUrl) ? hostUrl : throw new ArgumentException("Host URL cannot be null or empty.", nameof(hostUrl)); + } + + public async Task ExportAsync( Review Comment: The single-method interface is sufficient because batching and aggregation happen in `MetricsAggregator` before reaching the exporter. **FileExporter (OpenTelemetry-based):** Activity → OpenTelemetry SDK → BaseExporter → Local File **DatabricksTelemetryExporter (Custom aggregation):** Activity → DatabricksActivityListener → MetricsAggregator → IDatabricksTelemetryExporter → Databricks Service -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
