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

Annotations are not displayed when time set to a full day/week/month... #680

Closed
primary1 opened this issue Feb 19, 2019 · 1 comment
Closed

Comments

@primary1
Copy link

Annotations are not displayed for last hour/day/week/month if "To" in range is set to a full hour/day/week/month.
Examples:
From: now/d To: now/d
From now-2d/d To: now-1d/d
From: now/h To: now/h
From: 2019-02-18 09:00:00 To: now/d

Looks like "to" value is converted incorrectly to the beginning of the hour/day/week/month instead of the end of it.

Example from http://play.grafana-zabbix.org with screenshot and network data:
image

From=1550476800000 (date: 2019-02-18 09:00:00)
To=now%2Fd (date: 2019-02-19 23:59:59, timestamp: 1550617199999)

Request headers:
GET http://play.grafana-zabbix.org/api/annotations?dashboardId=8&from=1550476800000&to=1550617199999 HTTP/1.1 Host: play.grafana-zabbix.org Proxy-Connection: keep-alive Accept: application/json, text/plain, */* X-Grafana-Org-Id: 2 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.96 Safari/537.36 Referer: http://play.grafana-zabbix.org/d/000000008/annotations?orgId=2&from=1550476800000&to=now%2Fd Accept-Encoding: gzip, deflate Accept-Language: pl,fr;q=0.9,en-US;q=0.8,en;q=0.7 Cookie: grafana_sess=dc517dc4c9a3e8b6

Request payload:
{"jsonrpc":"2.0","method":"event.get","params":{"output":"extend","time_from":1550476800,"time_till":1550530800,"objectids":["13675","13681","14098","14103","14108","13682"],"select_acknowledges":"extend","selectHosts":"extend","value":1},"id":1,"auth":"838267e1e0dd0a360fbb0a36df6e61b6"}

As you can see, "time_till":1550530800 (date: 2019-02-19 00:00:00) is incorrect. It should be 1550617199.

Tested on different Grafana and Zabbix plugin versions:

Grafana Zabbix Grafana-Zabbix Plugin
5.3.4 3.4.14 3.9.1
5.3.4 3.4.14 3.10.0
5.4.3 3.4.14 3.10.0
@alexanderzobnin
Copy link
Collaborator

Yes, confirmed. Looks like plugin calculates wrong time range for this kind of interval.

@alexanderzobnin alexanderzobnin added this to the 3.10.1 milestone Feb 20, 2019
@alexanderzobnin alexanderzobnin changed the title Annotations are not displayed when to time is set to a full hour/day/week/month... Annotations are not displayed when time set to a full day/week/month... Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants