Features
- Added support for Python 3.14 (#181)
Backwards incompatible changes
- Dropped support for Python 3.9 (#180)
- Switch to uv and just for maintenance and development (#167)
Features
- Added support for Python 3.13 (#159)
Backwards incompatible changes
Dropped support for Python 3.8 (#160)
Changed timestamp field in
LoggingMetrics. TheLoggingMetricsnow defaults to not emitting a timestamp at all. If you would like a timestamp, you can provide the"timestamp_mode"option with either"utc"for UTC timestamps or"local"for local timezone timestamps.No timestamp example:
LoggingMetrics()
emits lines like:
METRICS|histogram|foo|4321|#key1:val
"utc"timestamp mode example:LoggingMetrics(options={"timestamp_mode": "utc"})emits lines like:
METRICS|2017-03-06T11:30:00+00:00:00|histogram|foo|4321|#key1:val
"local"timestamp mode example:LoggingMetrics(options={"timestamp_mode": "local"})emits lines like:
METRICS|2017-03-06T11:30:00|histogram|foo|4321|#key1:val
If you want the original behavior, add set
timestamp_modetolocal. (#11)
Features
Add support for Python 3.12 (#122)
Add
AnyTagValuefor asserting that metrics are emitted with certain tags, but ignoring the tag values in tests. (#141)Example:
def test_somekey_emitted(): with metricsmock() as mm: # emit some metrics mm.assert_incr("somekey", value=1, tags=[AnyTagValue("host")])Add
MetricsInterface.extend_prefix()to iteratively hone a metrics interface prefix. (#142)Example:
metrics = markus.get_metrics("project") module_metrics = metrics.extend_prefix("somemodule") module_metrics.incr("key1") # prefix is project.somemodule.key1Add
metricsmockpytest fixture. (#118)Add
RegisteredMetricsFiltermetrics filter making it easier to enforce metrics can only be emitted if documented. (#15)
Backwards incompatible changes
- Dropped support for Python 3.7 (#121)
Bug fixes
- Add support for setting
origin_detection_enabledin Datadog backend. (#108) - Switch from Flake8 to Ruff. (#109)
Features
- Add support for Python 3.11 (#100)
Bug fixes
- Redo how dev environment works so it's no longer installed via an extras but is now in a separate requirements-dev.txt file.
- Split flake8 tou a separate requirements-flake8.txt and tox environment to handle conflicts with installing other things.
Bug fixes
- Move pytest import to a pytest plugin so it's easier to determine when pytest is running. (#95) Thank you, John!
Features
- Added support for Python 3.10 (#88)
Backwards incompatibel changes
- Dropped support for Python 3.6 (#89)
Features
- Added support for Python 3.9 (#79). Thank you, Brady!
- Changed
assert_*helper methods onmarkus.testing.MetricsMockto print the records to stdout if the assertion fails. This can save some time debugging failing tests. (#74)
Backwards incompatible changes
- Dropped support for Python 3.5 (#78). Thank you, Brady!
markus.testing.MetricsMock.get_recordsandmarkus.testing.MetricsMock.filter_recordsreturnmarkus.main.MetricsRecordinstances now. This might require you to rewrite/update tests that use theMetricsMock.
Features
- Add
assert_methods toMetricsMockto reduce the boilerplate for testing. Thank you, John! (#68)
Bug fixes
- Remove use of
sixlibrary. (#69)
Features
- Fix
get_metrics()so you can call it without passing in a thing and it'll now create aMetricsInterfacethat doesn't have a key prefix. (#59)
Features
- Use
time.perf_counter()if available. Thank you, Mike! (#34) - Support Python 3.7 officially.
- Add filters for adjusting and dropping metrics getting emitted. See documentation for more details. (#40)
Backwards incompatible changes
tagsnow defaults to[]instead ofNonewhich may affect some expected test output.Adjust internals to run
.emit()on backends. If you wrote your own backend, you may need to adjust it.Drop support for Python 3.4. (#39)
Drop support for Python 2.7.
If you're still using Python 2.7, you'll need to pin to
<2.0.0. (#42)
Bug fixes
- Document feature support in backends. (#47)
- Fix
MetricsMock.has_record()example. Thank you, John!
Features
- Add
.clear()toMetricsMockmaking it easier to build a pytest fixture with theMetricsMockcontext and manipulate records for easy testing. (#29)
Bug fixes
- Update Cloudwatch backend fixing
.timing()and.histogram()to sendhistogrammetrics type which Datadog now supports. (#31)
Typo fixes
- Fix the date from the previous release. Ugh.
Features
- Official switch to semver.
Bug fixes
- Fix
MetricsMockso it continues to work even ifconfigureis called. (#27)
Features
- Added
markus.utils.generate_tagutility function
Features
- Added support for Python 2.7.
- Added a
markus.backends.statsd.StatsdMetricsbackend that uses pystatsd client for statsd pings. Thank you, Javier!
Bug fixes
- Added
LoggingRollupMetricsto docs. - Mozilla has been running Markus in production for 6 months so we can mark it production-ready now.
Features
- Added a
markus.backends.logging.LoggingRollupMetricsbackend that rolls up metrics and does some light math on them. Possibly helpful for light profiling for development.
Bug fixes
- Lots of documentation fixes. Thank you, Peter!
Initial writing.