exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 19 question 3 discussion

Actual exam question from Microsoft's AZ-204
Question #: 3
Topic #: 19
[All AZ-204 Questions]

DRAG DROP -
You need to implement telemetry for non-user actions.
How should you complete the Filter class? To answer, drag the appropriate code segments to the correct locations. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Scenario: Exclude non-user actions from Application Insights telemetry.

Box 1: ITelemetryProcessor -
To create a filter, implement ITelemetryProcessor. This technique gives you more direct control over what is included or excluded from the telemetry stream.

Box 2: ITelemetryProcessor -

Box 3: ITelemetryProcessor -

Box 4: RequestTelemetry -

Box 5: /health -
To filter out an item, just terminate the chain.
Reference:
https://docs.microsoft.com/en-us/azure/azure-monitor/app/api-filtering-sampling

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Sukon_Desknot
Highly Voted 3 years, 8 months ago
(∩^o^)⊃━☆
upvoted 36 times
...
surmistry
Highly Voted 4 years ago
"ITelemetryProcessor" typo, no "n" https://docs.microsoft.com/en-us/azure/azure-monitor/app/api-filtering-sampling#create-a-telemetry-processor-c
upvoted 16 times
fr369
3 years, 3 months ago
Also the constructor is incorrect. Should be "public Filter(" instead of "public (Filter".
upvoted 12 times
Mev4953
3 years, 3 months ago
Yes, you are right. It should be; public Filter (ITelemetryProcessor next)
upvoted 5 times
...
...
...
Christian_garcia_martin
Most Recent 9 months ago
look at that s**t man , i've never seen a constructor like that.
upvoted 6 times
...
james2033
1 year, 1 month ago
1. public class Filter : ITelemetryProcessor 2. private readonly ITelemetryProcessor _next; 3. public (Filter ITelemetryProcessor next) 4. var x = item as RequestTelemetry 5. if(x?.Url.AbsolutePath == "/health") - https://learn.microsoft.com/en-us/azure/azure-monitor/app/api-filtering-sampling?tabs=javascriptwebsdkloaderscript#c - https://learn.microsoft.com/en-us/azure/azure-monitor/app/api-filtering-sampling?tabs=javascriptwebsdkloaderscript#create-a-telemetry-processor-c
upvoted 4 times
...
raymond_abcd
1 year, 2 months ago
The question is not inline with the requirement in the case study text. It should be "Exclude non-user actions from Application Insights telemetry." According to the requirement all health check requests, which is a RequestTelemetry type, for the api should be filtered out by setting the path to "/health" .
upvoted 2 times
...
coffecold
2 years, 6 months ago
The question is so wrong "You need to implement telemetry for non-user actions" that MUST be: "You need to implement telemetry to exclude non-user actions" (according to the requirements). In that case you have to exclude RequestTelemetry in combination with /health
upvoted 5 times
...
gmishra88
2 years, 6 months ago
This is chaining of ITelemetryProcessors where the Filter (the one created here) is the first one. The ITelemetryProcessor instance passed in the constructor is the next in the chain. The code checks if the url is /health and it does not do anything otherwise it fowards to the next (which is the one passed in the Constructor). Look at the line: "item as RequestTelemetry" : What kind of people work in Microsoft that will do the casting without checking the instance of the item? No wonder Microsoft things are so buggy
upvoted 3 times
coffecold
2 years, 6 months ago
"The as operator is used to perform conversion between compatible reference types or Nullable types. This operator returns the object when they are compatible with the given type and return null if the conversion is not possible instead of raising an exception" So the code is correct
upvoted 2 times
...
...
xRiot007
2 years, 10 months ago
In code, public Filter() not public (Filter ...)
upvoted 3 times
...
SivajiTheBoss
3 years, 1 month ago
Answer: ITelemetryProcessor, ITelemetryProcessor,ITelemetryProcessor,RequestTelemetry, /health Reference: https://docs.microsoft.com/en-us/azure/azure-monitor/app/api-filtering-sampling public class SuccessfulDependencyFilter : ITelemetryProcessor { private ITelemetryProcessor Next { get; set; } // next will point to the next TelemetryProcessor in the chain. public SuccessfulDependencyFilter(ITelemetryProcessor next) { this.Next = next; } } var requestTelemetry = telemetry as RequestTelemetry;
upvoted 12 times
...
Mev4953
3 years, 3 months ago
Yes, you are right. It should be; public Filter (ITelemetryProcessor next)
upvoted 1 times
...
Mev4953
3 years, 3 months ago
ITelemetryInitializer: Use telemetry initializers to define global properties that are sent with all telemetry; and to override selected behavior of the standard telemetry modules. For example, the Application Insights for Web package collects telemetry about HTTP requests. By default, it flags as failed any request with a response code >= 400. But if you want to treat 400 as a success, you can provide a telemetry initializer that sets the Success property. ITelemetryProcessor: This technique gives you more direct control over what is included or excluded from the telemetry stream. You can use it in conjunction with Sampling, or separately. To filter telemetry, you write a telemetry processor and register it with the SDK https://github.com/uglide/azure-content/blob/master/articles/application-insights/app-insights-api-filtering-sampling.md
upvoted 3 times
...
Saterial
4 years ago
Looks Good
upvoted 8 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago