README.md in opentelemetry-instrumentation-http-0.22.0 vs README.md in opentelemetry-instrumentation-http-0.23.0
- old
+ new
@@ -28,9 +28,21 @@
OpenTelemetry::SDK.configure do |c|
c.use_all
end
```
+## Enriching http span names
+
+We surface a hook to easily rename your span.
+
+The lambda accepts as arguments (request_method, request_path) and returns a string that is set as the span name.
+
+```ruby
+OpenTelemetry::SDK.configure do |c|
+ c.use 'OpenTelemetry::Instrumentation::Rack', { span_name_formatter: ->(request_method, request_path) { "HTTP #{request_method} #{request_path}" }
+end
+```
+
## Examples
Example usage can be seen in the `./example/trace_demonstration.rb` file [here](https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/instrumentation/http/example/trace_demonstration.rb)
## How can I get involved?