influxdata / influxdata/influxdb
Influxdb system/internal logs are not showing in local timezone
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
__Steps to reproduce:__
List the minimal actions needed to reproduce the behavior.
1. ... Bring-up InfluxDB(1.7.3) pods with k8s(1.16.3)
2. ... Do kubectl logs -f , see the logs are coming in UTC.
__Expected behavior:__
Logs should come in local timezone of hosts
__Actual behavior:__
I've mounted influxdb pod's /etc/localtime to timezone, http access logs are coming properly i.e in locatimezone but influxdb structure logging not.
ex:
Structure logging
ts=2020-08-12T17:01:44.902894Z lvl=info msg="Executing query" log_id=0O_uQ7iW000 service=query query="SELECT * FROM cpu./.*/ WHERE resourceID = 'y' AND resourceType = 'x' AND time >= now() - 5m ORDER BY DESC LIMIT 1"
Http access
httpd] 10.233.93.213 - - [12/Aug/2020:22:31:44 +0530] "POST /query?db=CPUinfo¶ms=%7B%7D&q=SELECT+%2A+FROM+%2F.%2A%2F+WHERE+resourceID%3D%27x%27+and++resourceType%3D%27y%27+and+time+%3E%3D+now%28%29+-+300s+ORDER+BY+DESC+LIMIT+1 HTTP/1.1" 200 388 "-" "InfluxDBClient" 80616ece-dcbd-11ea-8084-2a14778adc8f 8386
__Environment info:__
* System info: Run `uname -srm` and copy the output here
`Linux 4.4.0-131-generic x86_64`
* InfluxDB version: Run `influxd version` and copy the output here
`InfluxDB v1.7.3 (git: 1.7 698dbc789aff13c2678357a6b93ff73dd7136571)`
* Other relevant environment details: Container runtime, disk info, etc
__Config:__
[influxconfig.txt](https://github.com/influxdata/influxdb/files/5080310/influxconfig.txt)
__Logs:__
Include snippet of errors in log.
__Performance:__
Generate profiles with the following commands for bugs related to performance, locking, out of memory (OOM), etc.
```sh
# Commands should be run when the bug is actively happening.
# Note: This command will run for at least 30 seconds.
curl -o profiles.tar.gz "http://localhost:8086/debug/pprof/all?cpu=true"
curl -o vars.txt "http://localhost:8086/debug/vars"
iostat -xd 1 30 > iostat.txt
# Attach the `profiles.tar.gz`, `vars.txt`, and `iostat.txt` output files.
```
Contributor guide
Research direction
Reproduce the behavior with the listed InfluxDB 1.7.3 pods using `kubectl logs -f ` and compare the structured logging output with the HTTP access logs. Review the linked config and verify that the structured logs honor the host timezone while preserving the expected UTC-versus-local behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes
- Domain
- databases, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100