Skip to content

Commit 66e4a2e

Browse files
authored
Add labels to cloud functions and API (#209)
* add labels to hourly downloads * add labels to hourly edge requests * add labels to monthly downloads * add labels to monthly submissions * add labels to stats api
1 parent 1b4fcb5 commit 66e4a2e

5 files changed

Lines changed: 25 additions & 0 deletions

File tree

‎terraform/aggregate_hourly_downloads/main.tf‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ resource "google_cloudfunctions2_function" "function" {
7272
location = var.gcp_region # needs to be explicitly declared for Cloud Run
7373
description = "Cloud function to parse download data from logs and persist to a database"
7474

75+
labels = {
76+
arxiv-system = "reporting"
77+
arxiv-subsystem = "rep-stats"
78+
}
79+
7580
build_config {
7681
runtime = "python313"
7782
entry_point = "aggregate_hourly_downloads"

‎terraform/hourly_edge_requests/main.tf‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ resource "google_cloudfunctions2_function" "function" {
6060
location = var.gcp_region # needs to be explicitly declared for Cloud Run
6161
description = "Cloud function to get hourly edge requests from Fastly API and persist to a database"
6262

63+
labels = {
64+
arxiv-system = "reporting"
65+
arxiv-subsystem = "rep-stats"
66+
}
67+
6368
build_config {
6469
runtime = "python313"
6570
entry_point = "get_hourly_edge_requests"

‎terraform/monthly_downloads/main.tf‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ resource "google_cloudfunctions2_function" "function" {
5454
location = var.gcp_region # needs to be explicitly declared for Cloud Run
5555
description = "Cloud function to sum downloads and persist to a database"
5656

57+
labels = {
58+
arxiv-system = "reporting"
59+
arxiv-subsystem = "rep-stats"
60+
}
61+
5762
build_config {
5863
runtime = "python313"
5964
entry_point = "get_monthly_downloads"

‎terraform/monthly_submissions/main.tf‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ resource "google_cloudfunctions2_function" "function" {
6060
location = var.gcp_region # needs to be explicitly declared for Cloud Run
6161
description = "Cloud function to sum submissions and persist to a database"
6262

63+
labels = {
64+
arxiv-system = "reporting"
65+
arxiv-subsystem = "rep-stats"
66+
}
67+
6368
build_config {
6469
runtime = "python313"
6570
entry_point = "get_monthly_submissions"

‎terraform/stats_api/main.tf‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ resource "google_cloud_run_v2_service" "stats_api" {
6565
name = "stats-api"
6666
location = var.gcp_region
6767

68+
labels = {
69+
arxiv-system = "reporting"
70+
arxiv-subsystem = "rep-stats"
71+
}
72+
6873
template {
6974
service_account = google_service_account.account.email
7075
containers {

0 commit comments

Comments
 (0)