-
Notifications
You must be signed in to change notification settings - Fork 36
Add OpenTelemetry metrics for package resources size #1018
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
8659fa6
Feat: Add OpenTelemetry metrics for package resources size
JamesMcDermott ffd34db
Update docs to mention new package resources size metrics
JamesMcDermott 1f53d13
Address Copilot review comments
JamesMcDermott 65c4694
Address Copilot review comments part 2
JamesMcDermott 5257450
Address Copilot review comments part 3
JamesMcDermott ecf5fd2
comment nitpick to retrigger CI
JamesMcDermott 000bc75
Address Copilot review comments part 4
JamesMcDermott 024a221
Fix failing unit test
JamesMcDermott d1990e4
Address Copilot review comments part 5
JamesMcDermott 9f465a1
Nitpick to retrigger CI
JamesMcDermott 8a26059
Address Copilot review comments part 6
JamesMcDermott 42ec787
Introduce retrigger.txt for easier CI retriggering
JamesMcDermott 30cf8e5
Address copilot review comments part 7
JamesMcDermott b4a2bdf
Address Copilot review comments part 8
JamesMcDermott 5439633
Address Copilot review comments part 9
JamesMcDermott aa5ccea
retrigger
JamesMcDermott 9463c6d
Address Copilot review comments part 10
JamesMcDermott 2830a6a
retrigger
JamesMcDermott 82694c6
Address Copilot review comments part 11
JamesMcDermott b2535ae
Address review comment
JamesMcDermott cf910a7
Address Copilot review comments part 12
JamesMcDermott File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
deployments/metrics-resources/grafana-package-sizes-dashboard.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| { | ||
| "annotations": { "list": [] }, | ||
| "editable": true, | ||
| "fiscalYearStartMonth": 0, | ||
| "graphTooltip": 1, | ||
| "id": null, | ||
| "links": [], | ||
| "liveNow": false, | ||
| "panels": [ | ||
| { | ||
| "datasource": { "type": "prometheus", "uid": "prometheus" }, | ||
| "description": "Total file size, in bytes, of package revisions' resources", | ||
| "fieldConfig": { | ||
| "defaults": { | ||
| "color": { "mode": "palette-classic" }, | ||
| "custom": { "axisCenteredZero": false, "axisLabel": "", "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, | ||
| "unit": "decbytes" | ||
| }, | ||
| "overrides": [] | ||
| }, | ||
| "gridPos": { "h": 100, "w": 24, "x": 0, "y": 0 }, | ||
| "id": 101, | ||
| "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, | ||
| "targets": [ | ||
| { | ||
| "datasource": { "type": "prometheus", "uid": "prometheus" }, | ||
| "expr": "porch_package_size_bytes_total", | ||
| "legendFormat": "{{namespace}}/{{package}}/{{workspace_name}}", | ||
| "range": true, | ||
| "refId": "total-size-gauge" | ||
| } | ||
| ], | ||
| "title": "PR Resource Sizes", | ||
| "type": "timeseries" | ||
| } | ||
| ], | ||
| "refresh": "10s", | ||
| "schemaVersion": 38, | ||
| "style": "dark", | ||
| "tags": ["porch", "resources"], | ||
| "templating": { "list": [] }, | ||
| "time": { "from": "now-1h", "to": "now" }, | ||
| "timepicker": {}, | ||
| "timezone": "", | ||
| "title": "Porch File-system Resources", | ||
| "uid": "porch-package-resources", | ||
| "version": 1, | ||
| "weekStart": "" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Copyright 2026 The kpt Authors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| global: | ||
| scrape_native_histograms: true | ||
| scrape_interval: 10s | ||
| evaluation_interval: 10s | ||
| external_labels: | ||
| cluster: 'porch' | ||
|
|
||
| scrape_configs: | ||
| - job_name: 'porch-server' | ||
| scrape_native_histograms: true | ||
| scrape_interval: 10s | ||
| scrape_timeout: 10s | ||
| static_configs: | ||
| - targets: ['api.porch-system.svc.cluster.local:9464'] | ||
| labels: | ||
| service: 'porch' | ||
|
|
||
| - job_name: 'porch-controllers' | ||
| scrape_native_histograms: true | ||
| scrape_interval: 10s | ||
| scrape_timeout: 10s | ||
| static_configs: | ||
| - targets: ['porch-controllers.porch-system.svc.cluster.local:9464'] | ||
| labels: | ||
| service: 'porch' | ||
|
|
||
| - job_name: 'function-runner' | ||
| scrape_interval: 10s | ||
| scrape_timeout: 10s | ||
| static_configs: | ||
| - targets: ['function-runner.porch-system.svc.cluster.local:9464'] | ||
| labels: | ||
| service: 'function-runner' | ||
| component: 'grpc-server' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| # Copyright 2026 The kpt Authors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: grafana | ||
| namespace: porch-monitoring # kpt-set: ${namespace} | ||
| labels: | ||
| app: grafana | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: grafana | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: grafana | ||
| spec: | ||
| containers: | ||
| - name: grafana | ||
| image: docker.io/grafana/grafana:latest # kpt-set: ${grafana-image} | ||
| ports: | ||
| - containerPort: 3000 # kpt-set: ${grafana-container-port} | ||
| name: http | ||
| env: | ||
| - name: GF_SECURITY_ADMIN_USER | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: grafana-admin-creds | ||
| key: GF_SECURITY_ADMIN_USER | ||
| - name: GF_SECURITY_ADMIN_PASSWORD | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: grafana-admin-creds | ||
| key: GF_SECURITY_ADMIN_PASSWORD | ||
| - name: GF_USERS_ALLOW_SIGN_UP | ||
| value: "false" | ||
| - name: GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH | ||
| value: "/var/lib/grafana/dashboards/grafana-porch-server-dashboard.json" | ||
| - name: GF_DASHBOARDS_MIN_REFRESH_INTERVAL | ||
| value: "1s" | ||
| - name: GF_SERVER_ENABLE_GZIP | ||
| value: "true" | ||
| - name: GF_DATABASE_WAL | ||
| value: "true" | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /api/health | ||
| port: 3000 | ||
| initialDelaySeconds: 30 | ||
| periodSeconds: 10 | ||
| timeoutSeconds: 5 | ||
| failureThreshold: 6 | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /api/health | ||
| port: 3000 | ||
| initialDelaySeconds: 10 | ||
| periodSeconds: 10 | ||
| timeoutSeconds: 5 | ||
| failureThreshold: 3 | ||
| volumeMounts: | ||
| - name: grafana-storage | ||
| mountPath: /var/lib/grafana | ||
| - name: grafana-datasources | ||
| mountPath: /etc/grafana/provisioning/datasources | ||
| - name: grafana-dashboards-provider | ||
| mountPath: /etc/grafana/provisioning/dashboards | ||
| - name: grafana-dashboards | ||
| mountPath: /var/lib/grafana/dashboards | ||
| resources: | ||
| requests: | ||
| memory: "256Mi" | ||
| cpu: "250m" | ||
| limits: | ||
| memory: "1Gi" | ||
| cpu: "1" | ||
| volumes: | ||
| - name: grafana-storage | ||
| emptyDir: {} | ||
| - name: grafana-datasources | ||
| configMap: | ||
| name: grafana-datasources | ||
| - name: grafana-dashboards-provider | ||
| configMap: | ||
| name: grafana-dashboards-provider | ||
| - name: grafana-dashboards | ||
| configMap: | ||
| name: grafana-dashboards | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: grafana-dashboards-provider | ||
| namespace: porch-monitoring # kpt-set: ${namespace} | ||
| data: | ||
| dashboards.yaml: | | ||
| apiVersion: 1 | ||
| providers: | ||
| - name: 'default' | ||
| orgId: 1 | ||
| folder: '' | ||
| type: file | ||
| disableDeletion: false | ||
| updateIntervalSeconds: 10 | ||
| allowUiUpdates: true | ||
| options: | ||
| path: /var/lib/grafana/dashboards | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: grafana-datasources | ||
| namespace: porch-monitoring # kpt-set: ${namespace} | ||
| data: | ||
| prometheus.yaml: | | ||
| apiVersion: 1 | ||
| datasources: | ||
| - name: Prometheus | ||
| type: prometheus | ||
| access: proxy | ||
| uid: prometheus | ||
| url: http://prometheus:9090 | ||
| isDefault: true | ||
| editable: true | ||
| --- | ||
| apiVersion: v1 | ||
| data: | ||
| GF_SECURITY_ADMIN_USER: cG9yY2g= # kpt-set: ${grafana-user} | ||
| GF_SECURITY_ADMIN_PASSWORD: cG9yY2g= # kpt-set: ${grafana-pw} | ||
| kind: Secret | ||
| metadata: | ||
| name: grafana-admin-creds | ||
| namespace: porch-monitoring # kpt-set: ${namespace} | ||
| labels: | ||
| app: grafana | ||
| type: Opaque |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.