Comments (11)
Hey @layerssss, thanks for reporting this issue.
I see you spotted the difference in the Service:
name. Were you able to find data in DataDog under the new service name? (I'm not sure how that's surfaced inside DataDog, but I'm wondering whether there's really no data going to DataDog, or whether data is still going there, but it's in a new place.)
Judging by the diff in that PR, it looks like you could set the Service back to ruby-graphql
by passing it as an option, for example:
trace_with GraphQL::Tracing::DataDogTrace, service: "ruby-graphql"
What happens if you add that option to your setup?
from graphql-ruby.
Hi @rmosolgo I think you are right, the data is sent to DataDog under the new service name rails
. But it didn't get processed because I assume the records won't "fit" into the "rails" APM. Here is a screenshot inside the DataDog rails APM. There are no additional entries related to GraphQL. (without specifying service:
option)
Adding service: "ruby-graphql"
does workaround the issue though. (The ruby-graphql
APM did get populated)
from graphql-ruby.
cc @TonyCTHsu @vpellan is this intended behavior? Should the GraphQL-Ruby plugin still be providing ruby-graphql
as the default service name?
from graphql-ruby.
👋 @layerssss @rmosolgo Thanks for reporting.
service
is a field defined to be a entity that groups together endpoints, queries, or jobs for the purposes of building your application.
Generally speaking, it is your application.
Historically, it was abused for other reasons. Assigning it incorrectly would break other features such as Service Catalog.
GraphQL should be considered as internal to your application without explicitly defining it as a different service other than your application. The service for GraphQL spans will be labelled as your service definition from your configuration.
Datadog.configure do |c|
c.service = "..."
end
I would highly recommend to NOT provide the default service ruby-graphql
, because eventually this field will be deprecated from Datadog's API.
from graphql-ruby.
@TonyCTHsu Thanks for referring to the documentation. But if I remove the service:
option. I could no longer find any stats for each executed GraphQL query in the APM section in DataDog.
It's not inside the rails
service as my above screenshot. Where should I look for it?
from graphql-ruby.
@TonyCTHsu I've tried setting a default service
option for the whole application.
Now the whole configuration becomes:
Datadog.configure do |c|
c.service = "another-rails-app"
c.tracing.contrib.global_default_service_name.enabled = true
if ENV["DD_ENV"].present?
c.tracing.instrument :active_model_serializers
c.tracing.instrument :active_support
c.tracing.instrument :aws
c.tracing.instrument :excon
c.tracing.instrument :faraday
c.tracing.instrument :http
c.tracing.instrument :httpclient
c.tracing.instrument :rails
c.tracing.instrument :redis
c.tracing.instrument :sidekiq
c.profiling.enabled = true if Rails.env.production?
else
c.tracing.enabled = false
end
end
graphql/???_schema.rb
has
trace_with GraphQL::Tracing::DataDogTrace
(we have 2 schemas)
I've also removed require: "ddtrace/auto_instrument"
from Gemfile
just in case.
This does result all integrations ended up nicely under the new "service" (another-rails-app
). But GraphQL seems to be the only one missing here.
When I changed trace_with GraphQL::Tracing::DataDogTrace
to trace_with GraphQL::Tracing::DataDogTrace, service: "another-graphql-app"
, GraphQL stats appeared (under the new service name).
from graphql-ruby.
Hey @layerssss, is there any information in the execute.graphql
span that you cannot get from the rack.request
, scoped to your Rails controller that handles GraphQL requests in your application?
from graphql-ruby.
In execute.graphql
(when it works), each resource is the name of GraphQL query (passed by operation_name
from ruby-graphql). Showing me execution span for each different query corresponding to different React component it was triggered from.
In rack.request
each resource is the name of the controller. Showing span of each different controllers. All GraphQL requests are within one controller GraphqlController
. e.g. I won't be able to tell which React component is triggering a slow GraphQL query.
from graphql-ruby.
from graphql-ruby.
@layerssss, glad to hear that using service: ...
makes the data show up again.
@marcotc or @TonyCTHsu, can either of you provide a screenshot of how GraphQL data should look in the DataDog UI? I want to make sure our default plugin makes data appear somewhere, because as @layerssss mentioned, it contains information that other spans don't have.
from graphql-ruby.
I don't know what else needs to happen in GraphQL-Ruby here, so I'll close this out.
from graphql-ruby.
Related Issues (20)
- Schema parsing fails when a union has a leading pipe HOT 1
- graphql_name does not take effect HOT 2
- Rationale for the "defaultValueInvalidOnNonNullVariable" validation HOT 2
- the GraphQL::Schema::Field initialize , ` type` is nil after upgrading GraphQL to the latest version? HOT 5
- Parser does not allow operation names that match the built in operation types HOT 1
- Audit `compare_by_identity` usage
- Query complexity check causes wrong GraphQL error response HOT 8
- Error with undefined method `types' for nil:NilClass when running rspec HOT 6
- Version 1.9.18 is not working in Ruby 3.3.3 HOT 3
- NoMethodError - `context.types` not populated in 2.3.8 HOT 4
- C Parser incompatibility with AST nodes HOT 6
- Multiple tracers in one schema are ignored HOT 15
- Multiplexed mutations fail to share dataloader results and result in a "circular dependency" error HOT 4
- Adding a resolver to a new type causes `Can't determine the return type` error HOT 3
- Fiber dependency is making all requests fail on Rails 7.0 HOT 4
- Feature request to add a flag to identify if a list was scoped
- undefined method 'using_ast_analysis?' HOT 3
- Test helper run_graphql_field does not autoload arguments with graphql-batch HOT 4
- Load order for interfaces implementing interfaces HOT 6
- Using an orphaned "union type" doesn't properly restrict when loading HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-ruby.