Skip to content

Supported way of setting hosts on external-request segments? #2655

Open
@jdelStrother

Description

Is your feature request related to a problem? Please describe.

Our app fetches a lot of RSS feeds from a lot of different third-party hosts, which generates a lot of metric names like External/foo.com/Net::HTTP/GET, which can lead to MGI

Feature Description

I'd like a way of grouping those requests, while still allowing all our other HTTP requests (eg API calls to s3.amazonaws.com) to keep their own default grouping. Perhaps something like:

NewRelic::Agent.with_external_naming_override("rss-host") do
   URI.open("https://foo.com/a.rss")
   URI.open("https://bar.com/b.rss")
end

which would generate two segments, both with the grouped name External/rss-host/Net::HTTP/GET.

(I can definitely see why that exact API has issues, open to alternative suggestions)

Describe Alternatives

You could maybe do this with NewRelic's metric-normalization rules, but wanting to keep existing names for things like our API services makes it harder - we'd need to know in advance the hosts that we want to whitelist, and then use a REPLACE rule on all the remaining ones.

I'm considering monkey-patching ExternalRequestSegment#name so that it can be overridden by a thread-local variable.

Priority

Really Want

Metadata

Assignees

No one assigned

    Labels

    communityTo tag external issues and PRs submitted by the communityfeature requestTo tag feature request after Hero Triage for PM to dispositionneeds review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions