Skip to main content
Interania

Change the query time zone

0votes
7updates
217views

If you are running your own Interana cluster, you can use the admin command-line interface to update the query time zone to account for daylight savings time. You must do this twice a year.

The default query time zone is Pacific Standard Time (PST), but this can be configured to any time zone that you want to use. The examples in this howto use PST, Pacific Daylight Time (PDT), and Eastern Standard Time (EST).

Change time zone settings on the Interana config node

Log in to your Interana config node and use the following config.py commands to change the time zone offset and the labels displayed in the query information. 

All values are surrounded by single and double quotes. 

Command Parameters Description
datasettimezone.string -v '"hours_offset_string"'

The number of hours offset from the UTC time zone. Specified as 4 digits, and either + or -. This is displayed in the Interana interface.

For example, '"-0800"' to specify 8 hours earlier than UTC.

datasettimezone.offset -v '"offset_minutes"' The number of hours, in minutes, offset from the UTC time zone.
datasettimezone.label -v '"time zone_code"' The 3-letter code for the time zone. This is displayed in the Interana interface.

tip_icon.png You can use the SHOW_SETTING command to confirm the time zone offset values.


To change the query time zone to PST:

$ /opt/interana/backend/common/py/config.py SHOW_SETTING
$ /opt/interana/backend/common/py/config.py -a webapp -k datasettimezone.string -v '"-0800"' ADD_SETTING
$ /opt/interana/backend/common/py/config.py -a webapp -k datasettimezone.offset -v '"480"' ADD_SETTING
$ /opt/interana/backend/common/py/config.py -a webapp -k datasettimezone.label -v '"PST"' ADD_SETTING
$ /opt/interana/backend/common/py/config.py SHOW_SETTING

To change the query time zone to EST:

$ /opt/interana/backend/common/py/config.py SHOW_SETTING
$ /opt/interana/backend/common/py/config.py -a webapp -k datasettimezone.string -v '"-0500"' ADD_SETTING
$ /opt/interana/backend/common/py/config.py -a webapp -k datasettimezone.offset -v '"300"' ADD_SETTING
$ /opt/interana/backend/common/py/config.py -a webapp -k datasettimezone.label -v '"EST"' ADD_SETTING
$ /opt/interana/backend/common/py/config.py SHOW_SETTING

Restart the query API server to apply your changes

To apply the changes that you made, log in to your Interana server and use the following commands to stop and then restart the Interana query API server:

$ /opt/interana/backend/scripts/mon_me.sh stop query-api-server

$ /opt/interana/backend/scripts/mon_me.sh start query-api-server

Get the time zone offset value from a dashboard query

  1. Log in to your Interana application and view a dashboard.
  2. Click Explore on any chart in the dashboard.
  3. When Interana loads the Explorer window, search the URL for the time_zone_offset parameter. 
  4. Copy the parameter's value. You will use this as the from_offset value for the next step (Change the time zone offset for dashboard charts). 

For example, in the following query URL:

https://company.interana.com/?client_qid=8827164629413&compare={%22time%22:%221%20week%20before%22}&is_dashboard=true&title=%23%20of%20POCs&is_auto_reload=false&time_labels={%22start%22:%227%20days%20ago%22,%22end%22:%22now%22}&drillstate={%22time_zone_offset%22:284400000,%22end%22:1457048782380,%22suffix%22:%22true%22,%22format%22:%22number%22,%22agg_arg%22:%22customer%22,%22filter_type%22:%22inputs%22,%22start%22:1456387200000,%22filters%22:{%22customer.isProd%22:{%22%3D%22:[%220%22]}},%22n_decimals%22:%222%22,%22aggregate%22:[%22UNIQUE_COUNT%22],%22do_not_sample%22:true}&table=customer_usage&view=number&fromDashboard=true

The value of time_zone_offset is 284400000 (ignore the %22 placeholder characters): 

time_zone_offset%22:284400000

Change the time zone offset for dashboard charts

Log in to your Interana config node and use the change_timezone_offset.py command to change the time zone offset used in dashboard charts. 

Use the following syntax:

change_time zone_offset.py --from_offset <existing_offset_from_UTC> --to_offset <new_offset_from_UTC>

For example, to change the offset from PDT to PST:

$ /opt/interana/third_party/bin/python2.7/mnt/filer2/tank/pool/git_src/deploy-utils/scripts/change_time zone_offset.py --from_offset 284400000 --to_offset 288000000

 

  • Was this article helpful?