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

Add new fields to sg-core metric messages #111

Merged
merged 5 commits into from
Sep 21, 2023

Conversation

yadneshk
Copy link
Contributor

@yadneshk yadneshk commented May 2, 2023

With changes [1] Ceilometer is now able to include "project_name" and "user_name" fields into it's metrics. These fields are only added when ceilometer has tenant_name_discovery config enabled.

This change amends these fields to the outgoing metric messages.

Fixes: #110

[1] https://review.opendev.org/q/topic:enhanced_metrics-stable/wallaby

@yadneshk yadneshk force-pushed the include_tenant_names branch 4 times, most recently from eb1251f to 4c79806 Compare May 2, 2023 11:59
Copy link
Contributor

@csibbitt csibbitt left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@leifmadsen leifmadsen left a comment

Choose a reason for hiding this comment

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

+1

@yadneshk yadneshk changed the title Make room for project/user names in metric messages Add new fields to sg-core metric messages Aug 2, 2023
@yadneshk yadneshk force-pushed the include_tenant_names branch 6 times, most recently from d8e3c96 to bf1d57b Compare August 7, 2023 06:18
@yadneshk yadneshk force-pushed the include_tenant_names branch 3 times, most recently from ddf84f6 to 1235744 Compare August 11, 2023 11:03
With changes [1] Ceilometer is now able to include "project_name"
and "user_name" fields into it's metrics. These fields are only
added when ceilometer has `tenant_name_discovery` config enabled.

This change amends these fields to the outgoing metric messages.

Fixes: infrawatch#110

[1] https://review.opendev.org/q/topic:enhanced_metrics-stable/wallaby
Few Ceilometer meters like `cpu` & `network` have 2 name fields
in their metrics, `name` and `display_name`. Use delimiter ":"
to merge the values of both fields.

The `name` field provides extra information about the actual resource
related to the instance like `cirros:tap3a84e3fc-d9` in `network` meter
and `cirros:instance-00000001` in `cpu` meter.
@yadneshk yadneshk force-pushed the include_tenant_names branch from 1235744 to debce0a Compare August 29, 2023 10:59
@yadneshk
Copy link
Contributor Author

yadneshk commented Aug 29, 2023

With these 2 commits, fields project_name, user_name & resource_name are added to metrics.

Here are a few metrics from prometheus

ceilometer_cpu{container="sg-core", counter="cpu", cpu="d3fb814f-bf78-4133-9acc-3f3e38a221b3", endpoint="prom-https", 
project="9fca02c6653e41b09067a9ace53ab24b", project_name="admin", resource="d3fb814f-bf78-4133-9acc-
3f3e38a221b3",resource_name="cirros:instance-00000001", service="default-cloud1-ceil-meter", type="cpu",  
unit="ns",user="89bd630a63fb44a5a4dd084551315a56", user_name="admin", 
vm_instance="1338460c52b26353a527c75a2a1eae2f0342c683fa35ba35e63e7d08"}

ceilometer_network_incoming_bytes{container="sg-core", counter="network.incoming.bytes", endpoint="prom-https", 
network="bytes", project="9fca02c6653e41b09067a9ace53ab24b", project_name="admin", resource="instance-00000001-
d3fb814f-bf78-4133-9acc-3f3e38a221b3-tapeeb377c4-79", resource_name="cirros:tapeeb377c4-79", service="default-cloud1-
ceil-meter", type="incoming", unit="B", user="89bd630a63fb44a5a4dd084551315a56", user_name="admin", 
vm_instance="1338460c52b26353a527c75a2a1eae2f0342c683fa35ba35e63e7d08"}

ceilometer_disk_device_allocation{container="sg-core", counter="disk.device.allocation", disk="allocation", endpoint="prom-
https", project="9fca02c6653e41b09067a9ace53ab24b", project_name="admin", resource="d3fb814f-bf78-4133-9acc-
3f3e38a221b3-vda", resource_name="cirros:instance-00000001", service="default-cloud1-ceil-
meter", type="device", unit="B", user="89bd630a63fb44a5a4dd084551315a56", user_name="admin", vm_instance="1338460c
52b26353a527c75a2a1eae2f0342c683fa35ba35e63e7d08"}

@leifmadsen
Copy link
Member

Just FYI I don't believe the CI failure here has anything to do with the patch. I know Jaromir is looking into this, so hopefully we can get this merged sometime next week.

@leifmadsen
Copy link
Member

Updated branch with latest CI refactoring in the hopes we can get this merged.

@leifmadsen leifmadsen enabled auto-merge (squash) September 21, 2023 15:54
@leifmadsen leifmadsen merged commit 0a5d5bc into infrawatch:master Sep 21, 2023
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Include project_name and user_name fields to metric messages
4 participants