Skip to content

[tracing] Instrumenting events for errors in existing trace spans in Grid - #8531

Merged
AutomatedTester merged 4 commits into
SeleniumHQ:trunkfrom
pujagani:tracing_add_errorevents
Jul 16, 2020
Merged

[tracing] Instrumenting events for errors in existing trace spans in Grid#8531
AutomatedTester merged 4 commits into
SeleniumHQ:trunkfrom
pujagani:tracing_add_errorevents

Conversation

@pujagani

Copy link
Copy Markdown
Contributor

Description

The changes made are related to the issue #6703. The code changes add events to existing spans of the trace for error conditions.

Motivation and Context

Traces include spans, which can have timed events. These events act as logs. Having events in spans in case of error with detailed error message and useful attributes will help in debugging.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

span.setStatus(Status.UNKNOWN);
Map<String, EventAttributeValue> attributeValueMap = new HashMap<>();
attributeValueMap.put("Error Message", EventAttribute.setValue(e.getMessage()));
span.addEvent("Unknown error in LocalDistributor while creating session",attributeValueMap);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: make sure there are spaces after a ,

Suggested change
span.addEvent("Unknown error in LocalDistributor while creating session",attributeValueMap);
span.addEvent("Unknown error in LocalDistributor while creating session", attributeValueMap);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you David. I formatted the changes as needed. Sorry missed this out.

@pujagani
pujagani force-pushed the tracing_add_errorevents branch from 38ee653 to 8433841 Compare July 16, 2020 06:12
@AutomatedTester
AutomatedTester merged commit de6d288 into SeleniumHQ:trunk Jul 16, 2020
titusfortner pushed a commit to titusfortner/selenium that referenced this pull request Aug 13, 2020
…Grid (SeleniumHQ#8531)



Co-authored-by: David Burns <david.burns@theautomatedtester.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants