From fbc43391c07be039083f949e5bca942c501aebf6 Mon Sep 17 00:00:00 2001 From: Bar Arnon Date: Sun, 26 May 2019 16:20:46 +0300 Subject: [PATCH] Version 0.4.0 (#26) Report plugin name/version when communicating with Kusto --- .vscode/tasks.json | 3 ++- CHANGELOG.md | 4 ++++ lib/logstash/outputs/kusto/ingestor.rb | 5 +++++ logstash-output-kusto.gemspec | 4 ++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 1858b133..44ca7210 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -10,7 +10,8 @@ "group": { "kind": "build", "isDefault": true - } + }, + "problemMatcher": [] }, { "label": "Run tests", diff --git a/CHANGELOG.md b/CHANGELOG.md index 861dff0a..81b85263 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,3 +20,7 @@ - move to version 1.0.0-BETA-04 of azure-kusto-java sdk - better support multiple kusto outputs running in parallel + +## 0.4.0 + +- set 'client name for tracing' to identify usage of this plugin on Kusto logs \ No newline at end of file diff --git a/lib/logstash/outputs/kusto/ingestor.rb b/lib/logstash/outputs/kusto/ingestor.rb index 7ead3019..4207230c 100644 --- a/lib/logstash/outputs/kusto/ingestor.rb +++ b/lib/logstash/outputs/kusto/ingestor.rb @@ -30,6 +30,11 @@ def initialize(ingest_url, app_id, app_key, app_tenant, database, table, mapping @logger.debug('Preparing Kusto resources.') kusto_connection_string = Java::com.microsoft.azure.kusto.data.ConnectionStringBuilder.createWithAadApplicationCredentials(ingest_url, app_id, app_key.value, app_tenant) + + # Unfortunately there's no way to avoid using the gem/plugin name directly... + name_for_tracing = "logstash-output-kusto:#{Gem.loaded_specs['logstash-output-kusto'].version}" + @logger.debug("Client name for tracing: #{name_for_tracing}") + kusto_connection_string.setClientVersionForTracing(name_for_tracing) @kusto_client = Java::com.microsoft.azure.kusto.ingest.IngestClientFactory.createClient(kusto_connection_string) diff --git a/logstash-output-kusto.gemspec b/logstash-output-kusto.gemspec index 29d60e0e..e38a05e5 100644 --- a/logstash-output-kusto.gemspec +++ b/logstash-output-kusto.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| - s.name = 'logstash-output-kusto' - s.version = '0.3.0' + s.name = 'logstash-output-kusto' #WATCH OUT: we hardcoded usage of this name in one of the classes. + s.version = '0.4.0' s.licenses = ['Apache-2.0'] s.summary = 'Writes events to Azure Data Explorer (Kusto)' s.description = 'This is a logstash output plugin used to write events to an Azure Data Explorer (a.k.a Kusto)'