newrelic / go-agent

New Relic Go Agent
Apache License 2.0
763 stars 297 forks source link

CLM user code location callback alternative to LocationOverride option #838

Closed nr-swilloughby closed 8 months ago

nr-swilloughby commented 8 months ago

Fixes Issue #640. Deprecates the CLM option to set LocationOverride, which forces the caller to do the work to determine the code location up-front even if CLM is disabled. Replaces this with a new function which registers a callback function, which the CLM code will call to get the function location from the user's code only if actually needed. The user's callback may use the existing caching code location functions to further optimize this.

codecov-commenter commented 8 months ago

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (e98ff73) 80.33% compared to head (932f589) 80.23%. Report is 4 commits behind head on develop.

Files Patch % Lines
v3/newrelic/code_level_metrics.go 37.50% 8 Missing and 2 partials :warning:
v3/newrelic/secure_agent.go 0.00% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #838 +/- ## =========================================== - Coverage 80.33% 80.23% -0.10% =========================================== Files 139 139 Lines 12603 12621 +18 =========================================== + Hits 10124 10127 +3 - Misses 2189 2202 +13 - Partials 290 292 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.