Skip to content

Calling clear() on Counter without labels fails #707

Description

@andrew-cybsafe

To reproduce:

from prometheus_client import Counter

c = Counter("c", "c")
c.inc()
c.clear()

The error returned is:

AttributeError: 'Counter' object has no attribute '_lock'

Is using .clear() in this way supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions