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

Duplicated timeseries in CollectorRegistry #22

Closed
adampointer opened this issue Nov 21, 2024 · 3 comments
Closed

Duplicated timeseries in CollectorRegistry #22

adampointer opened this issue Nov 21, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@adampointer
Copy link

Hi,

First, thanks for the great tool. This has been so useful for making our cost data more visible.

I am getting a regular panic every other time the costs are queried from AWS.


  |   | 2024-11-21 02:12:25.547 | ValueError: Duplicated timeseries in CollectorRegistry: {'aws_daily_cost_by_service_by_account'} |  
  |   | 2024-11-21 02:12:25.547 | raise ValueError( |  
  |   | 2024-11-21 02:12:25.547 | File "/usr/local/lib/python3.10/site-packages/prometheus_client/registry.py", line 43, in register |  
  |   | 2024-11-21 02:12:25.547 | registry.register(self) |  
  |   | 2024-11-21 02:12:25.547 | File "/usr/local/lib/python3.10/site-packages/prometheus_client/metrics.py", line 143, in __init__ |  
  |   | 2024-11-21 02:12:25.547 | super().__init__( |  
  |   | 2024-11-21 02:12:25.546 | File "/usr/local/lib/python3.10/site-packages/prometheus_client/metrics.py", line 365, in __init__ |  
  |   | 2024-11-21 02:12:25.546 | self.aws_daily_cost_usd = Gauge(self.metric_name, "Daily cost of an AWS account in USD", self.labels) |  
  |   | 2024-11-21 02:12:25.546 | File "/app/exporter.py", line 40, in __init__ |  
  |   | 2024-11-21 02:12:25.546 | app_metrics = MetricExporter( |  
  |   | 2024-11-21 02:12:25.546 | File "//main.py", line 118, in main |  
  |   | 2024-11-21 02:12:25.546 | main(config) |  
  |   | 2024-11-21 02:12:25.546 | File "//main.py", line 138, in <module> |  
  |   | 2024-11-21 02:12:25.546 | Traceback (most recent call last):

I am using the default polling_interval_seconds: 28800 setting. Do I need to tweak that setting?

@gluckzhang gluckzhang self-assigned this Nov 21, 2024
@gluckzhang gluckzhang added the bug Something isn't working label Nov 21, 2024
@gluckzhang
Copy link
Member

Hi @adampointer, thank you for the feedback. I can confirm that this is a bug in the latest version. I will fix it by this weekend :)

gluckzhang added a commit that referenced this issue Nov 25, 2024
which is caused by recreating metric exporters

Signed-off-by: Long Zhang <[email protected]>
@gluckzhang
Copy link
Member

Hi @adampointer, the issue has been fixed by PR #23. I will wait a bit to release a new version because another open PR is almost done. Let's see if that one can be closed by today or tomorrow. I won't let you wait for too long :)

@gluckzhang
Copy link
Member

Hi again, to not block you, I have released the fix in https://github.com/electrolux-oss/aws-cost-exporter/releases/tag/v1.0.7 Feel free to try it out and get back to me if there are other issues. I am going to close this one :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants