Giter Club home page Giter Club logo

Comments (7)

discordianfish avatar discordianfish commented on August 27, 2024

Not oppose to this in general but I feel @beorn7 might have opinions on this 😬

from node_exporter.

SuperQ avatar SuperQ commented on August 27, 2024

This is not actually a Docker container issue, nor even a node_exporter issue. The log timestamp control is hard coded to UTC in common/promlog.

from node_exporter.

SuperQ avatar SuperQ commented on August 27, 2024

If you want logs in a local timestamp, docker logs -t or journalctl -u will print local timestamps.

from node_exporter.

instantdreams avatar instantdreams commented on August 27, 2024

This is an issue with the docker image - tzdata is not being passed for timezone support. Of all the other containers I have, there are a small number (node_reporter, loki, prometheus, one or two others) that fail to do this.

It is not about the local timestamps either. Here's some test results.

First, using docker:

$ docker logs node-exporter-1
ts=2024-04-17T17:37:05.228Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9100
ts=2024-04-17T17:37:05.228Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9100

$ docker logs node-exporter-1 -t
2024-04-17T17:37:05.228790493Z ts=2024-04-17T17:37:05.228Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9100
2024-04-17T17:37:05.229047084Z ts=2024-04-17T17:37:05.228Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9100

Second, using docker compose:

$ docker compose logs
node-exporter-1  | ts=2024-04-17T17:37:05.228Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9100
node-exporter-1  | ts=2024-04-17T17:37:05.228Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9100

$ docker compose logs --timestamps
node-exporter-1  | 2024-04-17T17:37:05.228790493Z ts=2024-04-17T17:37:05.228Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9100
node-exporter-1  | 2024-04-17T17:37:05.229047084Z ts=2024-04-17T17:37:05.228Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9100

Can this please be reopened and the timezone support be considered?

Thank you

from node_exporter.

SuperQ avatar SuperQ commented on August 27, 2024

Like I said, it does not matter what we do here. The code will ignore it no matter what. This is an issue with the promlog package.

from node_exporter.

instantdreams avatar instantdreams commented on August 27, 2024

Excellent. Where can I raise an issue for the promlog package team to update the docker container to include tzdata to support timezone?

from node_exporter.

discordianfish avatar discordianfish commented on August 27, 2024

@instantdreams https://github.com/prometheus/common - but it's somewhat of a philosophical decision: https://prometheus.io/docs/introduction/faq/#can-i-change-the-timezone-why-is-everything-in-utc

from node_exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.