Skip to content

Commit e183365

Browse files
committed
fix: linter
1 parent 8ac5863 commit e183365

File tree

13 files changed

+28
-26
lines changed

13 files changed

+28
-26
lines changed

example/logs/main.rb

100644100755
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# Add environment information
1818
c.resource = OpenTelemetry::SDK::Resources::Resource.create(
19-
'deployment.environment.name' => ENV.fetch('RACK_ENV', 'development'),
19+
'deployment.environment.name' => ENV.fetch('RACK_ENV', 'development')
2020
)
2121
end
2222

@@ -37,7 +37,7 @@
3737
'operation' => 'fetch_data',
3838
'plant_type' => 'cedar',
3939
'is_evergreen' => true
40-
},
40+
}
4141
)
4242

4343
# Emit a warning log with different attributes.
@@ -48,14 +48,14 @@
4848
body: 'Database connection is slow.',
4949
attributes: {
5050
'component' => 'database',
51-
'latency_ms' => 500,
52-
},
51+
'latency_ms' => 500
52+
}
5353
)
5454

5555
# Emit an error log.
5656
begin
57-
raise StandardError, "Failed to write to disk"
58-
rescue => e
57+
raise StandardError, 'Failed to write to disk'
58+
rescue StandardError => e
5959
logger.on_emit(
6060
timestamp: Time.now,
6161
severity_text: 'ERROR',
@@ -64,7 +64,7 @@
6464
attributes: {
6565
'exception.type' => e.class.name,
6666
'exception.message' => e.message,
67-
'exception.stacktrace' => e.backtrace.join("\n"),
68-
},
67+
'exception.stacktrace' => e.backtrace.join("\n")
68+
}
6969
)
7070
end

example/metrics/main.rb

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# Add environment information
1818
c.resource = OpenTelemetry::SDK::Resources::Resource.create(
19-
'deployment.environment.name' => ENV.fetch('RACK_ENV', 'development'),
19+
'deployment.environment.name' => ENV.fetch('RACK_ENV', 'development')
2020
)
2121
end
2222

example/otlp-logs/Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ source 'https://rubygems.org'
44

55
gem 'logger', '~> 1.7.0'
66

7-
gem 'opentelemetry-sdk', '~> 1.8.0'
87
gem 'opentelemetry-exporter-otlp', '~> 0.30.0'
8+
gem 'opentelemetry-sdk', '~> 1.8.0'
99

10-
gem 'opentelemetry-logs-sdk', '~> 0.2.0'
1110
gem 'opentelemetry-exporter-otlp-logs', '~> 0.2.0'
11+
gem 'opentelemetry-logs-sdk', '~> 0.2.0'

example/otlp-logs/main.rb

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
require 'opentelemetry/exporter/otlp_logs'
1111

1212
# Ensure DSN is set
13-
dsn = ENV['UPTRACE_DSN']
13+
dsn = ENV.fetch('UPTRACE_DSN', nil)
1414
abort('Missing UPTRACE_DSN environment variable') unless dsn
1515

1616
# Configure OpenTelemetry (for traces, metrics, and logs if desired)
@@ -21,7 +21,7 @@
2121
endpoint: 'https://api.uptrace.dev/v1/logs',
2222
headers: { 'uptrace-dsn': dsn }, # Uptrace auth
2323
compression: 'gzip', # Reduce bandwidth
24-
timeout: 10 # Seconds
24+
timeout: 10 # Seconds
2525
)
2626

2727
# Attach batch processor (buffers + exports logs)

example/otlp-metrics/Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ source 'https://rubygems.org'
44

55
gem 'logger', '~> 1.7.0'
66

7-
gem 'opentelemetry-sdk', '~> 1.8.0'
87
gem 'opentelemetry-exporter-otlp', '~> 0.30.0'
8+
gem 'opentelemetry-sdk', '~> 1.8.0'
99

10-
gem 'opentelemetry-metrics-sdk', '~> 0.7.3'
11-
gem 'opentelemetry-metrics-api', '~> 0.3.0'
1210
gem 'opentelemetry-exporter-otlp-metrics', '~> 0.5.0'
11+
gem 'opentelemetry-metrics-api', '~> 0.3.0'
12+
gem 'opentelemetry-metrics-sdk', '~> 0.7.3'

example/otlp-metrics/main.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
require 'opentelemetry-exporter-otlp-metrics'
1212

1313
# Fetch Uptrace DSN from environment (required)
14-
dsn = ENV['UPTRACE_DSN']
14+
dsn = ENV.fetch('UPTRACE_DSN', nil)
1515
abort('Missing UPTRACE_DSN environment variable') unless dsn
1616

1717
puts "Using Uptrace DSN: #{dsn}"

example/otlp-traces/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ source 'https://rubygems.org'
44

55
gem 'logger', '~> 1.7.0'
66

7-
gem 'opentelemetry-sdk', '~> 1.8.0'
87
gem 'opentelemetry-exporter-otlp', '~> 0.30.0'
98
gem 'opentelemetry-propagator-xray', '~> 0.24.0'
9+
gem 'opentelemetry-sdk', '~> 1.8.0'

example/otlp-traces/main.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
require 'opentelemetry/instrumentation/all'
1212

1313
# Fetch Uptrace DSN from environment (required)
14-
dsn = ENV['UPTRACE_DSN']
14+
dsn = ENV.fetch('UPTRACE_DSN', nil)
1515
abort('Missing UPTRACE_DSN environment variable') unless dsn
1616

1717
puts "Using Uptrace DSN: #{dsn}"

example/rails/Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source 'https://rubygems.org'
44

5-
gem 'rails', '~> 8.0.2'
6-
gem 'puma', '~> 6.4'
75
gem 'opentelemetry-instrumentation-rails', '~> 0.36.0'
6+
gem 'puma', '~> 6.4'
7+
gem 'rails', '~> 8.0.2'
88
gem 'uptrace', path: '../..'

example/rails/config.ru

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Uptrace.configure_opentelemetry(dsn: '') do |c|
1919
c.service_version = '1.0.0'
2020
end
2121

22+
# TraceRequestApp is a minimal Rails application
2223
class TraceRequestApp < Rails::Application
2324
config.root = __dir__
2425
config.secret_key_base = 'secret_key_base'
@@ -31,6 +32,7 @@ class TraceRequestApp < Rails::Application
3132
config.paths['config/routes.rb'] = []
3233
end
3334

35+
# ExampleController
3436
class ExampleController < ActionController::Base
3537
include Rails.application.routes.url_helpers
3638

0 commit comments

Comments
 (0)