Module: Restless

Defined in:
lib/restless.rb,
lib/restless/env.rb,
lib/restless/har.rb,
lib/restless/mask.rb,
lib/restless/rack.rb,
lib/restless/text.rb,
lib/restless/caches.rb,
lib/restless/client.rb,
lib/restless/redact.rb,
lib/restless/capture.rb,
lib/restless/version.rb,
lib/restless/settings.rb,
lib/restless/uploader.rb,
lib/restless/injection.rb,
lib/restless/request_id.rb,
lib/restless/conformance.rb,
lib/restless/fingerprint.rb,
lib/restless/stack_frames.rb

Overview

Capture your API traffic and send it to Restless.

This SDK implements version 1.0.0 of the Restless SDK Contract at level L2. See CONFORMANCE.md.

client = Restless.new(ENV["RESTLESS_KEY"])

client.setup do |request|
  {
    api_key: client.mask(request.header("Authorization")),
    owner: {
      id: workspace_id_for(request),
      enrich: ->(id) { { label: Workspace.find(id).name } },
    },
  }
end

use client.rack

Defined Under Namespace

Modules: Conformance, Env, Fingerprint, Har, Injection, Mask, Redact, RequestId, Settings, StackFrames, Text Classes: CaptureEngine, Client, EnrichCache, Middleware, RecoveryCache, Uploader

Constant Summary collapse

VERSION =

Identity of this SDK, and the contract version it implements.

META-001: the spec version an SDK implements must be recorded in a machine-readable form alongside its conformance level.

"0.1.0"
SDK_NAME =

WIRE-016: distinct per implementation, so the ingest can attribute a payload to a language.

"restless-sdk-ruby"
SPEC_VERSION =

The spec/CONTRACT.md version this SDK is verified against.

REDACT-010 requires full Unicode name folding to require full Unicode lowercase. Keep this in step with spec/VECTORS_VERSION.

"1.0.0"
CONFORMANCE_LEVEL =

CONTRACT.md 1.1: L1 is the pure functions, L2 adds batching, caches, injection and the safety guarantees.

"L2"

Class Method Summary collapse

Class Method Details

.mask(api_key) ⇒ Object

MASK-001, available without a client for scripts and tests.



49
50
51
# File 'lib/restless.rb', line 49

def mask(api_key)
  Mask.mask(api_key)
end

.new(api_key = nil, **options) ⇒ Object

Construct a client. See Restless::Client#initialize.



44
45
46
# File 'lib/restless.rb', line 44

def new(api_key = nil, **options)
  Client.new(api_key, **options)
end

.new_request_idObject



53
54
55
# File 'lib/restless.rb', line 53

def new_request_id
  RequestId.new_request_id
end