Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Ruby example #586

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ GEM

PLATFORMS
arm64-darwin-22
arm64-darwin-23
x86_64-darwin-22
x86_64-linux

Expand Down
43 changes: 43 additions & 0 deletions getting-started-guides/ruby/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Getting Started Guide - Ruby

This is a simple application instrumented with [OpenTelemetry Ruby](https://github.com/open-telemetry/opentelemetry-ruby).
It demonstrates how to configure OpenTelemetry Ruby to send data to New Relic.

## Requirements

* [Ruby 3.2.2](https://www.ruby-lang.org/en)
* [A New Relic account](https://one.newrelic.com/)
* [A New Relic license key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#license-key)

## Running the application

1. Set the following environment variables to configure OpenTelemetry to send
data to New Relic:

```shell
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.nr-data.net
export OTEL_EXPORTER_OTLP_HEADERS=api-key=<your_license_key>
export OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT=4095
export OTEL_SERVICE_NAME=getting-started-ruby
export OTEL_RESOURCE_ATTRIBUTES=service.instance.id=123
```

* If your account is based in the EU, set the endpoint to: [https://otlp.eu01.nr-data.net](https://otlp.eu01.nr-data.net)

2. Run the following command to install dependencies:

```shell
bundle install
```

3. Run the application with the following command and open
[http://localhost:8080/fibonacci?n=1](http://localhost:8080/fibonacci?n=1)
in your web browser to ensure it is working.

```shell
bundle exec rackup
```

4. Experiment with providing different values for `n` in the query string.
Valid values are between 1 and 90. Values outside this range cause an error
which will show up in New Relic.
42 changes: 0 additions & 42 deletions getting-started-guides/ruby/instrumented/README.md

This file was deleted.

14 changes: 0 additions & 14 deletions getting-started-guides/ruby/instrumented/call-app.ps1

This file was deleted.

21 changes: 0 additions & 21 deletions getting-started-guides/ruby/instrumented/call-app.sh

This file was deleted.

7 changes: 0 additions & 7 deletions getting-started-guides/ruby/instrumented/load-generator.ps1

This file was deleted.

10 changes: 0 additions & 10 deletions getting-started-guides/ruby/instrumented/load-generator.sh

This file was deleted.

8 changes: 0 additions & 8 deletions getting-started-guides/ruby/uninstrumented/Gemfile

This file was deleted.

35 changes: 0 additions & 35 deletions getting-started-guides/ruby/uninstrumented/Gemfile.lock

This file was deleted.

24 changes: 0 additions & 24 deletions getting-started-guides/ruby/uninstrumented/README.md

This file was deleted.

35 changes: 0 additions & 35 deletions getting-started-guides/ruby/uninstrumented/app.rb

This file was deleted.

14 changes: 0 additions & 14 deletions getting-started-guides/ruby/uninstrumented/call-app.ps1

This file was deleted.

21 changes: 0 additions & 21 deletions getting-started-guides/ruby/uninstrumented/call-app.sh

This file was deleted.

10 changes: 0 additions & 10 deletions getting-started-guides/ruby/uninstrumented/config.ru

This file was deleted.

21 changes: 0 additions & 21 deletions getting-started-guides/ruby/uninstrumented/fibonacci.rb

This file was deleted.

7 changes: 0 additions & 7 deletions getting-started-guides/ruby/uninstrumented/load-generator.ps1

This file was deleted.

10 changes: 0 additions & 10 deletions getting-started-guides/ruby/uninstrumented/load-generator.sh

This file was deleted.

Loading