Im currently facing an issue where I do get an error that is saying:
` ValueError: Duplicated timeseries in CollectorRegistry: {'scraper_request_count_created', 'scraper_request_count_total', 'scraper_request_count'}`
I have two scripts which we can call file1.py and file2.py
**file1.py**:
```py
import time
import requests
from lib.prometheus import REQUEST_COUNT
def from_page(url):
while True:
with requests.get(url) as rep:
REQUEST_COUNT().labels(store="stackoverflow", http_status=rep.status_code).inc()
print("Response: ", rep.status_code)
time.sleep(60)
if __name__ == '__main__':
```
**file2.py**
```py
import time
import requests
from lib.prometheus import REQUEST_COUNT
def from_page(url):
while True:
with requests.get(url) as rep:
REQUEST_COUNT().labels(store="google", http_status=rep.status_code).inc()
print("Response: ", rep.status_code)
time.sleep(60)
if __name__ == '__main__':
```
As you can see they both call the `lib.prometheus import REQUEST_COUNT` which is:
```py
from prometheus_client import Counter, CollectorRegistry
registery = CollectorRegistry()
def REQUEST_COUNT():
return Counter(
namespace="scraper",
name="request_count",
documentation="Count the total requests",
labelnames=['store', 'http_status'],
registry=registery
)
```
The problem is that if I run this script simultaneously then I will get the error `ValueError: Duplicated timeseries in CollectorRegistry: {'scraper_request_count_created', 'scraper_request_count_total', 'scraper_request_count'}` and I wonder what can I do be able to push the data even if its in duplicated timeseries?