Time is not displayed correctly on the chart. what to do?

Hello!

Faced a problem, help me solve:

Connected logging modules in nginx:

nginx.conf

log_format newrelic '$remote_addr ’
'$time_local ’
'"$request" ’
'$status ’
'$body_bytes_sent ’
'"$http_referer" ’
'$upstream_bytes_received ’
'$upstream_bytes_sent ’
'$upstream_connect_time ’
'$upstream_header_time ’
'$upstream_response_length ’
'$upstream_response_time ’
'$upstream_status ’
'$request_time ’
'$request_method ’
'$bytes_sent ’
'$host ’
'$hostname ’
'"$http_user_agent" ';

access_log  /var/log/newrelic/newrelic.log  newrelic;

Added sending logs from container to newrelic

image

Created a rule for parsing the log by GROK in newrelic in the web interface itself

%{IPORHOST:remote_addr} %{HTTPDATE:time_local} %{QS:request} %{INT:status} %{NUMBER:body_bytes_sent} %{QS:http_referer} %{NUMBER:upstream_bytes_received} %{NUMBER:upstream_bytes_sent} %{SECOND:upstream_connect_time} %{SECOND:upstream_header_time} %{NUMBER:upstream_response_length} %{SECOND:upstream_response_time} %{NUMBER:upstream_status} %{SECOND:request_time} %{DATA:request_method} %{NUMBER:bytes_sent} %{DATA:host} %{DATA:hostname} %{QS:http_user_agent}

Received data output by columns in newrelic / logs

Now I want to display a parameter on Dashboards so that the upstream response time and upstream request time are displayed in the chart

I go to Dashboard \ add Add widget

Using a request, I build a graph:
upstream response time

SELECT average(upstream_response_time) from Log TIMESERIES

upstream request time

SELECT average(request_time) from Log TIMESERIES

As a result, we got graphs:

So, the problem is this:

Each page update Changes to the displayed graph. He’s always different

Below I have given the same graph after the f5 keys, as you can see it has changed dramatically.

Update p. F5 again

The graphs are different every time. Tell me, could this be a problem on your side? Or correct me if I am not building the schedule correctly.

Also, I would like to configure a notification that if the value is greater than N sec then send a notification to the mail, help me set up, please.

Please help.
The problem is still relevant.

@monitoring29 Sorry you have been waiting awhile for a response from our community. I’m going to bring this back to the attention of our support team. Thanks for your patience!

Neal Mc

Hello! Tell me, did you manage to solve the problem? since the graph still does not display the data correctly.

Hello! The problem is still relevant, the graph is not displayed correctly with each page update.

Hello! I need help. The problem is still relevant, the graph is not displayed correctly with each page update.

Hello @monitoring29!

This is an interesting case, but it’s something you will encounter with the latest( ) aggregator function (which, after looking at your dashboard, those charts appear to be using).

A query with TIMESERIES divides your query results into some number of buckets. When used in conjunction with latest( ), each datapoint represents the last reported value in each bucket.

Our database uses millisecond precision, so when a query looks at a relative time window, the start and end timestamps for each bucket will be different each time the query is executed. Subsequently, when dealing with a populous dataset, there will be some variance in the data points that are returned on every refresh.

To have data that looks more consistent on each refresh, you might be interested to use something like average( ) instead. However, it appears that your attribute values are non-numeric, and as such they will also need to be wrapped in the numeric( ) function like so:

SELECT average(numeric(upstream_response_time)) FROM Log TIMESERIES

Anyway, I hope that information helps to clarify some things.

1 Like