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

Constance metrics+datetime #78

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

msalaban-reef
Copy link

This is a follow-up to PR #73, an implementation of handling datetime.* types as proposed by @ppolewicz

Variables from CONSTANCE_CONFIG will be exported as Prometheus
metrics, starting with the default prefix of "constance_config_"
Not all string characters are allowed in metric names.
Try to replace them with underscores.
The Enum type is being dropped in multiprocess mode and Gauge
is perfectly enough to represent booleans
As ideated in the CR, there could be two functions:
 - one which stores a single monitored variable,
 - another which stores all of them.
This commit implements them.
@msalaban-reef msalaban-reef force-pushed the constance-metrics+datetime branch from 05daa65 to cc5b95c Compare June 19, 2022 21:10
@lgtm-com
Copy link

lgtm-com bot commented Jun 19, 2022

This pull request introduces 2 alerts and fixes 1 when merging cc5b95c into b54e5b6 - view on LGTM.com

new alerts:

  • 2 for Syntax error

fixed alerts:

  • 1 for Syntax error

THIS IS A HACK: To avoid key clash, try to reuse an existing metric
by using undocumented mapping in the registry.
The ``datetime`` and ``date`` objects are being converted to UNIX
timestamps (with ``date`` defaulting to noon) and exported rounded to
integers.

The ``time`` and ``timedelta`` get represented as the number of seconds,
rounded to integers.
@msalaban-reef msalaban-reef force-pushed the constance-metrics+datetime branch from cc5b95c to bb84355 Compare June 20, 2022 18:43
@lgtm-com
Copy link

lgtm-com bot commented Jun 20, 2022

This pull request introduces 2 alerts and fixes 1 when merging bb84355 into b54e5b6 - view on LGTM.com

new alerts:

  • 2 for Syntax error

fixed alerts:

  • 1 for Syntax error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant