Verified Commit 6818bb30 authored by Hercules Merscher's avatar Hercules Merscher 🌴
Browse files

fix: README -- tracing check is not needed

parent 84c34aab
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -120,14 +120,6 @@ export GITLAB_TRACING="otlp://console?service_name=my-app&sampler=const&sampler_

## Usage

### Checking if Tracing is Enabled

```ruby
if Labkit::Tracing.enabled?
  # Tracing is configured
end
```

### Automatic Initialization (Default Behavior)

When `GITLAB_TRACING` is set, LabKit automatically creates and configures a tracer when the gem loads:
@@ -184,7 +176,6 @@ You can override auto-initialization by calling `Factory.create_tracer` in your

```ruby
# config/initializers/tracing.rb
if Labkit::Tracing.enabled?
# Override auto-initialization with custom configuration
Labkit::Tracing::Factory.create_tracer("my-custom-service", ENV["GITLAB_TRACING"]) do |c|
  # Selective instrumentation instead of c.use_all()
@@ -202,7 +193,6 @@ if Labkit::Tracing.enabled?
    )
  )
end
end
```

**When to use manual initialization:**
@@ -553,7 +543,6 @@ If you need to add custom metadata (deployment environment, version, etc.), over
# config/initializers/tracing.rb
require 'opentelemetry/instrumentation/all'

if Labkit::Tracing.enabled?
Labkit::Tracing::Factory.create_tracer("my-rails-app", ENV["GITLAB_TRACING"]) do |c|
  # Enable all available OpenTelemetry instrumentation
  c.use_all()
@@ -566,7 +555,6 @@ if Labkit::Tracing.enabled?
    )
  )
end
end

# .env.production
# GITLAB_TRACING="otlp://collector.example.com:4318?service_name=my-rails-app&sampler=probabilistic&sampler_param=0.01"
@@ -580,7 +568,6 @@ If you want to control exactly which components are instrumented instead of usin

```ruby
# config/initializers/tracing.rb
if Labkit::Tracing.enabled?
# Override auto-initialization for selective instrumentation
Labkit::Tracing::Factory.create_tracer("my-rails-app", ENV["GITLAB_TRACING"]) do |c|
  # Selective OpenTelemetry instrumentation (instead of c.use_all())
@@ -596,7 +583,6 @@ if Labkit::Tracing.enabled?
  Labkit::Tracing::ExternalHttp.instrument
  Labkit::Tracing::Redis.instrument
end
end
```

Note: Middleware is still automatically inserted - no need to configure it manually.