{"id":15137097,"url":"https://github.com/kaylareopelle/otel_ruby_logs_demo","last_synced_at":"2025-10-23T12:30:22.248Z","repository":{"id":234584716,"uuid":"771309139","full_name":"kaylareopelle/otel_ruby_logs_demo","owner":"kaylareopelle","description":"Rails app with experimental OpenTelemetry Logs for Ruby","archived":false,"fork":false,"pushed_at":"2024-12-06T00:03:52.000Z","size":70,"stargazers_count":2,"open_issues_count":7,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-30T18:47:47.251Z","etag":null,"topics":["logs","opentelemetry","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaylareopelle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-13T03:59:10.000Z","updated_at":"2024-12-13T09:19:18.000Z","dependencies_parsed_at":"2024-04-19T23:26:15.420Z","dependency_job_id":"b97bde21-70e9-4f82-b2e3-d9b20a4d2a0b","html_url":"https://github.com/kaylareopelle/otel_ruby_logs_demo","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":"0.11764705882352944","last_synced_commit":"85547cd51aa37b39f00c3ac6d135cd688c84012d"},"previous_names":["kaylareopelle/otel_ruby_logs_demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaylareopelle%2Fotel_ruby_logs_demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaylareopelle%2Fotel_ruby_logs_demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaylareopelle%2Fotel_ruby_logs_demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaylareopelle%2Fotel_ruby_logs_demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaylareopelle","download_url":"https://codeload.github.com/kaylareopelle/otel_ruby_logs_demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237821787,"owners_count":19371827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logs","opentelemetry","rails","ruby"],"created_at":"2024-09-26T07:00:20.106Z","updated_at":"2025-10-23T12:30:21.733Z","avatar_url":"https://github.com/kaylareopelle.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Experimental! OpenTelemetry Logs for Ruby Demo\n\n\u003e [!IMPORTANT]\n\u003e **Update 2024-12-05:** Some of the gems referenced in this example are now available\n\u003e on RubyGems, so you no longer need to install them from source.\n\u003e * `opentelemetry-logs-sdk`\n\u003e * `opentelemetry-sdk` version 1.6+\n\u003e * `opentelemetry-exporter-otlp-logs`\n\u003e\n\u003e The gems with `api` in the name should be installed automatically where needed.\n\u003e The `opentelemetry-instrumentation-*` gems referenced in this example have not been released.\n\u003e The example Gemfile has been updated to reflect what's needed.\n\nThis is a minimal [Rails](https://rubyonrails.org/) 7.0 / [Ruby](https://github.com/ruby/ruby) 3.2 application demonstrating how to use an experimental implementation of [OpenTelemetry logs](https://opentelemetry.io/docs/specs/otel/logs/) for Ruby.\n\nPRs for the gems used in this example can be found at:\n* [kaylareopelle/opentelemetry-ruby](https://github.com/kaylareopelle/opentelemetry-ruby/pull/6)\n* [kaylareopelle/opentelemetry-ruby-contrib](https://github.com/kaylareopelle/opentelemetry-ruby-contrib/pull/1)\n\nThere are three key files in this repository:\n* [`Gemfile`](https://github.com/kaylareopelle/otel_ruby_logs_demo/blob/main/Gemfile): Includes the gems installed from the necessary git, branch, and blob sources\n* [`config/initializers/opentelemetry.rb`](https://github.com/kaylareopelle/otel_ruby_logs_demo/blob/main/config/initializers/opentelemetry.rb): Configures OpenTelemetry to use the experimental logs\n* [`app/controllers/test_controller.rb`](https://github.com/kaylareopelle/otel_ruby_logs_demo/blob/main/app/controllers/test_controller.rb): `TestController#index` demonstrates how to emit your own logs and how indpendent Ruby Loggers work with auto-instrumentation\n\nIf you'd like to see just the `Gemfile` and an example `opentelemetry.rb` initializer, [visit this gist](https://gist.github.com/kaylareopelle/76079747c1a7528449670b8bd1c78893).\n\n### Prerequisites:\n* Ruby 3.2\n\n### Setup:\n* Fork and clone the repo locally\n  * Fork the repository inside GitHub\n  * Run `git clone git@github.com:\u003cgh username\u003e/newrelic-ruby-agent.git` locally\n  * `cd` into your new repository\n* Run `bundle install` to install the gems for the application\n\n### Running the app:\n* Run: `bin/rails s`\n* Visit: [localhost:3000](localhost:3000)\n* See the OpenTelemetry logs in your console\n\nIf you'd like to see how logs would look with your observability vendor, update the `config/initializers/opentelemetry.rb` file to send the data to your vendor of choice.\n\n### Example OpenTelemetry log:\n```\n#\u003cstruct OpenTelemetry::SDK::Logs::LogRecordData\n timestamp=2024-04-19 15:06:50.118496 -0700,\n observed_timestamp=2024-04-19 15:06:50.118496 -0700,\n trace_id=\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\",\n span_id=\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\",\n trace_flags=#\u003cOpenTelemetry::Trace::TraceFlags:0x0000000106a73580 @flags=0\u003e,\n severity_text=\"INFO\",\n severity_number=9,\n body=\"Instrumentation: OpenTelemetry::Instrumentation::Logger was successfully installed with the following options {}\",\n resource=\n  #\u003cOpenTelemetry::SDK::Resources::Resource:0x0000000107b9c3c0\n   @attributes=\n    {\"service.name\"=\u003e\"Logs Demo - OTel Ruby Agent\",\n     \"process.pid\"=\u003e91454,\n     \"process.command\"=\u003e\"bin/rails\",\n     \"process.runtime.name\"=\u003e\"ruby\",\n     \"process.runtime.version\"=\u003e\"3.2.2\",\n     \"process.runtime.description\"=\u003e\"ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin22]\",\n     \"telemetry.sdk.name\"=\u003e\"opentelemetry\",\n     \"telemetry.sdk.language\"=\u003e\"ruby\",\n     \"telemetry.sdk.version\"=\u003e\"1.4.1\"}\u003e,\n instrumentation_scope=#\u003cstruct OpenTelemetry::SDK::InstrumentationScope name=\"opentelemetry-instrumentation-logger\", version=\"0.0.0\"\u003e,\n attributes=nil,\n total_recorded_attributes=0\u003e\n```\n\n### Contributions\n\nIf you have any problems with this example, please feel free to open a PR or an issue in this repository.\nPRs and comments are also welcome on the experimental PRs mentioned above.\n\nReviews are also welcome on the [PRs related to logs in the opentelemetry-ruby repository.](https://github.com/open-telemetry/opentelemetry-ruby/pulls?q=is%3Aopen+is%3Apr+logs) [Project status is available here.](https://github.com/open-telemetry/opentelemetry-ruby/projects/3)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaylareopelle%2Fotel_ruby_logs_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaylareopelle%2Fotel_ruby_logs_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaylareopelle%2Fotel_ruby_logs_demo/lists"}