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

Support multiple ignored prefixes for code-level metrics #551

Closed
rittneje opened this issue Aug 9, 2022 · 5 comments · Fixed by #556 or newrelic/docs-website#8901
Closed

Support multiple ignored prefixes for code-level metrics #551

rittneje opened this issue Aug 9, 2022 · 5 comments · Fixed by #556 or newrelic/docs-website#8901
Assignees

Comments

@rittneje
Copy link
Contributor

rittneje commented Aug 9, 2022

By default code-level metrics will ignore callers with a prefix of github.com/newrelic/go-agent. You can customize this via IgnoredPrefix in the Config struct, but since it is not a list you cannot have it ignore both prefixes.

Either IgnoredPrefix should be deprecated and replaced with a list property, or it should be defined as a comma-separated list of prefixes. newrelic.ConfigCodeLevelMetricsIgnoredPrefix will be similarly impacted.

@nr-swilloughby
Copy link
Contributor

Thanks for the feature enhancement suggestion. We'll look into that as soon as we can.

@nr-swilloughby
Copy link
Contributor

I think the best approach here would be to replace IgnoredPrefix with a list property and change ConfigCodeLevelMetricsIgnoredPrefix to take a list of strings, preserving its call semantics to be backward compatible (since it can still be called with a single string argument like before).

@nr-swilloughby
Copy link
Contributor

Oh, and this also similarly impacts the WithIgnoredPrefix option.

@nr-swilloughby nr-swilloughby self-assigned this Aug 16, 2022
@nr-swilloughby nr-swilloughby added this to Awaiting User Input in Go Engineering Board via automation Aug 16, 2022
@nr-swilloughby nr-swilloughby moved this from Awaiting User Input to In progress in Go Engineering Board Aug 16, 2022
@rittneje
Copy link
Contributor Author

@nr-swilloughby Since IgnoredPrefix is a public field of Config, you cannot replace it without breaking backwards compatibility. You would need two separate fields.

@nr-swilloughby
Copy link
Contributor

nr-swilloughby commented Aug 16, 2022

@rittneje Yes, that's what I did. IgnoredPrefix will be a deprecated field (but still used if set), and the new one is IgnoredPrefixes is a slice of strings. ConfigCodeLevelMetricsIgnoredPrefix and WithIgnoredPrefix can be changed to take a variadic list of strings and still preserve the previous calling syntax, which is backwards compatible unless for some reason someone defines an interface type around those functions, but with those specific functions that seems very unlikely to happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants