Skip to content

Commit 8e8d339

Browse files
committed
lint
1 parent 1a07aa1 commit 8e8d339

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ This release includes the following features:
1313
* OTLP trace and metric exporter are the now default exporters for swo backend
1414
* NH-103815: Added resource detectors for Kubernetes and UAMS client
1515
* Added Lambda instrumentation for 6.1.2
16-
* Update tag_sql section by @cheempz in https://github.com/solarwinds/apm-ruby/pull/176
17-
* NH-103804: reverselab scan gem by @xuan-cao-swi in https://github.com/solarwinds/apm-ruby/pull/179
18-
* Bump DavidAnson/markdownlint-cli2-action from 19 to 20 by @dependabot in https://github.com/solarwinds/apm-ruby/pull/193
16+
* Update tag_sql section by @cheempz in <https://github.com/solarwinds/apm-ruby/pull/176>
17+
* NH-103804: reverselab scan gem by @xuan-cao-swi in <https://github.com/solarwinds/apm-ruby/pull/179>
18+
* Bump DavidAnson/markdownlint-cli2-action from 19 to 20 by @dependabot in <https://github.com/solarwinds/apm-ruby/pull/193>
1919

2020
## solarwinds_apm 6.1.2 (02/28/2025)
2121

CONFIGURATION.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ All SolarWinds APM-specific settings are prefixed with `SW_APM_`. Standard OpenT
7575
The SolarWinds backend uses the OTLP exporter by default. You can configure additional exporters for debugging or multi-backend scenarios:
7676

7777
**Console Exporter (for debugging):**
78+
7879
```bash
7980
export OTEL_TRACES_EXPORTER=console
8081
```
8182

8283
**Multiple Exporters:**
84+
8385
```bash
8486
export OTEL_TRACES_EXPORTER=otlp,console
8587
```
@@ -95,6 +97,7 @@ gem 'solarwinds_apm'
9597
```
9698

9799
Then configure:
100+
98101
```bash
99102
export OTEL_TRACES_EXPORTER=jaeger
100103
```
@@ -104,18 +107,21 @@ export OTEL_TRACES_EXPORTER=jaeger
104107
The service name is extracted from your service key by default, but can be overridden:
105108

106109
**Service key format:**
110+
107111
```bash
108112
export SW_APM_SERVICE_KEY=<api-token>:<service-name>
109113
```
110114

111115
**Override with OpenTelemetry variables:**
116+
112117
```bash
113118
# Service name will be 'production-api', not 'my-service'
114119
export SW_APM_SERVICE_KEY=<api-token>:my-service
115120
export OTEL_SERVICE_NAME=production-api
116121
```
117122

118123
**Resource attributes:**
124+
119125
```bash
120126
export OTEL_RESOURCE_ATTRIBUTES=service.name=production-api,service.version=1.2.3
121127
```
@@ -125,12 +131,14 @@ export OTEL_RESOURCE_ATTRIBUTES=service.name=production-api,service.version=1.2.
125131
Fine-tune individual instrumentation libraries using OpenTelemetry environment variables:
126132

127133
**Disable specific instrumentation:**
134+
128135
```bash
129136
export OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED=false
130137
export OTEL_RUBY_INSTRUMENTATION_REDIS_ENABLED=false
131138
```
132139

133140
**Configure instrumentation options:**
141+
134142
```bash
135143
# Include full SQL statements (disable obfuscation)
136144
export OTEL_RUBY_INSTRUMENTATION_MYSQL2_CONFIG_OPTS='db_statement=include;'
@@ -140,6 +148,7 @@ export OTEL_RUBY_INSTRUMENTATION_NET_HTTP_CONFIG_OPTS='untraced_hosts=localhost,
140148
```
141149

142150
Set inside file through ENV hash
151+
143152
```ruby
144153
# Set before requiring solarwinds_apm
145154
ENV['OTEL_RUBY_INSTRUMENTATION_SINATRA_ENABLED'] = 'false'
@@ -273,6 +282,7 @@ SolarWindsAPM::Config[:transaction_settings] = [
273282
Control which transactions are traced using pattern-based filtering. This is useful for excluding static assets, health checks, or other requests that don't need tracing.
274283

275284
**Configuration:**
285+
276286
```ruby
277287
SolarWindsAPM::Config[:transaction_settings] = [
278288
{
@@ -292,6 +302,7 @@ SolarWindsAPM::Config[:transaction_settings] = [
292302
```
293303

294304
**Pattern Matching:**
305+
295306
- Uses Ruby regular expressions
296307
- Matches against the transaction name
297308
- Supports regex options like `Regexp::IGNORECASE`
@@ -302,11 +313,13 @@ SolarWindsAPM::Config[:transaction_settings] = [
302313
Append trace context to database queries as SQL comments for correlation between traces and database logs.
303314

304315
**Enable SQL tagging:**
316+
305317
```bash
306318
export SW_APM_TAG_SQL=true
307319
```
308320

309321
**Example output:**
322+
310323
```sql
311324
-- Before (without tagging)
312325
SELECT * FROM users WHERE id = 1;
@@ -317,6 +330,7 @@ SELECT * FROM users WHERE id = 1;
317330
```
318331

319332
**Supported Operations:**
333+
320334
- **MySQL2**: `query` operations
321335
- **PostgreSQL**: `exec`, `query`, and similar operations
322336

@@ -351,6 +365,7 @@ Starting with version 7.0.0, the environment variable `SW_APM_PROXY` and configu
351365
For environments requiring HTTP proxies, configure using standard Ruby `Net::HTTP` proxy environment variables:
352366

353367
**Basic proxy:**
368+
354369
```bash
355370
# proxy server with no authentication
356371
http_proxy=http://<proxyHost>:<proxyPort> ruby my.app
@@ -385,7 +400,7 @@ Environment Variable | Config File Key | Description | Default
385400
`SW_APM_DEBUG_LEVEL` | `:debug_level` | Set the library's logging level, valid values are -1 through 6 (least to most verbose). <br> Setting -1 disables logging from the library. | 3
386401
`SW_APM_ENABLED` | N/A | Enable/disable the library, setting `false` is an alternative to uninstalling `solarwinds_apm` since it will prevent the library from loading. | `true`
387402
`SW_APM_SERVICE_KEY` | `:service_key` | API token and service name in the form of `token:service_name`, **required**. | None
388-
`SW_APM_TAG_SQL` | `:tag_sql` | Enable/disable injecting trace context into supported SQL statements. Set to boolean true or (or string `true` in env var) to enable, see [Tag Query with Trace Context](#tag-query-with-trace-context) for details.| `false`
403+
`SW_APM_TAG_SQL` | `:tag_sql` | Enable/disable injecting trace context into supported SQL statements. Set to boolean true or (or string `true` in env var) to enable, see [Tag Query with Trace Context](#sql-query-tagging) for details.| `false`
389404
`SW_APM_TRIGGER_TRACING_MODE` | `:trigger_tracing_mode` | Enable/disable trigger tracing for the service. Setting to `disabled` may impact DEM visibility into the service. | `enabled`
390405
`SW_APM_LAMBDA_PRELOAD_DEPS` | N/A | This option only takes effect in the AWS Lambda runtime. Set to `false` to disable the attempt to preload function dependencies and install instrumentations. | `true`
391406
`SW_APM_TRANSACTION_NAME` | N/A | Customize the transaction name for all traces, typically used to target specific instrumented lambda functions. _Precedence order_: custom SDK > `SW_APM_TRANSACTION_NAME` > automatic naming | None
@@ -411,6 +426,7 @@ N/A | `:transaction_settings` | Configure tracing mode per transaction, aka tran
411426
### Log Analysis
412427

413428
Enable debug logging and look for:
429+
414430
- Service key validation
415431
- Collector connection status
416432
- Instrumentation loading
@@ -423,4 +439,4 @@ export SW_APM_DEBUG_LEVEL=5
423439
export OTEL_LOG_LEVEL=debug
424440
```
425441

426-
For additional help, see the [SolarWinds documentation](https://documentation.solarwinds.com/en/success_center/observability/content/configure/services/ruby/install.htm) or contact support.
442+
For additional help, see the [SolarWinds documentation](https://documentation.solarwinds.com/en/success_center/observability/content/configure/services/ruby/install.htm) or contact support.

CONTRIBUTING.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,14 @@ The instructions below assume you are in the locally cloned project root directo
4545

4646
1. **Fork the repository** on GitHub
4747
2. **Clone your fork** locally:
48+
4849
```bash
4950
git clone https://github.com/YOUR_USERNAME/apm-ruby.git
5051
cd apm-ruby
5152
```
53+
5254
3. **Add the upstream remote**:
55+
5356
```bash
5457
git remote add upstream https://github.com/solarwinds/apm-ruby.git
5558
```
@@ -63,16 +66,19 @@ For development, you'll need a host environment capable of running Rake tasks to
6366
Choose the installation method that works best for your system:
6467

6568
**macOS (using Homebrew):**
69+
6670
```bash
6771
brew install rbenv ruby-build
6872
```
6973

7074
**Linux (Ubuntu/Debian):**
75+
7176
```bash
7277
sudo apt install rbenv
7378
```
7479

7580
**Build from source:**
81+
7682
```bash
7783
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
7884
echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc # for bash
@@ -152,6 +158,7 @@ bundle install
152158
#### Working in the Development Container
153159

154160
The development container provides a complete environment for:
161+
155162
- Building and testing the gem
156163
- Running linting tools
157164
- Debugging issues
@@ -179,6 +186,7 @@ SW_APM_SERVICE_KEY=<api-token:service-name> irb -r solarwinds_apm
179186
#### Making Changes
180187

181188
1. **Create a feature branch**:
189+
182190
```bash
183191
git checkout -b feature/your-feature-name
184192
```
@@ -198,18 +206,21 @@ SW_APM_SERVICE_KEY=<api-token:service-name> irb -r solarwinds_apm
198206
### Running Tests
199207

200208
**Full test suite:**
209+
201210
```bash
202211
APM_RUBY_TEST_KEY=your_service_key test/run_tests.sh
203212
```
204213

205214
**Single test file:**
215+
206216
```bash
207217
# Most tests require only the unit.gemfile dependencies
208218
bundle update
209219
bundle exec ruby -I test test/opentelemetry/solarwinds_propagator_test.rb
210220
```
211221

212222
**Single test case:**
223+
213224
```bash
214225
bundle exec ruby -I test test/opentelemetry/solarwinds_propagator_test.rb -n /trace_state_header/
215226
```
@@ -231,6 +242,7 @@ Test logs are written to the `log/` directory and are available on the host mach
231242
### Test Organization
232243

233244
Tests are organized in the `test/` directory:
245+
234246
- `test/api/` - API-related tests
235247
- `test/opentelemetry/` - OpenTelemetry integration tests
236248
- `test/patch/` - Instrumentation patch tests
@@ -254,7 +266,7 @@ This generates a `rubocop_result.txt` file. **All linting issues must be resolve
254266
- **Issues**: Check existing issues or create a new one
255267
- **Discussions**: Use GitHub Discussions for questions
256268
- **Documentation**: Refer to our [documentation website](https://documentation.solarwinds.com/en/success_center/observability/content/configure/services/ruby/install.htm)
257-
- **Email**: Contact technicalsupport@solarwinds.com for technical support
269+
- **Email**: Contact <technicalsupport@solarwinds.com> for technical support
258270

259271
## Additional Resources
260272

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
The `solarwinds_apm` gem starting from version 6.0.0 is an [OpenTelemetry Ruby](https://opentelemetry.io/docs/instrumentation/ruby/) distribution. It provides automatic instrumentation and custom SolarWinds Observability features for Ruby applications.
44

55
## Requirements
6+
>
67
> [!NOTE]
78
> Versions before 7.0.0 only support Linux and will go into no-op mode on other platforms.
89

0 commit comments

Comments
 (0)