Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(msd): adding label for api boundary nodes #483

Merged
merged 4 commits into from
Jun 17, 2024

Conversation

NikolaMilosa
Copy link
Contributor

@NikolaMilosa NikolaMilosa commented Jun 14, 2024

This PR adds a new label to the /prom/targets endpoint that is being used from victoria metrics to scrape targets.
The new labels only affect api boundary nodes. Other targets won't get the new label.
Output looks like:

...
  // Standard nodes
  
  {
    "targets": [
      "https://[2401:3f00:1000:23:6801:b3ff:fe4d:4fc7]:9091/"
    ],
    "labels": {
      "ic": "mercury",
      "ic_node": "kqurf-2p6ca-j4zte-3wkx5-rovid-kgn7s-yih6m-mj74k-claji-7uoje-vae",
      "job": "orchestrator"
    }
  },
  {
    "targets": [
      "https://[2401:3f00:1000:23:6801:b3ff:fe4d:4fc7]:9100/metrics"
    ],
    "labels": {
      "ic": "mercury",
      "ic_node": "kqurf-2p6ca-j4zte-3wkx5-rovid-kgn7s-yih6m-mj74k-claji-7uoje-vae",
      "job": "node_exporter"
    }
  },
  {
    "targets": [
      "https://[2401:3f00:1000:23:6800:b3ff:fe4d:4fc7]:9100/metrics"
    ],
    "labels": {
      "ic": "mercury",
      "ic_node": "kqurf-2p6ca-j4zte-3wkx5-rovid-kgn7s-yih6m-mj74k-claji-7uoje-vae",
      "job": "host_node_exporter"
    }
  },
  {
    "targets": [
      "https://[2401:3f00:1000:23:6800:b3ff:fe4d:4fc7]:19100/metrics"
    ],
    "labels": {
      "ic": "mercury",
      "ic_node": "kqurf-2p6ca-j4zte-3wkx5-rovid-kgn7s-yih6m-mj74k-claji-7uoje-vae",
      "job": "host_metrics_proxy"
    }
  },
  {
    "targets": [
      "https://[2401:3f00:1000:23:6801:b3ff:fe4d:4fc7]:19100/metrics"
    ],
    "labels": {
      "ic": "mercury",
      "ic_node": "kqurf-2p6ca-j4zte-3wkx5-rovid-kgn7s-yih6m-mj74k-claji-7uoje-vae",
      "job": "guest_metrics_proxy"
    }
  },
...
  // API boundary node 
  {
    "targets": [
      "https://[2001:438:8000:1d:6801:c1ff:feac:bc9]:9091/"
    ],
    "labels": {
      "api_boundary_node": "1",
      "ic": "mercury",
      "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
      "job": "orchestrator"
    }
  },
  {
    "targets": [
      "https://[2001:438:8000:1d:6801:c1ff:feac:bc9]:9100/metrics"
    ],
    "labels": {
      "api_boundary_node": "1",
      "ic": "mercury",
      "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
      "job": "node_exporter"
    }
  },
  {
    "targets": [
      "https://[2001:438:8000:1d:6800:c1ff:feac:bc9]:9100/metrics"
    ],
    "labels": {
      "api_boundary_node": "1",
      "ic": "mercury",
      "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
      "job": "host_node_exporter"
    }
  },
  {
    "targets": [
      "https://[2001:438:8000:1d:6801:c1ff:feac:bc9]:9324/metrics"
    ],
    "labels": {
      "api_boundary_node": "1",
      "ic": "mercury",
      "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
      "job": "ic_boundary"
    }
  }
...

Includes small fix for CI for missing custom runner image.

@NikolaMilosa NikolaMilosa requested a review from a team as a code owner June 14, 2024 12:05
Copy link
Contributor

MSD Diff

  • targets.json

targets.json

--- a/home/runner/main-targets/targets.json
+++ b/home/runner/branch-targets/targets.json
@@ -80148,6 +80148,7 @@
       "https://[2001:920:401a:1710:6801:94ff:fe18:6b54]:9091/"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "ag4ro-4ihpg-ozp6d-lbwac-5pksl-3wany-aaayw-ibvuw-uh7wj-lbav5-qae",
       "job": "orchestrator"
@@ -80158,6 +80159,7 @@
       "https://[2001:920:401a:1710:6801:94ff:fe18:6b54]:9100/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "ag4ro-4ihpg-ozp6d-lbwac-5pksl-3wany-aaayw-ibvuw-uh7wj-lbav5-qae",
       "job": "node_exporter"
@@ -80168,6 +80170,7 @@
       "https://[2001:920:401a:1710:6800:94ff:fe18:6b54]:9100/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "ag4ro-4ihpg-ozp6d-lbwac-5pksl-3wany-aaayw-ibvuw-uh7wj-lbav5-qae",
       "job": "host_node_exporter"
@@ -80178,6 +80181,7 @@
       "https://[2001:920:401a:1710:6801:94ff:fe18:6b54]:9324/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "ag4ro-4ihpg-ozp6d-lbwac-5pksl-3wany-aaayw-ibvuw-uh7wj-lbav5-qae",
       "job": "ic_boundary"
@@ -80188,6 +80192,7 @@
       "https://[2001:438:8000:1d:6801:c1ff:feac:bc9]:9091/"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
       "job": "orchestrator"
@@ -80198,6 +80203,7 @@
       "https://[2001:438:8000:1d:6801:c1ff:feac:bc9]:9100/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
       "job": "node_exporter"
@@ -80208,6 +80214,7 @@
       "https://[2001:438:8000:1d:6800:c1ff:feac:bc9]:9100/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
       "job": "host_node_exporter"
@@ -80218,6 +80225,7 @@
       "https://[2001:438:8000:1d:6801:c1ff:feac:bc9]:9324/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
       "job": "ic_boundary"

See the workflow run

@r-birkner
Copy link
Contributor

Thanks 🙏

Copy link
Contributor

MSD Diff

  • targets.json

targets.json

--- a/home/runner/main-targets/targets.json
+++ b/home/runner/branch-targets/targets.json
@@ -80098,6 +80098,7 @@
       "https://[2001:920:401a:1710:6801:94ff:fe18:6b54]:9091/"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "ag4ro-4ihpg-ozp6d-lbwac-5pksl-3wany-aaayw-ibvuw-uh7wj-lbav5-qae",
       "job": "orchestrator"
@@ -80108,6 +80109,7 @@
       "https://[2001:920:401a:1710:6801:94ff:fe18:6b54]:9100/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "ag4ro-4ihpg-ozp6d-lbwac-5pksl-3wany-aaayw-ibvuw-uh7wj-lbav5-qae",
       "job": "node_exporter"
@@ -80118,6 +80120,7 @@
       "https://[2001:920:401a:1710:6800:94ff:fe18:6b54]:9100/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "ag4ro-4ihpg-ozp6d-lbwac-5pksl-3wany-aaayw-ibvuw-uh7wj-lbav5-qae",
       "job": "host_node_exporter"
@@ -80128,6 +80131,7 @@
       "https://[2001:920:401a:1710:6801:94ff:fe18:6b54]:9324/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "ag4ro-4ihpg-ozp6d-lbwac-5pksl-3wany-aaayw-ibvuw-uh7wj-lbav5-qae",
       "job": "ic_boundary"
@@ -80138,6 +80142,7 @@
       "https://[2001:438:8000:1d:6801:c1ff:feac:bc9]:9091/"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
       "job": "orchestrator"
@@ -80148,6 +80153,7 @@
       "https://[2001:438:8000:1d:6801:c1ff:feac:bc9]:9100/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
       "job": "node_exporter"
@@ -80158,6 +80164,7 @@
       "https://[2001:438:8000:1d:6800:c1ff:feac:bc9]:9100/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
       "job": "host_node_exporter"
@@ -80168,6 +80175,7 @@
       "https://[2001:438:8000:1d:6801:c1ff:feac:bc9]:9324/metrics"
     ],
     "labels": {
+      "api_boundary_node": "1",
       "ic": "mercury",
       "ic_node": "5dpkp-lfhr2-j7mfz-gavpn-puej5-wdfzg-fw42o-zupnu-izvk3-ubzzi-6ae",
       "job": "ic_boundary"

See the workflow run

Copy link
Member

@sasa-tomic sasa-tomic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NikolaMilosa NikolaMilosa merged commit 9706b01 into main Jun 17, 2024
5 checks passed
@NikolaMilosa NikolaMilosa deleted the nm-adding-label-to-metrics branch June 17, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants