Skip to content

Commit

Permalink
chore(metrics): Added more metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Malinowski authored and Edward Malinowski committed Jun 26, 2024
1 parent b0c459b commit 040c9f2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions fence/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

class Metrics:
def __init__(self):
self.app = None
self.presigned_url_counter = None
self.login_counter = None
self.fence_login_counter = None
Expand All @@ -37,47 +36,47 @@ def initialize_metrics(self, app):
self.presigned_url_counter = Counter(
"fence_presigned_url_requests_total",
"Total number of presigned URL requests",
registry=self.app.prometheus_registry,
registry=app.prometheus_registry,
)
self.login_counter = Counter(
"fence_all_login_requests_total",
"Total number of login requests",
registry=self.app.prometheus_registry,
registry=app.prometheus_registry,
)
self.fence_login_counter = Counter(
"fence_login_requests_total",
"Total number of fence login requests",
registry=self.app.prometheus_registry,
registry=app.prometheus_registry,
)
self.google_login_counter = Counter(
"google_login_requests_total",
"Total number of Google login requests",
registry=self.app.prometheus_registry,
registry=app.prometheus_registry,
)
self.ras_login_counter = Counter(
"fence_ras_login_requests_total",
"Total number of RAS login requests",
registry=self.app.prometheus_registry,
registry=app.prometheus_registry,
)
self.presigned_urls_ga4gh_drs_counter = Counter(
"fence_presigned_urls_ga4gh_drs_requests_total",
"Total number of presigned URL requests for GA4GH DRS",
registry=self.app.prometheus_registry,
registry=app.prometheus_registry,
)
self.presigned_url_download_protocol_gcs_counter = Counter(
"fence_presigned_url_download_protocol_gcs_requests_total",
"Total number of presigned URL requests for GCS",
registry=self.app.prometheus_registry,
registry=app.prometheus_registry,
)
self.presigned_url_download_protocol_s3_counter = Counter(
"fence_presigned_url_download_protocol_s3_requests_total",
"Total number of presigned URL requests for S3",
registry=self.app.prometheus_registry,
registry=app.prometheus_registry,
)
self.presigned_url_data_metrics_size_gauge = Gauge(
"fence_presigned_url_data_metrics_size_bytes",
"Size of data metrics in bytes",
registry=self.app.prometheus_registry,
registry=app.prometheus_registry,
)


Expand Down

0 comments on commit 040c9f2

Please sign in to comment.