Skip to content

Commit

Permalink
Disable the Storage Metrics emmiter for now.
Browse files Browse the repository at this point in the history
Closes #5468
  • Loading branch information
decko committed Jun 18, 2024
1 parent 62cc58a commit 7029ee4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES/5468.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Temporarily disable domains' disk usage reporting.
14 changes: 8 additions & 6 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, AFTER_CREATE
from django_lifecycle import hook, BEFORE_DELETE, BEFORE_UPDATE

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

@hook(AFTER_CREATE)
def _report_domain_disk_usage(self):
from pulpcore.app.util import DomainMetricsEmitterBuilder

DomainMetricsEmitterBuilder.build(self)
# 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)

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

from pulpcore.app.util import init_domain_metrics_exporter # noqa: E402
# 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

init_domain_metrics_exporter()
# init_domain_metrics_exporter()

0 comments on commit 7029ee4

Please sign in to comment.