bugsnag_performance 0.3.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/CODEOWNERS +1 -0
- data/README.md +3 -3
- data/SECURITY.md +11 -0
- data/lib/bugsnag_performance/configuration.rb +26 -2
- data/lib/bugsnag_performance/internal/configuration_validator.rb +1 -0
- data/lib/bugsnag_performance/internal/delivery.rb +1 -2
- data/lib/bugsnag_performance/version.rb +1 -1
- data/lib/bugsnag_performance.rb +5 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16b53d0871422f913e95d93643d2d1aa0418b18d133ade895205d85eed381154
|
4
|
+
data.tar.gz: ef02ef87c516f7623bd37b789c8ce049f4694a62c2523d5c3e238bf1e2df48c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 908684dcbcd86f940020f3971a0b906bbf492a91a1d5aa8ad209d1a6eebed526da5020d320718956022fda346d972602d4db377afaa529ebb212ac8636dd75c7
|
7
|
+
data.tar.gz: d7f01073bd566171437084c5f0dd4b909ca6d9e9fb23bf6d13b12b1c07ac81edcd13c44d6ae23cd3f0805dad5163d2f21f7e98056762accc7ba3f3ee010df9e1
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,23 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
## 1.1.0 (2025-07-07)
|
5
|
+
|
6
|
+
### Enhancements
|
7
|
+
|
8
|
+
* Set default endpoints based on API key
|
9
|
+
[#51](https://github.com/bugsnag/bugsnag-ruby/pull/51)
|
10
|
+
|
11
|
+
## 1.0.0 (2024-12-09)
|
12
|
+
|
13
|
+
### Enhancements
|
14
|
+
|
15
|
+
* Consolidate Ruby/Ruby-Perf environment variables.
|
16
|
+
[#45](https://github.com/bugsnag/bugsnag-ruby-performance/pull/45)
|
17
|
+
|
18
|
+
* Restore Bugsnag-Sent-At header.
|
19
|
+
[#46](https://github.com/bugsnag/bugsnag-ruby-performance/pull/46)
|
20
|
+
|
4
21
|
## 0.3.0 (2024-11-13)
|
5
22
|
|
6
23
|
### Enhancements
|
data/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
lib/ @imjoehaines @DariaKunoichi
|
data/README.md
CHANGED
@@ -9,9 +9,9 @@
|
|
9
9
|
</div>
|
10
10
|
|
11
11
|
[](https://docs.bugsnag.com/performance/ruby/)
|
12
|
-
[](https://github.com/bugsnag/bugsnag-ruby-performance/actions/workflows/maze-runner.yml)
|
13
13
|
|
14
|
-
Convenience SDK for using the [Ruby
|
14
|
+
Convenience SDK for using the [Ruby OpenTelemetry SDK](https://github.com/open-telemetry/opentelemetry-ruby) with BugSnag.
|
15
15
|
|
16
16
|
## Features
|
17
17
|
|
@@ -30,4 +30,4 @@ For integration instructions, see our online docs: [docs.bugsnag.com/performance
|
|
30
30
|
|
31
31
|
## License
|
32
32
|
|
33
|
-
The BugSnag Ruby
|
33
|
+
The BugSnag Ruby Performance SDK is free software released under the MIT License. See [LICENSE.txt](LICENSE.txt) for details.
|
data/SECURITY.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Security Policy
|
2
|
+
|
3
|
+
## Supported Versions
|
4
|
+
|
5
|
+
| Version | Supported |
|
6
|
+
| ------- | ------------------ |
|
7
|
+
| 1.x | Yes |
|
8
|
+
|
9
|
+
## Reporting a Vulnerability
|
10
|
+
|
11
|
+
If you find a vulnerability in this SDK, please report it to our [Support team](mailto:support@bugsnag.com) for review.
|
@@ -49,8 +49,18 @@ module BugsnagPerformance
|
|
49
49
|
# @return [Array<String>, nil]
|
50
50
|
attr_accessor :enabled_release_stages
|
51
51
|
|
52
|
+
# The name of the service that is being traced
|
53
|
+
#
|
54
|
+
# If not set, this will default to the Open Telemetry SDK service name
|
55
|
+
# or the value set by the "OTEL_SERVICE_NAME" environment variable
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
attr_accessor :service_name
|
59
|
+
|
52
60
|
attr_writer :endpoint
|
53
61
|
|
62
|
+
HUB_PREFIX = "00000"
|
63
|
+
|
54
64
|
def initialize(errors_configuration)
|
55
65
|
@open_telemetry_configure_block = proc { |c| }
|
56
66
|
self.logger = errors_configuration.logger || OpenTelemetry.logger
|
@@ -59,6 +69,11 @@ module BugsnagPerformance
|
|
59
69
|
@app_version = fetch(errors_configuration, :app_version, env: "BUGSNAG_PERFORMANCE_APP_VERSION")
|
60
70
|
@release_stage = fetch(errors_configuration, :release_stage, env: "BUGSNAG_PERFORMANCE_RELEASE_STAGE", default: "production")
|
61
71
|
|
72
|
+
service_env = ENV["BUGSNAG_PERFORMANCE_SERVICE_NAME"]
|
73
|
+
@service_name = service_env unless service_env.nil?
|
74
|
+
endpoint_env = ENV["BUGSNAG_PERFORMANCE_ENDPOINT"]
|
75
|
+
@endpoint = endpoint_env unless endpoint_env.nil?
|
76
|
+
|
62
77
|
@enabled_release_stages = fetch(errors_configuration, :enabled_release_stages, env: "BUGSNAG_PERFORMANCE_ENABLED_RELEASE_STAGES")
|
63
78
|
|
64
79
|
# transform enabled release stages into an array if we read its value from
|
@@ -79,7 +94,7 @@ module BugsnagPerformance
|
|
79
94
|
|
80
95
|
# The URL to send traces to
|
81
96
|
#
|
82
|
-
# If not set this defaults to "https://<api_key>.otlp.bugsnag.com/v1/traces"
|
97
|
+
# If not set this defaults to "https://<api_key>.otlp.bugsnag.com/v1/traces" or "https://<api_key>.otlp.insighthub.smartbear.com/v1/traces", depending on the API key
|
83
98
|
#
|
84
99
|
# @return [String, nil]
|
85
100
|
def endpoint
|
@@ -91,7 +106,12 @@ module BugsnagPerformance
|
|
91
106
|
# if there's no API key then we can't construct the default URL
|
92
107
|
nil
|
93
108
|
else
|
94
|
-
|
109
|
+
instance = if hub_api_key?
|
110
|
+
"insighthub.smartbear.com"
|
111
|
+
else
|
112
|
+
"bugsnag.com"
|
113
|
+
end
|
114
|
+
"https://#{@api_key}.otlp.#{instance}/v1/traces"
|
95
115
|
end
|
96
116
|
end
|
97
117
|
|
@@ -121,5 +141,9 @@ module BugsnagPerformance
|
|
121
141
|
|
122
142
|
default
|
123
143
|
end
|
144
|
+
|
145
|
+
def hub_api_key?
|
146
|
+
@api_key.is_a?(String) && @api_key&.start_with?(HUB_PREFIX)
|
147
|
+
end
|
124
148
|
end
|
125
149
|
end
|
@@ -15,6 +15,7 @@ module BugsnagPerformance
|
|
15
15
|
validate_api_key
|
16
16
|
validate_string(:app_version, optional: true)
|
17
17
|
validate_string(:release_stage, optional: true)
|
18
|
+
validate_string(:service_name, optional: true)
|
18
19
|
validate_array(:enabled_release_stages, "non-empty strings", optional: true, &method(:valid_string?))
|
19
20
|
valid_endpoint = validate_endpoint
|
20
21
|
|
@@ -17,8 +17,7 @@ module BugsnagPerformance
|
|
17
17
|
def deliver(headers, body)
|
18
18
|
headers = headers.merge(
|
19
19
|
@common_headers,
|
20
|
-
|
21
|
-
# { "Bugsnag-Sent-At" => Time.now.utc.iso8601(3) },
|
20
|
+
{ "Bugsnag-Sent-At" => Time.now.utc.iso8601(3) },
|
22
21
|
)
|
23
22
|
|
24
23
|
raw_response = OpenTelemetry::Common::Utilities.untraced do
|
data/lib/bugsnag_performance.rb
CHANGED
@@ -83,6 +83,11 @@ module BugsnagPerformance
|
|
83
83
|
otel_configurator.service_version = app_version
|
84
84
|
end
|
85
85
|
|
86
|
+
# set the service name if explicitly set by the user
|
87
|
+
if configuration.service_name != nil && configuration.service_name != ""
|
88
|
+
otel_configurator.service_name = configuration.service_name
|
89
|
+
end
|
90
|
+
|
86
91
|
otel_configurator.resource = OpenTelemetry::SDK::Resources::Resource.create(
|
87
92
|
{
|
88
93
|
OpenTelemetry::SemanticConventions::Resource::DEPLOYMENT_ENVIRONMENT => configuration.release_stage,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugsnag_performance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BugSnag
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -89,9 +89,11 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- ".yardopts"
|
91
91
|
- CHANGELOG.md
|
92
|
+
- CODEOWNERS
|
92
93
|
- CONTRIBUTING.md
|
93
94
|
- LICENSE.txt
|
94
95
|
- README.md
|
96
|
+
- SECURITY.md
|
95
97
|
- TESTING.md
|
96
98
|
- bugsnag-performance.gemspec
|
97
99
|
- lib/bugsnag_performance.rb
|
@@ -120,7 +122,7 @@ metadata:
|
|
120
122
|
homepage_uri: https://www.bugsnag.com
|
121
123
|
source_code_uri: https://github.com/bugsnag/bugsnag-ruby-performance
|
122
124
|
bug_tracker_uri: https://github.com/bugsnag/bugsnag-ruby-performance/issues
|
123
|
-
changelog_uri: https://github.com/bugsnag/bugsnag-ruby-performance/blob/
|
125
|
+
changelog_uri: https://github.com/bugsnag/bugsnag-ruby-performance/blob/v1.1.0/CHANGELOG.md
|
124
126
|
documentation_uri: https://docs.bugsnag.com/performance/integration-guides/ruby/
|
125
127
|
rubygems_mfa_required: 'true'
|
126
128
|
post_install_message:
|