cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

Apache with Dynatrace Webserver Agent: how to measure response code?

dirk_meersseman
Contributor

Purepaths created by webserver agent on Apache show the web request details, like Client IP, Host and response status.

I'd like to put an incident when the response status has values like 503. Therefore I created a measure with the metric 'HTTP Response Status Code (Web Requests)'.

When configuring this measure in a chart with aggregation = maximum, the value 1.0 is being displayed.

What should I do here?

8 REPLIES 8

Radu
Dynatrace Pro
Dynatrace Pro

Hi Dirk,

Change the aggregation to count or sum, if you would like to see how many of those response codes you are getting within the time frame. In your case, min, max, avg will always be 1 since you will only get one response code for one web request, always.

Hope this helps.

Radu

dirk_meersseman
Contributor

Hi Radu,

Thanks for your help.

I've changed the aggregation to count. Indeed the number of web requests now appears.

I tried to get different counts by entering field 'Measure only these HTTP response status codes'. I tried different ways ( equals 404, equals '404' or starts 2). Comparison with numbers does not impact the count. Comparison with string reduces the count to 0.

Best regards
Dirk

Radu
Dynatrace Pro
Dynatrace Pro

Hi Dirk,

I've tried it with Contains and then the number 503 for example. I've also tried it with Starts and the digit 5 for example (to track all 5xx codes). And it seems to work. I'm getting the expected values:

Try creating separate measures rather than editing the same measure constantly.

Charting as "meter charts" might show the difference more clearly than a line chart.

Let me know if it works?

Radu
Dynatrace Pro
Dynatrace Pro

Also, here is my measure config:

I left the URI and Query open so that I get overall results. Also, when charting I'm not using any splittings just "draw only total" in order to get the total overall results. It helps differentiate between values that end up in the chart.

andreas_grabner
Dynatrace Guru
Dynatrace Guru

Why not create an Error Rule for HTTP 503? The error rule has multiple benefits. It will impact failure rate calculations on your Business Transactions. It also gives you a measure that you can chart - which will then show you how many Requests end up with HTTP 503

andi

dirk_meersseman
Contributor

Hello Radu,

I configured it this way. Unfortunately it does not work with the Apache setup over here.

Thank you for your help.
Best regards
Dirk

dirk_meersseman
Contributor

Hello Andi,

Creating an error rule for HTTP 503 works for this setup. It gives indeed a measure that can be charted and used to trigger an incident.

It impacts also the failure rate. I need to use error rules more often.

Thank you very much
Dirk

Yeah - error rules are a cool thing 🙂 Great to hear it works out for you.