Skip to content

Commit

Permalink
Re-enable Storage Metrics emmiter.
Browse files Browse the repository at this point in the history
Revert "Disable the Storage Metrics emmiter for now."
This reverts commit 7029ee4.

[noissue]
  • Loading branch information
decko committed Sep 2, 2024
1 parent aed64cd commit 56d73b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
14 changes: 6 additions & 8 deletions pulpcore/app/models/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.core.files.storage import default_storage
from django.db import models
from django_lifecycle import hook, BEFORE_DELETE, BEFORE_UPDATE
from django_lifecycle import hook, BEFORE_DELETE, BEFORE_UPDATE, AFTER_CREATE

from pulpcore.app.models import BaseModel, AutoAddObjPermsMixin
from pulpcore.exceptions import DomainProtectedError
Expand Down Expand Up @@ -74,13 +74,11 @@ def _cleanup_orphans_pre_delete(self):
# Delete on by one to properly cleanup the storage.
artifact.delete()

# Disabling Storage metrics until we find a solution to resource usage.
# https://github.com/pulp/pulpcore/issues/5468
# @hook(AFTER_CREATE)
# def _report_domain_disk_usage(self):
# from pulpcore.app.util import DomainMetricsEmitterBuilder
#
# DomainMetricsEmitterBuilder.build(self)
@hook(AFTER_CREATE)
def _report_domain_disk_usage(self):
from pulpcore.app.util import DomainMetricsEmitterBuilder

DomainMetricsEmitterBuilder.build(self)

class Meta:
permissions = [
Expand Down
6 changes: 2 additions & 4 deletions pulpcore/app/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
application = get_wsgi_application()
application = OpenTelemetryMiddleware(application)

# Disabling Storage metrics until we find a solution to resource usage.
# https://github.com/pulp/pulpcore/issues/5468
# from pulpcore.app.util import init_domain_metrics_exporter # noqa: E402
from pulpcore.app.util import init_domain_metrics_exporter # noqa: E402

# init_domain_metrics_exporter()
init_domain_metrics_exporter()

0 comments on commit 56d73b9

Please sign in to comment.