- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.9k
feat(metrics): add TTL-based cache for metric sets and add expire_metrics_secs for Prometheus remote write sink #23286
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
feat(metrics): add TTL-based cache for metric sets and add expire_metrics_secs for Prometheus remote write sink #23286
Conversation
| FYI I haven't tested this E2E as I can't get it to build on my M4 Mac.. would love if someone could get a Dockerfile up (alpine) so I can test it on my Kube cluster | 
      
        
              This comment was marked as outdated.
        
        
      
    
  This comment was marked as outdated.
      
        
              This comment was marked as outdated.
        
        
      
    
  This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, great PR
| @pront would you be able to run/upload a build of it so I can do a smoke test on my kube cluster? | 
…/vector into greylilac09/add-expiry-cache
| 
 Not sure what is the ask here, do you want a custom docker image from this PR? You should be able to run  | 
| @pront Was able to test it and it looks good (see the screenshots in the PR description), should be good to merge | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Head branch was pushed to by a user without write access
| @pront hey sorry can you approve it again? not sure how this process works but it looks like the auto-merge disabled itself | 
| @pront why are the tests not running when you've approved it and set to auto-merge? | 
| 
 Each time you push a commit it requires manual approval from a maintainer. It is a security measure. It should be merged today. | 
| @pront This issue also makes this issue pretty easy to resolve: #23018 (comment) Options: 
 Curious what you think what be the best approach here | 
| ^ will move convo to the other thread | 
…rics_secs for Prometheus remote write sink (vectordotdev#23286) * add ttl policy to metricset * rust fmt * rust * update cue * fix secs format * fix float * component docs * update comments * fix fmt * update comment * add cleanup and fix timestamp * remove unnecessary function * add MetricEntry as struct * fix lint issues * use is_some_and * revert greptime_logs.cue
| Adding this to the release highlights: #23586 | 
Summary
expire_metrics_secsconfig for Prometheus remote write sink which uses the TTL-based cacheVector configuration
How did you test this PR?
Example showing
vector_component_allocated_bytesrunning for 12 hours before and after the change setting expire_metrics_secs to 120:with the following sink:
Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References
Notes
@vectordotdev/vectorto reach out to us regarding this PR.pre-pushhook, please see this template.cargo fmt --allcargo clippy --workspace --all-targets -- -D warningscargo nextest run --workspace(alternatively, you can runcargo test --all)git merge origin masterandgit push.Cargo.lock), pleaserun
cargo vdev build licensesto regenerate the license inventory and commit the changes (if any). More details here.