EnjoyTech / apollo-studio-tracing-ruby

A Ruby implementation of Apollo Studio tracing
MIT License
6 stars 1 forks source link

404 when trying to send traces to apollo server #27

Open talal7860 opened 1 year ago

talal7860 commented 1 year ago

Hi I've successfully enabled the gem, I'll probably add a PR to update the readme with small changes to make it easy to integrate, specially which environment variables to use. Secondly, when I try to send traces to the apollo studio, I see a 404. I know I'm doing everything right. Pasting the code snippet which I used to enable the plugin. in the context

apollo_tracing_enabled: true,
apollo_client_name: "test",
apollo_client_version: "1.0",

As part of the schema

use(ApolloStudioTracing, compress: true, debug_reports: true)

The environment variables I've set

ENGINE_API_KEY=service:****
ENGINE_SCHEMA_TAG=****@****

This is the response I get

[Apollo Studio Tracing] Failed to send trace report: Not Found (404) - 404: Not Found
talal7860 commented 1 year ago

An update on this, I tried create a very small server on node.js using the same keys, and the data is being sent without any errors. I think there something wrong with the report encoding part. I would highly appreciate if could get some help with this.

trevor-scheer commented 1 year ago

Hey @talal7860 - 404 (not found) indicates to me that it's (likely) not a malformed request. Are you sure your Ruby server and Node server have the same connectivity? Is your Ruby server sending any other requests that are successful?

Can you intercept the outgoing requests for both servers and compare them (with something like HTTP toolkit and share the results here?

trevor-scheer commented 1 year ago

Also which gem are you using? This fork appears to be unmaintained for multiple years now, whereas the original repo has seen updates in the last month. Does the issue belong over there / have you tried using the other gem?

https://github.com/Gusto/apollo-federation-ruby

talal7860 commented 1 year ago

@trevor-scheer you're right, I had no idea that the federation gem supported tracing, I'm going to try that but to give you an update on what was actually going wrong with this gem.

talal7860 commented 1 year ago

I don't think the federation gem was designed to send traces to apollo-studio, they have enabled it so that the graphql-gateway can read that and send traces. I don't think so there's anything built for ruby to send traces directly to the studio. I'll try to play around with this gem, as this is the closest I'm looking for. The proto.rb file used in the federation gem is exactly what's being used in this gem. So it was kind of an extension to send traces directly to apollo studio. Either ways, thanks for your help @trevor-scheer