fluent-plugin-oci-logging-analytics 2.0.7 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b41804c02cd5e1dd39efc4c600f043cbed2a90972aabc39671c830fedcafe67
4
- data.tar.gz: 24fc404d3f0f4d06f2e9f2167d7bc4fff337a235f9671e7e024ce71763750cb8
3
+ metadata.gz: e5a472e64d8b068a1d4ae4d9c8007c0cfcfae37290ec188ff6a1e7a97f9b3005
4
+ data.tar.gz: be3762be1e1e6794672bc9ff21871a96d6a5a82053743c6432bab4ca209e0d22
5
5
  SHA512:
6
- metadata.gz: a779a1971cabf78edf2c0b14ae6ba06235ce4113fe0ded3b264d626baba6c7f82f3aabdcb029890cb52697b2b01ae119691c7412e7920c79ada71ce8ed060fff
7
- data.tar.gz: ef679bc249d8d16bc12a447f158c19faea8425c98170aecfbd7053da7d4081876f2b830f7c59dcef50e4abb9422d8e2cac30e91c16bffc4cf8e33072f931fe9c
6
+ metadata.gz: ed1e0a0ee7201c4ad6a2b0cb632fddf155778569ff47762d12407f1bf76c431d8cffb32bdb391f84b484eaf4698d1b457c2ddfcfa4e46b61a02ff550d4c3a650
7
+ data.tar.gz: 685a2f9fe44d8fbe8b49c64880a2f2bafe065242e1a2700b8ac3e40cb14b66ff0aa3b3a3975a9da7d62bbec203f3fb59700f950a33fbee78ab1e1e45dc1738f6
@@ -21,5 +21,4 @@ class LogEvents
21
21
  timezone:@timezone
22
22
  }.compact
23
23
  end
24
-
25
24
  end
@@ -20,5 +20,4 @@ class LogEventsJson
20
20
  end
21
21
  }.compact
22
22
  end
23
-
24
23
  end
File without changes
@@ -92,6 +92,8 @@ module Fluent::Plugin
92
92
  config_param :endpoint, :string, :default => nil
93
93
  desc 'AuthType to be used.'
94
94
  config_param :auth_type, :string, :default => 'InstancePrincipal'
95
+ desc 'OCI Domain'
96
+ config_param :oci_domain, :string, :default => nil
95
97
  desc 'Enable local payload dump.'
96
98
  config_param :dump_zip_file, :bool, :default => false
97
99
  desc 'Payload zip File Location.'
@@ -249,34 +251,62 @@ module Fluent::Plugin
249
251
  if is_valid(@config_file_location)
250
252
  @auth_type = "ConfigFile"
251
253
  end
254
+
252
255
  case @auth_type
253
- when "InstancePrincipal"
254
- instance_principals_signer = OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner.new
255
- if is_valid(@endpoint)
256
- @@loganalytics_client = OCI::LogAnalytics::LogAnalyticsClient.new(config: OCI::Config.new, endpoint: @endpoint, signer: instance_principals_signer)
257
- @@logger.info {"loganalytics_client initialised with endpoint: #{@endpoint}"}
258
- else
259
- @@loganalytics_client = OCI::LogAnalytics::LogAnalyticsClient.new(config: OCI::Config.new, signer: instance_principals_signer)
260
- end
261
- when "WorkloadIdentity"
262
- workload_identity_signer = OCI::Auth::Signers::oke_workload_resource_principal_signer
263
- if is_valid(@endpoint)
264
- @@loganalytics_client = OCI::LogAnalytics::LogAnalyticsClient.new(config: OCI::Config.new, endpoint: @endpoint, signer: workload_identity_signer)
265
- @@logger.info {"loganalytics_client initialised with endpoint: #{@endpoint}"}
266
- else
267
- @@loganalytics_client = OCI::LogAnalytics::LogAnalyticsClient.new(config: OCI::Config.new, signer: workload_identity_signer)
268
- end
269
- when "ConfigFile"
270
- my_config = OCI::ConfigFileLoader.load_config(config_file_location: @config_file_location, profile_name: @profile_name)
271
- if is_valid(@endpoint)
272
- @@loganalytics_client = OCI::LogAnalytics::LogAnalyticsClient.new(config: my_config, endpoint: @endpoint)
273
- @@logger.info {"loganalytics_client initialised with endpoint: #{@endpoint}"}
274
- else
275
- @@loganalytics_client = OCI::LogAnalytics::LogAnalyticsClient.new(config:my_config)
276
- end
256
+ when "InstancePrincipal"
257
+ instance_principals_signer = nil
258
+ la_endpoint = nil
259
+ if is_valid(@oci_domain)
260
+ fedration_endpoint = "https://auth.#{@oci_domain}/v1/x509"
261
+ instance_principals_signer = OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner.new(
262
+ federation_endpoint: fedration_endpoint)
263
+ @@logger.info "Custom Federation Endpoint: #{fedration_endpoint}"
277
264
  else
278
- raise Fluent::ConfigError, "Invalid authType @auth_type, authType must be either InstancePrincipal or ConfigFile."
279
- abort
265
+ instance_principals_signer = OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner.new
266
+ end
267
+ if is_valid(@endpoint)
268
+ la_endpoint = @endpoint
269
+ @@logger.info "Initializing loganalytics_client with endpoint: #{la_endpoint}"
270
+ elsif is_valid(@oci_domain)
271
+ la_endpoint = "https://loganalytics.#{@oci_domain}"
272
+ @@logger.info "Initializing loganalytics_client with custom domain endpoint: #{la_endpoint}"
273
+ end
274
+ @@loganalytics_client = OCI::LogAnalytics::LogAnalyticsClient.new(
275
+ config: OCI::Config.new,
276
+ endpoint: la_endpoint,
277
+ signer: instance_principals_signer)
278
+ @@logger.info 'loganalytics_client initialized.'
279
+ when "WorkloadIdentity"
280
+ la_endpoint = nil
281
+ workload_identity_signer = OCI::Auth::Signers::oke_workload_resource_principal_signer
282
+ if is_valid(@endpoint)
283
+ la_endpoint = @endpoint
284
+ @@logger.info "Initializing loganalytics_client with endpoint: #{@endpoint}"
285
+ elsif is_valid(@oci_domain)
286
+ la_endpoint = "https://loganalytics.#{@oci_domain}"
287
+ @@logger.info "Initializing loganalytics_client with custom domain endpoint: #{la_endpoint}"
288
+ end
289
+ @@loganalytics_client = OCI::LogAnalytics::LogAnalyticsClient.new(
290
+ config: OCI::Config.new,
291
+ endpoint: la_endpoint,
292
+ signer: workload_identity_signer)
293
+ @@logger.info 'loganalytics_client initialized.'
294
+ when "ConfigFile"
295
+ my_config = OCI::ConfigFileLoader.load_config(
296
+ config_file_location: @config_file_location,
297
+ profile_name: @profile_name)
298
+ la_endpoint = nil
299
+ if is_valid(@endpoint)
300
+ la_endpoint = @endpoint
301
+ @@logger.info "Initializing loganalytics_client with endpoint: #{la_endpoint}"
302
+ elsif is_valid(@oci_domain)
303
+ la_endpoint = "https://loganalytics.#{@oci_domain}"
304
+ @@logger.info "Initializing loganalytics_client with custom domain endpoint: #{la_endpoint}"
305
+ end
306
+ @@loganalytics_client = OCI::LogAnalytics::LogAnalyticsClient.new(config: my_config, endpoint: la_endpoint)
307
+ @@logger.info 'loganalytics_client initialised'
308
+ else
309
+ raise Fluent::ConfigError, "Invalid authType: #{@auth_type}, valid inputs are - InstancePrincipal, ConfigFile, WorkloadIdentity"
280
310
  end
281
311
 
282
312
  if is_valid(@proxy_ip) && is_number(@proxy_port)
@@ -288,13 +318,18 @@ module Fluent::Plugin
288
318
  end
289
319
 
290
320
  rescue => ex
291
- @@logger.error {"Error occurred while initializing LogAnalytics Client:
292
- authType: #{@auth_type},
293
- errorMessage: #{ex}"}
321
+ @@logger.error {"Error occurred while initializing LogAnalytics Client:
322
+ authType: #{@auth_type},
323
+ errorMessage: #{ex}"}
294
324
  end
295
325
 
296
326
  def configure(conf)
297
327
  super
328
+
329
+ if is_valid(@oci_domain) && !@oci_domain.match(/\S.oci.\S/)
330
+ raise Fluent::ConfigError, "Invalid oci_domain: #{@oci_domain}, valid fmt: <oci-region>.oci.<oci-domain> | ex: us-ashburn-1.oci.oraclecloud.com"
331
+ end
332
+
298
333
  @@prometheusMetrics = PrometheusMetrics.instance
299
334
  initialize_logger
300
335
 
@@ -1,8 +1,8 @@
1
- ## Copyright (c) 2024 Oracle and/or its affiliates.
1
+ ## Copyright (c) 2021, 2024 Oracle and/or its affiliates.
2
2
  ## The Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl/
3
3
 
4
4
  # frozen_string_literal: true
5
5
 
6
6
  module Version
7
- VERSION = "2.0.7".freeze
7
+ VERSION = "2.0.8".freeze
8
8
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-oci-logging-analytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oracle
8
8
  - 'OCI Observability: Logging Analytics'
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-10-10 00:00:00.000000000 Z
12
+ date: 2024-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -136,14 +136,14 @@ files:
136
136
  - lib/fluent/metrics/prometheusMetrics.rb
137
137
  - lib/fluent/plugin/out_oci-logging-analytics.rb
138
138
  - lib/fluent/version/version.rb
139
- homepage:
139
+ homepage:
140
140
  licenses:
141
141
  - UPL-1.0
142
142
  metadata:
143
143
  documentation_uri: https://docs.oracle.com/en/learn/oci_logging_analytics_fluentd/
144
144
  source_code_uri: https://github.com/oracle-quickstart/oci-logan-fluentd-output-plugin
145
145
  changelog_uri: https://github.com/oracle-quickstart/oci-logan-fluentd-output-plugin/blob/main/CHANGELOG.md
146
- post_install_message:
146
+ post_install_message:
147
147
  rdoc_options: []
148
148
  require_paths:
149
149
  - lib
@@ -158,8 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.0.3.1
162
- signing_key:
161
+ rubygems_version: 3.3.27
162
+ signing_key:
163
163
  specification_version: 4
164
164
  summary: Fluentd output plugin for OCI Logging Analytics.
165
165
  test_files: []