Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jdelStrother opened this issue May 24, 2024 · 3 comments
Open

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

jdelStrother opened this issue May 24, 2024 · 3 comments
Labels
community To tag external issues and PRs submitted by the community feature request To tag feature request after Hero Triage for PM to disposition

Comments

@jdelStrother
Copy link
Contributor

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

@jdelStrother jdelStrother added the feature request To tag feature request after Hero Triage for PM to disposition label May 24, 2024
@workato-integration
Copy link

@github-actions github-actions bot added the community To tag external issues and PRs submitted by the community label May 24, 2024
@tannalynn
Copy link
Contributor

Thanks for submitting this feature request! It's an interesting idea that i don't think we've considered before. Metric normalization, like you had mentioned, happens after the data has already left the ruby agent, but currently, there is no built in way to accomplish this within the ruby agent itself. I'll bring it back to our team to discuss and prioritize.

In the mean time, after taking a quick look I think your idea for your workaround by changing ExternalRequestSegment#name is reasonable to try out, but I would also like to point out that there is another metric other than the segment name that gets created using the host, so unless you make updates there, you may run into the same MGI issue. Hopefully that helps!

@jdelStrother
Copy link
Contributor Author

I would also like to point out that there is another metric other than the segment name that gets created using the host

Good catch, thanks. I'll try overriding ExternalRequestSegment#host instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community To tag external issues and PRs submitted by the community feature request To tag feature request after Hero Triage for PM to disposition
Projects
Development

No branches or pull requests

2 participants