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

Update http Response code attribute names #225

Closed
jodeev opened this issue Feb 24, 2021 · 4 comments
Closed

Update http Response code attribute names #225

jodeev opened this issue Feb 24, 2021 · 4 comments
Assignees
Labels
epic Large initiative or MMF (Minimum Marketable Feature)

Comments

@jodeev
Copy link
Contributor

jodeev commented Feb 24, 2021

Implement the last piece of AGENTS-201: Span Event Improvements.

Add the following Span attributes on external spans, with the http response code for each external call made:

  • http.statusCode

  • http.statusText

These attributes should be added when using any supported http client. These attributes should also be applied to the root span.

The above attributes will be replacing the following deprecated attributes:

  • http.responseCode

  • response.status

  • response.statusMessage


http.statusCode and http.statusText attribute names should also be added to transactions, and old attribute names deprecated.


Engineering notes:

  • Have to modify HttpParameters to accept a shim that might have status code.

  • Opportunistic: Redesign HttpParameters entirely; shim it in the API implementation so that the agent code only has to deal with one non-deprecated version.


Acceptance criteria


Notes

Release notes examples: https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes/php-agent-960255

Aha! Link: https://newrelic.aha.io/features/JAVA-260

@jodeev jodeev added the epic Large initiative or MMF (Minimum Marketable Feature) label Feb 24, 2021
@jodeev jodeev added this to the Span Attributes Improvements milestone Feb 24, 2021
@jodeev jodeev changed the title Finish Make Spans More Useful Update http Response code attribute names Mar 29, 2021
@jasonjkeller
Copy link
Contributor

jasonjkeller commented Apr 5, 2021

Spans

When a transaction ends it processes the transaction and notifies its listeners:

TransactionService.doProcessTransaction > listener.dispatcherTransactionFinished (where the listener is SpanEventsServiceImpl)

From there the SpanEventsServiceImpl processes each Tracer in the Transaction and creates a SpanEvent for each:

SpanEventsServiceImpl.storeSafely > createAndStoreSpanEvent > tracerToSpanEvent.createSpanEvent


Transactions

For transactions it looks like the response attributes are added in WebRequestDispatcher.transactionActivityWithResponseFinished.


Attributes

Attributes constants are defined in AttributeNames. It looks like we'll want to keep reporting the old ones along with adding the new ones for the time being.


Instrumentation

I also noticed that there are some instrumentation modules that are directly adding attributes as well that we'll need to update. For example the various grpc instrumentation modules add the now deprecated response.status attribute via the agent API, so we'll need to make sure to update those to add the new attributes as well:

        if (status != null) {
            NewRelic.addCustomParameter("response.status", status.getCode().value());
            if (GrpcConfig.errorsEnabled && status.getCause() != null) {
                // If an error occurred during the close of this server call we should record it
                NewRelic.noticeError(status.getCause());
            }
        }

@meiao meiao mentioned this issue Apr 9, 2021
@meiao meiao self-assigned this Apr 9, 2021
@jodeev
Copy link
Contributor Author

jodeev commented Apr 14, 2021

Comment added by Kevyn Ford in Aha! - View

Engineering work in progress. Team review of design approach held and agreement on path forward reached.

@jodeev
Copy link
Contributor Author

jodeev commented May 3, 2021

Comment added by Kevyn Ford in Aha! - View

Will be included in the upcoming 7.0.0 agent release.

@jodeev
Copy link
Contributor Author

jodeev commented May 6, 2021

Comment added by Kevyn Ford in Aha! - View

Issues found during integration testing. Need to re-open for additional engineering work.

Due to priority focus on Virtuoso, pushing this out to June.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Large initiative or MMF (Minimum Marketable Feature)
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants