diff --git a/.rubocop.yml b/.rubocop.yml index ec2771f52..c98f112b8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -45,9 +45,7 @@ Style/AccessModifierDeclarations: EnforcedStyle: inline Style/AsciiComments: - AllowedChars: - - ’ - - € + Enabled: false Style/FrozenStringLiteralComment: EnforcedStyle: always diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c13f8f959..fe802d3a4 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v184 \ No newline at end of file +v204 \ No newline at end of file diff --git a/README.md b/README.md index e32af3dd7..69dea24da 100644 --- a/README.md +++ b/README.md @@ -261,9 +261,13 @@ For example: ```ruby Stripe::Instrumentation.subscribe(:request_end) do |request_event| + # Filter out high-cardinality ids from `path` + path_parts = event.path.split("/").drop(2) + resource = path_parts.map { |part| part.match?(/\A[a-z_]+\z/) ? part : ":id" }.join("/") + tags = { method: request_event.method, - resource: request_event.path.split('/')[2], + resource: resource, code: request_event.http_status, retries: request_event.num_retries } diff --git a/test/test_helper.rb b/test/test_helper.rb index 4876b9fba..5e6141f9e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -3,7 +3,7 @@ # Report test coverage to coveralls for only one Ruby version to avoid # repeated builds. This also accounts for coveralls_reborn requiring # RUBY_VERSION >= 2.5. -if RUBY_VERSION.start_with?("3.1.") +if ENV.key?("COVERALLS_REPO_TOKEN") && RUBY_VERSION.start_with?("3.1.") require "coveralls" Coveralls.wear! end