diff --git a/lib/degica_datadog/tracing.rb b/lib/degica_datadog/tracing.rb index bd2e9c1..88505d7 100644 --- a/lib/degica_datadog/tracing.rb +++ b/lib/degica_datadog/tracing.rb @@ -91,6 +91,10 @@ def init(rake_tasks: []) path_group = DegicaDatadog::Util.path_group(span.get_tag("http.url")) span.resource = "#{span.get_tag("http.method")} #{path_group}" end + end, + # Remove AWS metadata fetches + Datadog::Tracing::Pipeline::SpanFilter.new do |span| + %w[/metadata/instance/compute /latest/api/token].include?(span.get_tag("http.url")) end ) end