The namespace and subsystem kwargs add prefixes to metric name when running normally. However, when using the multiprocess mode of the library, those prefixes are ignored.
Here is a small program to reproduce this problem:
from prometheus_client import Counter, CollectorRegistry, start_http_server, generate_latest, multiprocess
import time
registry = CollectorRegistry()
c = Counter('test', 'Test', namespace='foo', subsystem='bar', registry=registry)
c.inc()
multiprocess.MultiProcessCollector(registry)
print(generate_latest(registry).decode())
Running this program prints:
# HELP foo_bar_test Test
# TYPE foo_bar_test counter
foo_bar_test 1.0
# HELP test Multiprocess metric
# TYPE test counter
test 1.0