mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-03 00:01:21 -04:00
Update request_end instrumentation example (#1095)
* Update request_end instrumentation example in README.md
This commit is contained in:
parent
af6fb06cd6
commit
2dec63e6b0
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user