Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Do not set sampledOut flag if activity is recorded and parentId fixes #971

Merged
merged 2 commits into from
Sep 9, 2019

Conversation

lmolkova
Copy link
Member

@lmolkova lmolkova commented Sep 6, 2019

If Activity is recorded, we are going to sample in proactively (i.e. give more weight for these items, see microsoft/ApplicationInsights-dotnet#1200)

When we proactively sample features out, we should check Activity.Recorded first and only sample out those which are not recorded.

Also, I noticed parent -id on requests is not set correctly in W3C format. fixing that.

config.SetLastObservedSamplingPercentage(SamplingTelemetryItemTypes.Request, 0);

HttpContext context = CreateContext(HttpRequestScheme, HttpRequestHost, "/Test", method: "POST");
var traceParent = "00-4e3083444c10254ba40513c7316332eb-e2a5f830c0ee2c46-01";
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps a test with -00 for Recorded flag?

Copy link
Member Author

Choose a reason for hiding this comment

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

this one tests -01 request with sampled out flag set to 100% of items, so this is intentionally -01

@lmolkova lmolkova merged commit 59efae2 into develop Sep 9, 2019
@lmolkova lmolkova deleted the lmolkova/samplingFlagAndFixes branch October 4, 2019 22:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants