struct OpenTelemetry::InstrumentationDocumentation::CrystalHttpWebSocket

Overview

OpenTelemetry::Instrumentation::CrystalHttpWebSocket

Instruments

Reference: https://crystal-lang.org/api/1.4.0/HTTP/WebSocket.html

This instrumentation package instruments both client and server use of HTTP::WebSocket. As of 0.3.0 of of OpenTelemetry::Instrumentation, the package first monkey patches HTTP::WebSocket to rewrite it into a refactored version that reduces the cyclomatic complexity of the #run method while also making it easier to inject tracing. Those refactors are being presented back to the main Crystal project as a proposed PR, and if they are accepted, a large chunk of the code in this instrumentation package can be removed.

The remaining instrumentation wraps the client methods, #send, #ping, #pong, #stream, and #close, as well as the refactored handler methods that #run depends on, #handle_ping, #handle_pong, #handle_text, #handle_binary, #handle_close, and #handle_continuation.

Configuration

Version Restrictions

Methods Affected

Defined in:

opentelemetry/instrumentation/crystal/http_websocket.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

Instance Method Detail

def initialize #