From 3c7a75c7fc328842998aecf37c8fee961bb28096 Mon Sep 17 00:00:00 2001 From: Dimas Rullyandanu Date: Wed, 21 Aug 2024 09:00:28 +0900 Subject: [PATCH] filter out AWS metadata fetches trace (#9) --- lib/degica_datadog/tracing.rb | 4 ++++ 1 file changed, 4 insertions(+) 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