opentelemetry-instrumentation-mysql2 0.8.0 → 0.12.0

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: 37aeb6d50f79ff64ae25d3ec1477380f40e3e33647ee92668b5704ed794ad08e
4
- data.tar.gz: c5c8099d582718055f10a6c070b1c081997ddc7c767cdc49093569b43a6e8c47
3
+ metadata.gz: 34d23971b7133786421179cfa09e50957b361272c0736e04f20b0ef8e15e0d88
4
+ data.tar.gz: 6f8ee3e0aac1613222dd0381b442373e514d92b8f858c6ba36cf374004b8c317
5
5
  SHA512:
6
- metadata.gz: 3f8c8b9c99ee80cc956ccdb64ce8064626b51bf51fbe701dbfc60cfa471af13821d2274a1b75db9ae6df6bbea8432fa4d15534e7aa786f17635f2f0acae90ebc
7
- data.tar.gz: 268a2f91f84377d3d6999f3bd1cd41765a48eb9509a6eca29b0af0b82a69dc88519fd34ab5805d7560b4b34a7cc60cd86a8eb22f0d14259574f483f6db105218
6
+ metadata.gz: eee95d5e64bf7d7639c0153d412c6d6e38718159e299a2e693082d43b46f05fba03e2b082ecfb87acd5a158d2e4d031bc8d61e400e022122f38673fbf77ff5bf
7
+ data.tar.gz: f4cde8d2bc557045c2d3c083ae9973f73c3da3ba4757544169b9dd127c23d309456f4a90d21730fdde757d4011d414657041760e2daf6f505563a0dd11c5dc6c
@@ -1,5 +1,28 @@
1
1
  # Release History: opentelemetry-instrumentation-mysql2
2
2
 
3
+ ### v0.12.0 / 2020-12-24
4
+
5
+ * (No significant changes)
6
+
7
+ ### v0.11.0 / 2020-12-11
8
+
9
+ * ADDED: Add peer service config to mysql
10
+ * FIXED: Copyright comments to not reference year
11
+
12
+ ### v0.10.1 / 2020-12-09
13
+
14
+ * FIXED: Semantic conventions db.type -> db.system
15
+
16
+ ### v0.10.0 / 2020-12-03
17
+
18
+ * (No significant changes)
19
+
20
+ ### v0.9.0 / 2020-11-27
21
+
22
+ * BREAKING CHANGE: Add timeout for force_flush and shutdown
23
+
24
+ * ADDED: Add timeout for force_flush and shutdown
25
+
3
26
  ### v0.8.0 / 2020-10-27
4
27
 
5
28
  * BREAKING CHANGE: Remove 'canonical' from status codes
data/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2020 OpenTelemetry Authors
189
+ Copyright The OpenTelemetry Authors
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -45,12 +45,12 @@ module OpenTelemetry
45
45
  private
46
46
 
47
47
  def database_span_name(sql)
48
- # Without obfuscation SQL Queries, setting span name
49
- # To the sql query woud result in PII+Cardinality issues
48
+ # Setting span name to the SQL query without obfuscation would
49
+ # result in PII + cardinality issues.
50
50
  # First attempt to infer the statement type then fallback to
51
- # Current Otel apprroach {database.component_name}.{database_instance_name}
51
+ # current Otel approach {database.component_name}.{database_instance_name}
52
52
  # https://github.com/open-telemetry/opentelemetry-python/blob/39fa078312e6f41c403aa8cad1868264011f7546/ext/opentelemetry-ext-dbapi/tests/test_dbapi_integration.py#L53
53
- # This would create span names like mysql.default, mysql.replica, postgresql.staging etc etc
53
+ # This creates span names like mysql.default, mysql.replica, postgresql.staging etc.
54
54
 
55
55
  statement_type = extract_statement_type(sql)
56
56
 
@@ -72,19 +72,25 @@ module OpenTelemetry
72
72
  host = (query_options[:host] || query_options[:hostname]).to_s
73
73
  port = query_options[:port].to_s
74
74
 
75
- {
76
- 'db.type' => 'mysql',
75
+ attributes = {
76
+ 'db.system' => 'mysql',
77
77
  'db.instance' => database_name,
78
78
  'db.url' => "mysql://#{host}:#{port}",
79
79
  'net.peer.name' => host,
80
80
  'net.peer.port' => port
81
81
  }
82
+ attributes['peer.service'] = config[:peer_service] if config[:peer_service]
83
+ attributes
82
84
  end
83
85
 
84
86
  def tracer
85
87
  Mysql2::Instrumentation.instance.tracer
86
88
  end
87
89
 
90
+ def config
91
+ Mysql2::Instrumentation.instance.config
92
+ end
93
+
88
94
  def extract_statement_type(sql)
89
95
  QUERY_NAME_RE.match(sql) { |match| match[1].downcase } unless sql.nil?
90
96
  rescue StandardError => e
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Mysql2
10
- VERSION = '0.8.0'
10
+ VERSION = '0.12.0'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-mysql2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-27 00:00:00.000000000 Z
11
+ date: 2020-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.8.0
19
+ version: 0.12.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.8.0
26
+ version: 0.12.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: appraisal
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -170,10 +170,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
170
170
  licenses:
171
171
  - Apache-2.0
172
172
  metadata:
173
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mysql2/v0.8.0/file.CHANGELOG.html
173
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mysql2/v0.12.0/file.CHANGELOG.html
174
174
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/instrumentation/mysql2
175
175
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
176
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mysql2/v0.8.0
176
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-mysql2/v0.12.0
177
177
  post_install_message:
178
178
  rdoc_options: []
179
179
  require_paths: