Skip to content

Let Prometheus exporter plugin support utf8 characters#8228

Merged
DaanHoogland merged 2 commits into
apache:4.18from
shapeblue:8203-prometheus-plugin-support-utf8-characters
Nov 15, 2023
Merged

Let Prometheus exporter plugin support utf8 characters#8228
DaanHoogland merged 2 commits into
apache:4.18from
shapeblue:8203-prometheus-plugin-support-utf8-characters

Conversation

@DaanHoogland

@DaanHoogland DaanHoogland commented Nov 13, 2023

Copy link
Copy Markdown
Contributor

Description

This PR fixes a bug where the length of the httpresponse was set to the length of the contents before unicode conversion. Any non english character would break this.

Fixes: #8203

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • [x ] Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

in simulator,

  • the prometheus exporter was enabled
  • domains with names ééñ and 中文 were created
  • a curl done
cloudstack_domain_resource_count{domain="/", type="memory"} 0
cloudstack_domain_resource_count{domain="/", type="cpu"} 0
cloudstack_domain_resource_count{domain="/", type="primary_storage"} 0
cloudstack_domain_resource_count{domain="/", type="secondary_storage"} 4294967296
cloudstack_domain_resource_count{domain="/ééñ/", type="memory"} 0
cloudstack_domain_resource_count{domain="/ééñ/", type="cpu"} 0
cloudstack_domain_resource_count{domain="/ééñ/", type="primary_storage"} 0
cloudstack_domain_resource_count{domain="/ééñ/", type="secondary_storage"} 0
cloudstack_domain_resource_count{domain="/中文/", type="memory"} 0
cloudstack_domain_resource_count{domain="/中文/", type="cpu"} 0
cloudstack_domain_resource_count{domain="/中文/", type="primary_storage"} 0
cloudstack_domain_resource_count{domain="/中文/", type="secondary_storage"} 0

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@DaanHoogland DaanHoogland changed the title use length of bytearray after unicode conversion Let Prometheus exporter plugin support utf8 characters Nov 13, 2023

@weizhouapache weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

code lgtm

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7733

@codecov

codecov Bot commented Nov 13, 2023

Copy link
Copy Markdown

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (b79e393) 13.09% compared to head (cab7dd4) 13.09%.
Report is 1 commits behind head on 4.18.

Files Patch % Lines
...oudstack/metrics/PrometheusExporterServerImpl.java 0.00% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.18    #8228      +/-   ##
============================================
- Coverage     13.09%   13.09%   -0.01%     
  Complexity     9123     9123              
============================================
  Files          2720     2720              
  Lines        257627   257638      +11     
  Branches      40165    40168       +3     
============================================
  Hits          33746    33746              
- Misses       219616   219627      +11     
  Partials       4265     4265              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@harikrishna-patnala harikrishna-patnala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code LGTM

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

tested by reporter: #8203 (comment)

@DaanHoogland DaanHoogland linked an issue Nov 14, 2023 that may be closed by this pull request
@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7745

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan LLtest alma8 vmware-70u3

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [LL] Trillian-Jenkins test job (alma8 mgmt + vmware-70u3) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-8315)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 51855 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8228-t8315-kvm-centos7.zip
Smoke tests completed. 108 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_invalid_upgrade_kubernetes_cluster Failure 3615.48 test_kubernetes_clusters.py
test_02_upgrade_kubernetes_cluster Failure 3617.11 test_kubernetes_clusters.py
test_03_deploy_and_scale_kubernetes_cluster Failure 0.05 test_kubernetes_clusters.py
test_04_autoscale_kubernetes_cluster Failure 0.04 test_kubernetes_clusters.py
test_05_basic_lifecycle_kubernetes_cluster Failure 0.04 test_kubernetes_clusters.py
test_06_delete_kubernetes_cluster Failure 0.04 test_kubernetes_clusters.py
test_07_deploy_kubernetes_ha_cluster Failure 0.04 test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_cluster Failure 0.04 test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_cluster Failure 0.04 test_kubernetes_clusters.py
test_10_vpc_tier_kubernetes_cluster Failure 46.85 test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardown Error 96.02 test_kubernetes_clusters.py

@DaanHoogland DaanHoogland merged commit 1a2dbeb into apache:4.18 Nov 15, 2023
@DaanHoogland DaanHoogland deleted the 8203-prometheus-plugin-support-utf8-characters branch November 15, 2023 08:48
DaanHoogland added a commit that referenced this pull request Nov 18, 2023
* 4.18:
  Fixed spelling and added missing states to response (#8248)
  Let Prometheus exporter plugin support utf8 characters (#8228)
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Nov 29, 2023
* 4.18:
  Fixed spelling and added missing states to response (apache#8248)
  Let Prometheus exporter plugin support utf8 characters (apache#8228)
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prometheus Plugin not support chinese characters

4 participants