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

vector() function produces wrong timestamp on remote write #8240

Closed
mprokopov opened this issue Jan 23, 2023 · 2 comments · Fixed by #8370
Closed

vector() function produces wrong timestamp on remote write #8240

mprokopov opened this issue Jan 23, 2023 · 2 comments · Fixed by #8370

Comments

@mprokopov
Copy link

Describe the bug
If vector() function is used to produce a default value for extracted metrics from logs, it's being sent to prometheus using remote write with bad timestamp. Related to #6946

The major issue it brings, is that Prometheus fully stops accepting any new metrics after this event. The only way to resume Prometheus operations is to stop and completely clear TSDB.

To Reproduce
Steps to reproduce the behavior:

  1. Started Loki 2.7.1 with the following config snippet for ruler
ruler:
  storage:
    type: local
    local:
      directory: /rules
  wal:
    dir: /loki/rules-wal
  rule_path: /tmp/rules
  enable_api: true
  remote_write:
    enabled: true
    client:
      url: http://prometheus.my.internal/api/v1/write

  1. Started Promtail 2.7.1
  2. Started Prometheus with remote write option enabled.
  3. Rule:
    groups: 
    - name: Traefik
      interval: 1m
     rules:
     - record: traefic_count
       expr: |
         sum(count_over_time({namespace="traefik"}[5m]))
         or
         vector(0)
    

Expected behavior
Exported metrics to prometheus endpoint using remote write should use correct timestamp.

Environment:

  • Infrastructure: bare-metal with docker
  • Deployment tool: ansible

Screenshots, Promtail config, or terminal output
Screenshot 2023-01-23 at 12 37 08

@liguozhong
Copy link
Contributor

I am very sorry that this bug has troubled you, I will fix this bug as soon as possible

@mprokopov
Copy link
Author

I really appreciate your efforts, @liguozhong!
Thank you very much for responding to this issue so fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants