Skip to content

Question: Why do code examples not follow lower_case variable names and UPPER_CASE constants? #867

@couling

Description

@couling

Apologies for asking about a really boring topic.

I noticed in the README, metrics stored globally with upper case naming:

REQUEST_TIME = Summary('request_processing_seconds', 'Time spent processing request')

This is a bit confusing for many readers because across multiple languages (including python) UPPER_CASE names are use to denote a constant (a value that does not change) and lower_case names are used for variables (that do change).

Likewise in the code base there are things like REGISTRY that are uppercase for non-constant items:

REGISTRY = CollectorRegistry(auto_describe=True)

Is there a specific reason that these examples a reusing upper case names even though it conflicts with common standard and doesn't match the metric name?

I'm just asking because if there is a good reason, this might actually be worth documenting.

Apologies again for the trollish sounding question.

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