Skip to content

Commit

Permalink
NH-66480: do not raise in instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
xuan-cao-swi committed Jan 18, 2024
1 parent 9315483 commit 678c795
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/solarwinds_apm/inst/graphql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ def graphql_multiplex(data)

def sanitize(query)
return unless query
raise ArgumentError, "Query is too long for sanitize." if query.length > MAX_QUERY_LENGTH

if query.length > MAX_QUERY_LENGTH
SolarWindsAPM.logger.warn '[solarwinds_apm/graphql] query is too long for sanitizing. Return empty query string.'
return ''
end
# remove arguments
query.gsub(/"[^"]*"/, '"?"') # strings
.gsub(/-?[0-9]*\.?[0-9]+e?[0-9]*/, '?') # ints + floats
Expand Down

0 comments on commit 678c795

Please sign in to comment.