tracelit 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58eb691b0dfacebc7072a0ee10ebc4fb88ddc5074c659211a689532bf2e86f3b
4
- data.tar.gz: 9a73dad4b506173c24f6e64a17c227812a0ab90651ef3a08e493ab9a68c602e1
3
+ metadata.gz: 5e3ee121cb2164e53dfa5ba358f760e84686bdbb26c94196ee26fac6ed40f9ca
4
+ data.tar.gz: 8eb2b4285c0b360098b412f22a9f629c064cc4b35aa83dff2e5ae095734b6e27
5
5
  SHA512:
6
- metadata.gz: 7ca34cc0206da44b31ceb865848ec08ef39f015764ae7f1f20dcf6d2b9af78820de537f6994ea48a224415350878ea9c206a54f21dd434cb37146451a04a06ba
7
- data.tar.gz: 999c495a4c363af34e4bdd1671d66611c42124040f2e20172040590dbb5e6a715f9123e4550a29c2378c77d5275cede91fdc8dd46ca1830c1eabfa2b6b92eac3
6
+ metadata.gz: 25ce2b06f568a1f4553269ffe52366e2b63aab998f03ab2fbb0f33de52a39901ad32268b99a1bd2e61b9cc9c2e81825e66771986741f9176e4a6e4c8890da848
7
+ data.tar.gz: 542aa2c3a219425fcfddaa44fada6e37610020a82819f0dfd14808a22fd8abadd0dfe0280cd3f5a7cfdaaaa2662a17658b0105f46baba80a2d9164506e084a12
data/README.md CHANGED
@@ -8,87 +8,7 @@ Official Ruby SDK for [Tracelit](https://tracelit.io) — drop-in OpenTelemetry
8
8
 
9
9
  ## Set up with AI
10
10
 
11
- Copy the prompt below and paste it into Cursor, Claude, ChatGPT, or any AI assistant. It contains everything the AI needs to fully integrate Tracelit into your app gem, initializer, manual spans, custom metrics, and test guard.
12
-
13
- ````
14
- You are integrating the Tracelit Ruby SDK into this codebase.
15
-
16
- ## What Tracelit does
17
- Tracelit is a drop-in OpenTelemetry SDK that sends traces, metrics, and logs
18
- to https://tracelit.io via OTLP/HTTP. It auto-instruments Rails, Sidekiq,
19
- ActiveRecord, Redis, Faraday, Net::HTTP, and more with zero code changes.
20
-
21
- ## Steps
22
-
23
- ### 1. Add the gem
24
- In Gemfile add:
25
- gem "tracelit"
26
- Then run: bundle install
27
-
28
- ### 2. Create the initializer
29
- Create config/initializers/tracelit.rb with this content
30
- (replace MY_SERVICE_NAME with the actual name of this service):
31
-
32
- Tracelit.configure do |config|
33
- config.api_key = ENV["TRACELIT_API_KEY"]
34
- config.service_name = "MY_SERVICE_NAME"
35
- config.environment = ENV.fetch("RAILS_ENV", "production")
36
- config.sample_rate = 1.0
37
- config.enabled = ENV["TRACELIT_ENABLED"] != "false"
38
- end
39
-
40
- For Sinatra/Rack apps also add Tracelit.start! after the configure block.
41
- For Rails, the Railtie calls start! automatically — no extra line needed.
42
-
43
- ### 3. Disable in tests
44
- In config/environments/test.rb (or .env.test) add:
45
- TRACELIT_ENABLED=false
46
-
47
- ### 4. Add manual spans (optional)
48
- Wrap any important operation with a custom span:
49
-
50
- Tracelit.tracer.in_span("describe_the_operation") do |span|
51
- span.set_attribute("relevant.attribute", value.to_s)
52
- do_the_work
53
- end
54
-
55
- ### 5. Add custom metrics (optional)
56
- Use counters, histograms, or gauges for business-level signals:
57
-
58
- # Counter — increment by 1 each time an event occurs
59
- counter = Tracelit.metrics.counter("my.event.count",
60
- description: "...", unit: "{events}")
61
- counter.add(1, attributes: { "key" => "value" })
62
-
63
- # Histogram — record a measured value (latency, size, etc.)
64
- histogram = Tracelit.metrics.histogram("my.operation.duration",
65
- description: "...", unit: "ms")
66
- histogram.record(elapsed_ms, attributes: { "key" => "value" })
67
-
68
- # Gauge — record a current level (queue depth, pool size, etc.)
69
- gauge = Tracelit.metrics.gauge("my.queue.depth",
70
- description: "...", unit: "{items}")
71
- gauge.record(current_depth, attributes: { "queue" => "default" })
72
-
73
- ## What you get automatically (no code required)
74
- - Traces for every HTTP request, SQL query, Redis call, Sidekiq job, etc.
75
- - Metrics: http.server.request.count/duration, http.server.error.count,
76
- db.query.duration, sidekiq.job.count/duration/error.count,
77
- db.connection_pool.size/busy/idle/waiting, process.memory.rss
78
- - Rails.logger lines forwarded to Tracelit logs, correlated to the active trace
79
- - Error spans always exported even when the trace is outside the sample ratio
80
-
81
- ## Configuration reference
82
- | Option | Env var | Default |
83
- |--------------------|--------------------------|--------------------------------|
84
- | api_key | TRACELIT_API_KEY | nil (required) |
85
- | service_name | TRACELIT_SERVICE_NAME | Rails app name (required) |
86
- | environment | TRACELIT_ENVIRONMENT | "production" |
87
- | endpoint | TRACELIT_ENDPOINT | https://ingest.tracelit.app |
88
- | sample_rate | TRACELIT_SAMPLE_RATE | 1.0 |
89
- | enabled | TRACELIT_ENABLED | true |
90
- | resource_attributes| — | {} (extra span/metric tags) |
91
- ````
11
+ Want an AI assistant (Cursor, Claude, ChatGPT, etc.) to integrate Tracelit into your app automatically? Copy the contents of [`llm_prompt.txt`](./llm_prompt.txt) and paste it as your prompt. It covers gem installation, initializer setup, manual spans, custom metrics, and test guard — everything the AI needs in one shot.
92
12
 
93
13
  ---
94
14
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tracelit
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/tracelit.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://tracelit.io"
15
15
  spec.license = "MIT"
16
16
 
17
- spec.required_ruby_version = ">= 3.0"
17
+ spec.required_ruby_version = ">= 3.3"
18
18
 
19
19
  spec.files = Dir[
20
20
  "lib/**/*.rb",
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracelit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tracelit
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2026-04-27 00:00:00.000000000 Z
@@ -131,7 +131,7 @@ homepage: https://tracelit.io
131
131
  licenses:
132
132
  - MIT
133
133
  metadata: {}
134
- post_install_message:
134
+ post_install_message:
135
135
  rdoc_options: []
136
136
  require_paths:
137
137
  - lib
@@ -139,15 +139,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
140
  - - ">="
141
141
  - !ruby/object:Gem::Version
142
- version: '3.0'
142
+ version: '3.3'
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
145
  - - ">="
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
- rubygems_version: 3.0.3.1
150
- signing_key:
149
+ rubygems_version: 3.5.22
150
+ signing_key:
151
151
  specification_version: 4
152
152
  summary: Official Ruby SDK for Tracelit backend observability
153
153
  test_files: []