Skip to content

Commit

Permalink
bug-1906113: remove eliot references
Browse files Browse the repository at this point in the history
This fixes a bunch of copy-paste errors and switches to statsd-centric
language.
  • Loading branch information
willkg committed Aug 9, 2024
1 parent 203996d commit 2dc86d3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/exts/document_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

"""Generates the documentation for Eliot metrics."""
"""Generates the documentation for metrics."""

import importlib
import sys
Expand Down
9 changes: 6 additions & 3 deletions docs/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
Metrics
=======

Metrics in Tecken
=================
StatsD Metrics in Tecken
========================

.. autometrics:: tecken.libmarkus.TECKEN_METRICS
Tecken uses `StatsD <https://github.com/statsd/statsd>`__ with
`DogStatsD extensions <https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent>`__.

.. autometrics:: tecken.libmarkus.STATSD_METRICS
12 changes: 6 additions & 6 deletions tecken/libmarkus.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
METRICS = markus.get_metrics("tecken")


# Complete index of all Eliot metrics. This is used in documentation and to filter
# outgoing metrics.
# Complete index of all metrics. This is used in documentation and to filter outgoing
# metrics.
def _load_registered_metrics():
# Load the eliot_metrics.yaml file in this directory
path = Path(__file__).parent / "tecken_metrics.yaml"
# Load the metrics yaml file in this directory
path = Path(__file__).parent / "statsd_metrics.yaml"
with open(path) as fp:
data = yaml.safe_load(fp)
return data


TECKEN_METRICS = _load_registered_metrics()
STATSD_METRICS = _load_registered_metrics()


def set_up_markus(backends, hostname, debug=False):
Expand All @@ -43,7 +43,7 @@ def set_up_markus(backends, hostname, debug=False):
# In local dev and test environments, we want the RegisteredMetricsFilter to
# raise exceptions when metrics are used incorrectly.
metrics_filter = RegisteredMetricsFilter(
registered_metrics=TECKEN_METRICS, raise_error=True
registered_metrics=STATSD_METRICS, raise_error=True
)
METRICS.filters.append(metrics_filter)

Expand Down
File renamed without changes.

0 comments on commit 2dc86d3

Please sign in to comment.