英文:
How to increase jenkins prometheus plugin data retention?
问题
我们在Jenkins实例中安装了Prometheus插件,指标可在https://jenkins-url/prometheus
端点中找到。但是可用数据仅为2天前。我想知道是否有方法增加此数据保留。
Jenkins Prometheus插件配置org.jenkinsci.plugins.prometheus.config.PrometheusConfiguration.xml
:
<?xml version='1.1' encoding='UTF-8'?>
<org.jenkinsci.plugins.prometheus.config.PrometheusConfiguration plugin="prometheus@2.0.10">
<urlName>prometheus</urlName>
<additionalPath></additionalPath>
<defaultNamespace>default</defaultNamespace>
<jobAttributeName>jenkins_job</jobAttributeName>
<useAuthenticatedEndpoint>true</useAuthenticatedEndpoint>
<collectingMetricsPeriodInSeconds>120</collectingMetricsPeriodInSeconds>
<countSuccessfulBuilds>true</countSuccessfulBuilds>
<countUnstableBuilds>true</countUnstableBuilds>
<countFailedBuilds>true</countFailedBuilds>
<countNotBuiltBuilds>true</countNotBuiltBuilds>
<countAbortedBuilds>true</countAbortedBuilds>
<fetchTestResults>true</fetchTestResults>
<processingDisabledBuilds>false</processingDisabledBuilds>
<appendParamLabel>false</appendParamLabel>
<appendStatusLabel>false</appendStatusLabel>
<labeledBuildParameterNames></labeledBuildParameterNames>
<collectDiskUsage>true</collectDiskUsage>
</org.jenkinsci.plugins.prometheus.config.PrometheusConfiguration>
[]
我尝试在Github中探索Prometheus插件源代码。搜索了关键词如retention、storage,但未找到相关内容。
PrometheusConfiguration-JavaDoc
英文:
We've installed prometheus plugin in our jenkins instance and the metrics are available in https://jenkins-url/prometheus
endpoint. However the data available is only 2 days old. I'd like to know if there's a way to increase this data retention.
Jenkins Prometheus Plugin Configuration org.jenkinsci.plugins.prometheus.config.PrometheusConfiguration.xml
:
<?xml version='1.1' encoding='UTF-8'?>
<org.jenkinsci.plugins.prometheus.config.PrometheusConfiguration plugin="prometheus@2.0.10">
<urlName>prometheus</urlName>
<additionalPath></additionalPath>
<defaultNamespace>default</defaultNamespace>
<jobAttributeName>jenkins_job</jobAttributeName>
<useAuthenticatedEndpoint>true</useAuthenticatedEndpoint>
<collectingMetricsPeriodInSeconds>120</collectingMetricsPeriodInSeconds>
<countSuccessfulBuilds>true</countSuccessfulBuilds>
<countUnstableBuilds>true</countUnstableBuilds>
<countFailedBuilds>true</countFailedBuilds>
<countNotBuiltBuilds>true</countNotBuiltBuilds>
<countAbortedBuilds>true</countAbortedBuilds>
<fetchTestResults>true</fetchTestResults>
<processingDisabledBuilds>false</processingDisabledBuilds>
<appendParamLabel>false</appendParamLabel>
<appendStatusLabel>false</appendStatusLabel>
<labeledBuildParameterNames></labeledBuildParameterNames>
<collectDiskUsage>true</collectDiskUsage>
</org.jenkinsci.plugins.prometheus.config.PrometheusConfiguration>
[]
I tried exploring the prometheus plugin source code in Github. Searched for keywords like retention, storage but couldn't find anything.
PrometheusConfiguration-JavaDoc
答案1
得分: 1
那不是所有操作的方式:Prometheus插件只是暴露指标(它们的当前状态),它不存储任何数据。
数据是由Prometheus存储的。您可以查看有关如何更改Prometheus保留策略的信息 这个答案。
英文:
That's not how it all works: Prometheus plugin just exposes metrics (their current state), it doesn't store anything.
Data is stored by Prometheus. You can see information on how to change retention policy of Prometheus in this answer.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论