hephaestus 0.8.7.5 → 0.8.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c17f79baf188c20673d1d1c59299f22b36a4378d42546cda2d8b4aeddcb9e5c7
4
- data.tar.gz: bfd2576c4e5652ee59215ba39d2e5f0afb80134e94502b5b3669dfd3f4baf903
3
+ metadata.gz: d2ce525aec1a0e799119c58576c0620f33b61d6c4ec2e3eb720fb731fffe9f25
4
+ data.tar.gz: 73b98f732bce7334868f7f7e2cdccc67ee84df2ffd58a34140504414846b2240
5
5
  SHA512:
6
- metadata.gz: b3d0d5d1ddb364b1fbf4fffa76cd43e8a5eb51586512b9d27edd883107fcf3a056cd248185955b1dd1ea6e8cd90dd9a2c777fd25d6ed62c85c75e9d03ea55837
7
- data.tar.gz: 7f54fec794443f83bda7367a31296edcb519a0c32a54fa0a6bee250ef764db587edfb2c481d98612272827d21c1a14bdae05c1d049d8cff1588f84f89e0b5b70
6
+ metadata.gz: '0874dddeb9a33837aede0dbf639ebfe7c94bc58daa24c1b16207ab6705e1f56d029c8230a8eec02f21c9a78217fcd60e12f2f534876de2a081b28e0b868e6bf8'
7
+ data.tar.gz: 5eac3b041ec6ea3ac7f2263c764b279f9aa7998e662e3f437084a383e801e812592c67561526f3afcfc8da9131feea6a1e77300ac4472bc255def552fa6e69fe
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [v0.8.9] - 10-12-2024
2
+ ## What's Changed
3
+ * Point OpenTelemetry to internal service by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/86
4
+
5
+
6
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.8...v0.8.9
7
+ # [v0.8.8] - 09-12-2024
8
+ ## What's Changed
9
+ * Filter parameter logging in jobs by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/84
10
+
11
+
12
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.7.5...v0.8.8
1
13
  # [v0.8.7.5] - 05-12-2024
2
14
  **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.7.4...v0.8.7.5
3
15
  # [v0.8.7.4] - 05-12-2024
@@ -106,6 +106,8 @@ module Hephaestus
106
106
  ["Common"].each do |section_label|
107
107
  res["fields"].select { |f| f["section"] && f["section"]["label"] }.each do |field|
108
108
  next unless field["section"]["label"] == section_label
109
+ # exclude DATABASE_URL because it's been retrieved already in the plug boot up
110
+ next if field["label"].include?("DATABASE_URL")
109
111
 
110
112
  load_infra_secret(field)
111
113
  end
@@ -0,0 +1,22 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ # ActiveJob logs the arguments passed to the job. This initializer filters out sensitive information from the logs.
5
+ # cf. https://github.com/rails/rails/pull/34438#issuecomment-2336749226
6
+ Rails.application.config.after_initialize do
7
+ require "active_job/log_subscriber"
8
+ module ActiveJob
9
+ class LogSubscriber < ActiveSupport::LogSubscriber
10
+ alias_method :original_format, :format
11
+
12
+ private def format(arg)
13
+ if arg.is_a?(Hash)
14
+ parameter_filter = ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)
15
+ parameter_filter.filter(arg.transform_values { |value| original_format(value) })
16
+ else
17
+ original_format(arg)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,41 +1,53 @@
1
1
  # typed: false
2
2
  # frozen_string_literal: true
3
3
 
4
- unless Rails.env.development?
5
- # establish the environment for OTEL
6
- ENV["OTEL_EXPORTER_OTLP_ENDPOINT"] = "https://api.honeycomb.io"
4
+ # development is intentionally disabled
5
+ return if Rails.env.development?
6
+ return if defined?(Rails::Console)
7
7
 
8
- ENV["OTEL_EXPORTER_OTLP_HEADERS"] = fetch_infra_secret(
9
- label: "OTEL_EXPORTER_OTLP_HEADERS",
10
- default: "x-honeycomb-team=your-api-key",
11
- )
8
+ # establish the environment for OTEL
9
+ ENV["OTEL_EXPORTER_OTLP_ENDPOINT"] = "http://service-otelcol-#{Rails.env}.internal:4318"
10
+ ENV["OTEL_SERVICE_NAME"] = "plug-#{plug_shortname}-#{Rails.env}"
12
11
 
13
- ENV["OTEL_SERVICE_NAME"] = "plug-#{plug_shortname}-#{Rails.env}"
12
+ require "opentelemetry/sdk"
13
+ require "opentelemetry/instrumentation/all"
14
+ require "opentelemetry/exporter/otlp"
15
+ require "opentelemetry/semantic_conventions"
14
16
 
15
- require "opentelemetry/sdk"
16
- require "opentelemetry/exporter/otlp"
17
- require "opentelemetry/semantic_conventions"
17
+ OpenTelemetry::SDK.configure do |c|
18
+ c.logger = Rails.logger
18
19
 
19
- OpenTelemetry::SDK.configure do |c|
20
- c.logger = Rails.logger
20
+ ##### Instruments
21
+ c.use("OpenTelemetry::Instrumentation::Rack", { use_rack_events: false })
22
+ c.use("OpenTelemetry::Instrumentation::ActionPack")
23
+ c.use("OpenTelemetry::Instrumentation::ActionView")
24
+ c.use("OpenTelemetry::Instrumentation::ActiveJob")
25
+ c.use("OpenTelemetry::Instrumentation::ActiveRecord")
26
+ c.use("OpenTelemetry::Instrumentation::AwsSdk")
27
+ c.use("OpenTelemetry::Instrumentation::ConcurrentRuby")
28
+ c.use("OpenTelemetry::Instrumentation::Faraday")
29
+ c.use("OpenTelemetry::Instrumentation::HttpClient")
30
+ c.use("OpenTelemetry::Instrumentation::Net::HTTP")
31
+ c.use("OpenTelemetry::Instrumentation::PG", {
32
+ # By default, this instrumentation includes the executed SQL as the `db.statement`
33
+ # semantic attribute. Optionally, you may disable the inclusion of this attribute entirely by
34
+ # setting this option to :omit or sanitize the attribute by setting to :obfuscate
35
+ db_statement: :obfuscate,
36
+ })
37
+ c.use("OpenTelemetry::Instrumentation::Rails")
38
+ c.use("OpenTelemetry::Instrumentation::RestClient")
21
39
 
22
- c.use_all(
23
- "OpenTelemetry::Instrumentation::PG" => { db_statement: :obfuscate },
24
- "OpenTelemetry::Instrumentation::Rack" => { use_rack_events: false },
40
+ if !productionish?
41
+ c.add_span_processor(
42
+ OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(
43
+ OpenTelemetry::Exporter::OTLP::Exporter.new,
44
+ ),
45
+ )
46
+ else # useful for testing instrumentation
47
+ c.add_span_processor(
48
+ OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(
49
+ OpenTelemetry::SDK::Trace::Export::SpanExporter.new,
50
+ ),
25
51
  )
26
-
27
- if productionish?
28
- c.add_span_processor(
29
- OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(
30
- OpenTelemetry::Exporter::OTLP::Exporter.new,
31
- ),
32
- )
33
- else # useful for testing instrumentation
34
- c.add_span_processor(
35
- OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(
36
- OpenTelemetry::SDK::Trace::Export::SpanExporter.new,
37
- ),
38
- )
39
- end # development is intentionally disabled
40
52
  end
41
53
  end
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Hephaestus
5
- VERSION = "0.8.7.5"
5
+ VERSION = "0.8.9"
6
6
  RAILS_VERSION = ">= 8.0"
7
7
  RUBY_VERSION = File
8
8
  .read("#{File.dirname(__FILE__)}/../../.ruby-version")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hephaestus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7.5
4
+ version: 0.8.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-05 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootsnap
@@ -436,6 +436,7 @@ files:
436
436
  - config/initializers/application.rb
437
437
  - config/initializers/cors.rb
438
438
  - config/initializers/environment.rb
439
+ - config/initializers/filter_job_params.rb
439
440
  - config/initializers/filter_parameter_logging.rb
440
441
  - config/initializers/inflections.rb
441
442
  - config/initializers/lograge.rb