Instrumentation: adding tags to data tracing (#15517)

* Adding tags to data tracing

Prior to this commit, the feed's class was part of the resource.  That
resulted in a more opaque view of things.

With this change, we're adding tags to the view so we should have a
better sense of filtering.

* Bump for license/cla test
This commit is contained in:
Jeremy Friesen 2021-11-29 14:53:56 -05:00 committed by GitHub
parent 42e393af23
commit c3b2883aa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -43,8 +43,10 @@ module Stories
else
Articles::Feeds::LargeForemExperimental.new(user: current_user, page: @page, tag: params[:tag])
end
Datadog.tracer.trace("feed.query", span_type: "db",
resource: "#{self.class}.#{__method__}.#{feed.class.to_s.dasherize}") do
Datadog.tracer.trace("feed.query",
span_type: "db",
resource: "#{self.class}.#{__method__}",
tags: { feed_class: feed.class.to_s.dasherize }) do
# Hey, why the to_a you say? Because the
# LargeForemExperimental has already done this. But the
# weighted strategy has not. I also don't want to alter the
@ -65,8 +67,10 @@ module Stories
else
Articles::Feeds::LargeForemExperimental.new(user: current_user, page: @page, tag: params[:tag])
end
Datadog.tracer.trace("feed.query", span_type: "db",
resource: "#{self.class}.#{__method__}.#{feed.class.to_s.dasherize}") do
Datadog.tracer.trace("feed.query",
span_type: "db",
resource: "#{self.class}.#{__method__}",
tags: { feed_class: feed.class.to_s.dasherize }) do
# Hey, why the to_a you say? Because the
# LargeForemExperimental has already done this. But the
# weighted strategy has not. I also don't want to alter the

View file

@ -250,8 +250,10 @@ class StoriesController < ApplicationController
else
Articles::Feeds::LargeForemExperimental.new(page: @page, tag: params[:tag])
end
Datadog.tracer.trace("feed.query", span_type: "db",
resource: "#{self.class}.#{__method__}.#{feed.class.to_s.dasherize}") do
Datadog.tracer.trace("feed.query",
span_type: "db",
resource: "#{self.class}.#{__method__}",
tags: { feed_class: feed.class.to_s.dasherize }) do
# Hey, why the to_a you say? Because the
# LargeForemExperimental has already done this. But the
# weighted strategy has not. I also don't want to alter the