{"id":15514247,"url":"https://github.com/petems/faraday-trace-monkeypatch","last_synced_at":"2025-03-28T19:21:03.828Z","repository":{"id":137299606,"uuid":"438777298","full_name":"petems/faraday-trace-monkeypatch","owner":"petems","description":"An example of using a monkeypatch to add additional tags to the Faraday middleware for Datadog Ruby tracing","archived":false,"fork":false,"pushed_at":"2021-12-15T21:26:42.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T20:49:07.247Z","etag":null,"topics":["apm","datadog","datadog-agent","datadog-apm","ruby","tracing"],"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/petems.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":"2021-12-15T21:25:13.000Z","updated_at":"2021-12-15T21:27:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"70b8b94c-137f-4919-b317-1567efb1a0f8","html_url":"https://github.com/petems/faraday-trace-monkeypatch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Ffaraday-trace-monkeypatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Ffaraday-trace-monkeypatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Ffaraday-trace-monkeypatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Ffaraday-trace-monkeypatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petems","download_url":"https://codeload.github.com/petems/faraday-trace-monkeypatch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246085655,"owners_count":20721213,"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":["apm","datadog","datadog-agent","datadog-apm","ruby","tracing"],"created_at":"2024-10-02T09:58:14.735Z","updated_at":"2025-03-28T19:21:03.797Z","avatar_url":"https://github.com/petems.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# faraday-trace-monkeypatch\n\nAn example of using a monkeypatch to add additional tags to the Faraday middleware for Datadog Ruby tracing\n\n## How to use\n\n```\n$ bundle exec ruby main.rb\nI, [2021-12-15T20:20:52.953744 #42016]  INFO -- ddtrace: [ddtrace] DATADOG TRACER CONFIGURATION - {\"date\":\"2021-12-15T20:20:52+00:00\",\"os_name\":\"x86_64-apple-darwin19\",\"version\":\"0.54.1\",\"lang\":\"ruby\",\"lang_version\":\"2.7.3\",\"enabled\":true,\"service\":\"main\",\"agent_url\":\"http://127.0.0.1:8126?timeout=30\",\"debug\":false,\"analytics_enabled\":false,\"runtime_metrics_enabled\":false,\"integrations_loaded\":\"faraday@1.8.0\",\"vm\":\"ruby-2.7.3\",\"partial_flushing_enabled\":false,\"priority_sampling_enabled\":false,\"health_metrics_enabled\":false,\"integration_faraday_analytics_enabled\":\"false\",\"integration_faraday_analytics_sample_rate\":\"1.0\",\"integration_faraday_enabled\":\"true\",\"integration_faraday_service_name\":\"faraday\",\"integration_faraday_distributed_tracing\":\"true\",\"integration_faraday_error_handler\":\"#\u003cProc:0x00007f98be9c2710 /Users/peter.souter/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/ddtrace-0.54.1/lib/ddtrace/contrib/faraday/configuration/settings.rb:12 (lambda)\u003e\",\"integration_faraday_split_by_domain\":\"false\"}\n```\n\nYou'll need to have the Datadog agent running and listening on `8126`, otherwise you'll see something like this:\n\n```\nE, [2021-12-15T19:11:40.439570 #21103] ERROR -- ddtrace: [ddtrace] (/Users/peter.souter/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/ddtrace-0.54.1/lib/ddtrace/transport/http/client.rb:37:in `rescue in send_request') Internal error during HTTP transport request. Cause: Failed to open TCP connection to 127.0.0.1:8126 (Connection refused - connect(2) for \"127.0.0.1\" port 8126) Location: /Users/peter.souter/.rbenv/versions/2.7.3/lib/ruby/2.7.0/net/http.rb:960:in `initialize'\n```\n\nYou should then see two APM traces, one for get with a query string, the other for post with a body:\n\n## Post\n\n[![Post][1]][1]\n\n## Get\n\n[![Get][2]][2]\n\n  [1]: https://i.stack.imgur.com/7FI4r.png\n  [2]: https://i.stack.imgur.com/ZBy3l.png","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetems%2Ffaraday-trace-monkeypatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetems%2Ffaraday-trace-monkeypatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetems%2Ffaraday-trace-monkeypatch/lists"}