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

Updating ActivityProcessor #975

Merged
merged 19 commits into from Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/OpenTelemetry/CHANGELOG.md
Expand Up @@ -2,7 +2,11 @@

## Unreleased

* `ActivityProcessor` implements IDisposable
* `ActivityProcessor` implements IDisposable.
* When `Dispose` occurs, it calls `ShutdownAsync`.
Copy link
Member

Choose a reason for hiding this comment

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

Need to highlight that user should override their Dispose method, if they want to achieve custom behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just updated

* `BatchingActivityProcessor`/`SimpleActivityProcessor` is disposable and it
disposes the containing exporter.
* `BroadcastActivityProcessor`is disposable and it disposes the processors.

## 0.3.0-beta

Expand Down
Expand Up @@ -131,8 +131,8 @@ public async Task SuccessfulCommandTest(CommandType commandType, string commandT
int compositeState = successFlag | isSqlExceptionFlag | synchronousFlag;

fakeSqlEventSource.WriteEndExecuteEvent(objectId, compositeState, sqlExceptionNumber);

Assert.InRange(activityProcessor.Invocations.Count, 2, 3);
shutdownSignal.Dispose();
Assert.Equal(3, activityProcessor.Invocations.Count);

var activity = (Activity)activityProcessor.Invocations[1].Arguments[0];

Expand All @@ -153,7 +153,9 @@ public void EventSourceFakeUnknownEventWithNullPayloadTest()

fakeSqlEventSource.WriteUnknownEventWithNullPayload();

Assert.InRange(activityProcessor.Invocations.Count, 0, 1);
shutdownSignal.Dispose();

Assert.Single(activityProcessor.Invocations);
}

[Fact]
Expand Down