summary refs log tree commit diff
path: root/synapse/metrics/__init__.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update type annotations for compatiblity with prometheus_client 0.14 (#12389)Richard van der Hoff2022-04-061-7/+9
| | | | | | | Principally, `prometheus_client.REGISTRY.register` now requires its argument to extend `prometheus_client.Collector`. Additionally, `Gauge.set` is now annotated so that passing `Optional[int]` causes an error.
* Use version string helper from matrix-common (#11979)David Robertson2022-02-141-3/+4
| | | | * Require latest matrix-common * Use the common function
* Fix type errors introduced by new annotations in the Prometheus Client ↵reivilibre2022-02-021-1/+9
| | | | | library. (#11832) Co-authored-by: David Robertson <davidr@element.io>
* Improve `reactor_tick_time` metric (#11724)Richard van der Hoff2022-01-171-93/+1
| | | | | | | | | | | The existing implementation of the `python_twisted_reactor_tick_time` metric is pretty useless, because it *only* measures the time taken to execute timed calls and callbacks from threads. That neglects everything that happens off the back of I/O, which is obviously quite a lot for us. To improve this, I've hooked into a different place in the reactor - in particular, where it calls `epoll`. That call is the only place it should wait for something to happen - the rest of the loop *should* be quick. I've also removed `python_twisted_reactor_pending_calls`, because I don't believe anyone ever looks at it, and it's a nuisance to populate.
* Simplify GC prometheus metrics (#11723)Richard van der Hoff2022-01-131-159/+3
| | | | | Rather than hooking into the reactor loop, just add a timed task that runs every 100 ms to do the garbage collection. Part 1 of a quest to simplify the reactor monkey-patching.
* Use auto_attribs/native type hints for attrs classes. (#11692)Patrick Cloke2022-01-131-10/+10
|
* Add type annotations to `synapse.metrics` (#10847)Sean Quah2021-11-171-31/+70
|
* Add metrics to the threadpools (#11178)Erik Johnston2021-11-011-0/+37
|
* Type hints for the remaining two files in `synapse.http`. (#11164)David Robertson2021-10-281-5/+9
| | | | | | | | | | | | | | | | | | | * Teach MyPy that the sentinel context is False This means that if `ctx: LoggingContextOrSentinel` then `bool(ctx)` narrows us to `ctx:LoggingContext`, which is a really neat find! * Annotate RequestMetrics - Raise errors for sentry if we use the sentinel context - Ensure we don't raise an error and carry on, but not recording stats - Include stack trace in the error case to lower Sean's blood pressure * Make mypy pass for synapse.http.request_metrics * Make synapse.http.connectproxyclient pass mypy Co-authored-by: reivilibre <oliverw@matrix.org>
* Use inline type hints in various other places (in `synapse/`) (#10380)Jonathan de Jong2021-07-151-3/+3
|
* Export jemalloc stats to prometheus when used (#9882)Erik Johnston2021-05-061-0/+1
|
* Limit how often GC happens by time. (#9902)Erik Johnston2021-05-051-2/+16
| | | | | | | | | | | | | | | Synapse can be quite memory intensive, and unless care is taken to tune the GC thresholds it can end up thrashing, causing noticable performance problems for large servers. We fix this by limiting how often we GC a given generation, regardless of current counts/thresholds. This does not help with the reverse problem where the thresholds are set too high, but that should only happen in situations where they've been manually configured. Adds a `gc_min_seconds_between` config option to override the defaults. Fixes #9890.
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Don't report anything from GaugeBucketCollector metrics until data is ↵Andrew Morgan2021-04-061-3/+13
| | | | | present (#8926) This PR modifies `GaugeBucketCollector` to only report data once it has been updated, rather than initially reporting a value of 0. Fixes zero values being reported for some metrics on startup until a background job to update the metric's value runs later.
* Fix additional type hints from Twisted upgrade. (#9518)Patrick Cloke2021-03-031-5/+6
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-3/+4
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Add metrics for tracking 3PID /requestToken requests. (#8712)Erik Johnston2020-11-131-0/+10
| | | | | | The main use case is to see how many requests are being made, and how many are second/third/etc attempts. If there are large number of retries then that likely indicates a delivery problem.
* Rewrite BucketCollectorRichard van der Hoff2020-09-301-47/+68
| | | | | | | | | | | | This was a bit unweildy for what I wanted: in particular, I wanted to assign each measurement straight into a bucket, rather than storing an intermediate Counter which didn't do any bucketing at all. I've replaced it with something that is hopefully a bit easier to use. (I'm not entirely sure what the difference between a HistogramMetricFamily and a GaugeHistogramMetricFamily is, but given our counters can go down as well as up the latter *sounds* more accurate?)
* Use slots in attrs classes where possible (#8296)Patrick Cloke2020-09-141-2/+2
| | | | | slots use less memory (and attribute access is faster) while slightly limiting the flexibility of the class attributes. This focuses on objects which are instantiated "often" and for short periods of time.
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-8/+8
|
* Add some metrics for inbound and outbound federation processing times (#7755)Erik Johnston2020-06-301-0/+6
|
* Replace iteritems/itervalues/iterkeys with native versions. (#7692)Patrick Cloke2020-06-151-4/+2
|
* synapse.metrics: implement detailed memory usage reporting on PyPy (#7536)Ivan Shapovalov2020-05-221-1/+78
| | | | | | PyPy's gc.get_stats() returns an object containing detailed allocator statistics which could be beneficial to collect as metrics. Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
* Add prometheus metrics for the number of active pushers (#7103)Richard van der Hoff2020-03-191-5/+7
|
* Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)Patrick Cloke2020-02-211-1/+1
| | | | Ensure good comprehension hygiene using flake8-comprehensions.
* Fix up some typechecking (#6150)Amber Brown2019-10-021-2/+2
| | | | | | * type checking fixes * changelog
* Fix for structured logging tests stomping on logs (#6023)Amber Brown2019-09-131-3/+2
|
* Add a build info metric to Prometheus (#6005)Amber Brown2019-09-101-0/+12
|
* Support Prometheus_client 0.4.0+ (#5636)Amber Brown2019-07-181-0/+17
|
* Don't log GC 0s at INFO (#5557)Amber Brown2019-06-281-1/+4
|
* Run Black. (#5482)Amber Brown2019-06-201-5/+2
|
* Prometheus histograms are cumalativeErik Johnston2019-06-141-1/+0
|
* fix prometheus rendering errorAmber H. Brown2019-06-141-1/+1
|
* Expose statistics on extrems to prometheus (#5384)Amber Brown2019-06-131-20/+92
|
* Add metrics for number of outgoing EDUs, by type (#4695)Richard van der Hoff2019-02-201-2/+0
|
* Remove spurious commentErik Johnston2018-09-141-2/+0
|
* Add in flight real time metrics for Measure blocksErik Johnston2018-09-141-1/+109
|
* fix metric nameRichard van der Hoff2018-08-071-1/+1
|
* more metrics for the federation and appservice sendersRichard van der Hoff2018-08-071-0/+13
|
* run isortAmber Brown2018-07-091-6/+5
|
* Attempt to be more performant on PyPy (#3462)Amber Brown2018-06-281-1/+2
|
* Fix description of "python_gc_time" metricRichard van der Hoff2018-06-211-1/+1
|
* spell gauge correctlyMatthew Hodgson2018-06-161-1/+1
|
* add a last seen metric (#3396)Amber Brown2018-06-141-0/+21
|
* Hopefully, fix LaterGuage error handlingRichard van der Hoff2018-06-041-3/+6
|
* Run Prometheus on a different port, optionally. (#3274)Amber Brown2018-05-311-1/+2
|
* pep8Matthew Hodgson2018-05-291-0/+1
|
* disable CPUMetrics if no /proc/self/statMatthew Hodgson2018-05-291-0/+3
| | | | fixes build on macOS again
* invalid syntax :(Amber Brown2018-05-281-2/+1
|
* update metrics to be in secondsAmber Brown2018-05-281-9/+10
|
* pepeighttttAmber Brown2018-05-231-0/+1
|
* add back CPU metricsAmber Brown2018-05-231-1/+35
|
* more cleanupAmber Brown2018-05-221-3/+1
|
* cleanupAmber Brown2018-05-221-6/+22
|
* fixesAmber Brown2018-05-221-2/+10
|
* Merge remote-tracking branch 'origin/develop' into 3218-official-promAmber Brown2018-05-221-1/+5
|\
* | replacing portionsAmber Brown2018-05-211-119/+63
|/
* Track last processed event received_tsErik Johnston2018-04-111-0/+13
|
* Track where event stream processing have gotten up toErik Johnston2018-04-111-0/+13
|
* Add GaugeMetricErik Johnston2018-04-111-1/+8
|
* Don't disable GC when running on PyPyVincent Breitmoser2018-04-101-1/+7
| | | | | | | | PyPy's incminimark GC can't be triggered manually. From what I observed there are no obvious issues with just letting it run normally. And unlike CPython, it actually returns unused RAM to the system. Signed-off-by: Vincent Breitmoser <look@my.amazin.horse>
* Add a metric which increments when a request is receivedRichard van der Hoff2018-03-091-0/+16
| | | | | | It's useful to know when there are peaks in incoming requests - which isn't quite the same as there being peaks in outgoing responses, due to the time taken to handle requests.
* Add some comments about the reactor tick time metricRichard van der Hoff2018-01-191-1/+6
|
* Rename the python-specific metrics now the docs claim that we have donePaul "LeoNerd" Evans2016-11-031-7/+9
|
* Set up the process collector during metrics __init__; that way all ↵Paul "LeoNerd" Evans2016-10-271-0/+3
| | | | split-process workers have it
* Allow creation of a 'subspace' within a Metrics object, returning another onePaul "LeoNerd" Evans2016-10-271-0/+3
|
* Move the process metrics collector code into its own filePaul "LeoNerd" Evans2016-10-191-141/+0
|
* A slightly neater way to manage metric collector functionsPaul "LeoNerd" Evans2016-10-191-2/+8
|
* appease pep8Paul "LeoNerd" Evans2016-10-191-3/+5
|
* Also guard /proc/self/fds-related code with a suitable psuedoconstantPaul "LeoNerd" Evans2016-10-191-3/+5
|
* Guard registration of process-wide metrics by existence of the requisite ↵Paul "LeoNerd" Evans2016-10-191-45/+50
| | | | /proc entries
* Add standard process_start_time_seconds metricPaul "LeoNerd" Evans2016-10-191-0/+15
|
* Add standard process_max_fds metricPaul "LeoNerd" Evans2016-10-191-0/+13
|
* Add standard process_open_fds metricPaul "LeoNerd" Evans2016-10-191-20/+29
|
* Add standard process_*_memory_bytes metricsPaul "LeoNerd" Evans2016-10-191-0/+8
|
* Use /proc/self/stat to generate the new process_cpu_*_seconds_total metricsPaul "LeoNerd" Evans2016-10-191-4/+12
|
* Export CPU usage metrics also under prometheus-standard metric namePaul "LeoNerd" Evans2016-10-191-0/+15
|
* Make psutil optionalErik Johnston2016-08-081-2/+11
|
* Add metrics for psutil derived memory usageErik Johnston2016-07-201-1/+8
|
* Don't track total objects as its too expensive to calculateErik Johnston2016-06-071-1/+0
|
* Record some more GC metricsErik Johnston2016-06-071-0/+5
|
* Also record number of unreachable objectsErik Johnston2016-06-071-2/+4
|
* Change the way we do statsErik Johnston2016-06-071-7/+3
|
* Merge pull request #771 from matrix-org/erikj/gc_tickErik Johnston2016-06-071-0/+26
|\ | | | | Manually run GC on reactor tick.
| * Count number of GC collectsErik Johnston2016-05-161-5/+11
| |
| * Add a commentErik Johnston2016-05-131-0/+5
| |
| * Manually run GC on reactor tick.Erik Johnston2016-05-091-0/+15
| | | | | | | | This also adds a metric for amount of time spent in GC.
* | Change CacheMetrics to be quickerErik Johnston2016-06-031-10/+6
|/ | | | | | We change it so that each cache has an individual CacheMetric, instead of having one global CacheMetric. This means that when a cache tries to increment a counter it does not need to go through so many indirections.
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Check that /proc/self/fd exists before listing itMark Haines2015-09-071-0/+4
|
* The maxrss reported by getrusage is in kilobytes, not pagesMark Haines2015-09-071-4/+3
|
* Also check for presence of 'threadCallQueue' in reactorErik Johnston2015-08-181-1/+8
|
* Use more helpful variable namesErik Johnston2015-08-181-3/+3
|
* Fix pending_calls metric to not lieErik Johnston2015-08-141-3/+18
|
* Don't time getDelayedCallsErik Johnston2015-08-131-1/+1
|
* Add some metrics about the reactorErik Johnston2015-08-131-0/+29
|
* Appease pep8Paul "LeoNerd" Evans2015-04-011-0/+1
|
* Report process open filehandles in metricsPaul "LeoNerd" Evans2015-04-011-0/+34
|
* Appease pyflakesPaul "LeoNerd" Evans2015-03-121-1/+1
|
* Appease pep8Paul "LeoNerd" Evans2015-03-121-1/+2
|
* Replace the @metrics.counted annotations in federation with ↵Paul "LeoNerd" Evans2015-03-121-17/+0
| | | | specifically-written counters and distributions
* Don't forbid '_' in metric basenames any more, to allow things like foo_timePaul "LeoNerd" Evans2015-03-121-5/+0
|
* Rename TimerMetric to DistributionMetric; as it could count more than just timePaul "LeoNerd" Evans2015-03-121-3/+5
|
* Remember to emit final linefeed from /metrics page, or Prometheus gets upsetPaul "LeoNerd" Evans2015-03-121-0/+2
|
* Use _ instead of . as a metric namespacing separator, for PrometheusPaul "LeoNerd" Evans2015-03-121-3/+11
|
* Have all @metrics.counted use a single metric name vectored on the method ↵Paul "LeoNerd" Evans2015-03-121-2/+9
| | | | name, rather than a brand new scalar counter per counted method
* Provide some process resource usage metricsPaul "LeoNerd" Evans2015-03-121-0/+27
|
* Neater register_* methods on overall Metrics containerPaul "LeoNerd" Evans2015-03-121-22/+12
|
* Rename CacheCounterMetric to just CacheMetric; add a CallbackMetric ↵Paul "LeoNerd" Evans2015-03-121-3/+3
| | | | component to give the size of the cache
* Ensure that exceptions while rendering individual metrics don't stop others ↵Paul "LeoNerd" Evans2015-03-121-1/+10
| | | | from being rendered anyway - especially useful for CallbackMetric
* Initial attempt at a scalar callback-based metric to give instantaneous ↵Paul "LeoNerd" Evans2015-03-121-1/+10
| | | | snapshot gauges
* Create the concept of a cachecounter metric; generating two counters ↵Paul "LeoNerd" Evans2015-03-121-1/+10
| | | | specific to caches
* An initial implementation of a 'metrics' instance, similar to a 'logger' for ↵Paul "LeoNerd" Evans2015-03-121-0/+69
keeping counter stats on method calls