Summary
Octavia Oslo notifications currently do not include the flavor_id attribute.
Why is this needed
Including flavor_id in Oslo notifications is necessary for accurate metric retrieval, such as in Gnocchi.
Steps to Reproduce
Deploy a load balancer using Octavia.
Trigger any event that sends an Oslo notification (e.g., creating, updating, or deleting a load balancer).
Inspect the content of the Oslo notification and observe that flavor_id is missing.
Expected Behavior
The flavor_id should be included in the Oslo notification context, allowing systems like Gnocchi to correctly retrieve and process metrics related to the load balancer's flavor.
Actual Behavior
The flavor_id is not present in the Oslo notification context, leading to potential issues in metric retrieval and processing.
Proposed Fix
Modify the RequestContext to include flavor_id in the notification_tasks.py file. Below is the proposed code change:
class BaseNotificationTask(task.Task):
event_type = None
Summary
Octavia Oslo notifications currently do not include the flavor_id attribute.
Why is this needed
Including flavor_id in Oslo notifications is necessary for accurate metric retrieval, such as in Gnocchi.
Steps to Reproduce
Deploy a load balancer using Octavia.
Trigger any event that sends an Oslo notification (e.g., creating, updating, or deleting a load balancer).
Inspect the content of the Oslo notification and observe that flavor_id is missing.
Expected Behavior
The flavor_id should be included in the Oslo notification context, allowing systems like Gnocchi to correctly retrieve and process metrics related to the load balancer's flavor.
Actual Behavior
The flavor_id is not present in the Oslo notification context, leading to potential issues in metric retrieval and processing.
Proposed Fix tasks.py file. Below is the proposed code change:
Modify the RequestContext to include flavor_id in the notification_
class BaseNotificatio nTask(task. Task):
event_type = None
def __init__(self, **kwargs):
super( ).__init_ _(**kwargs)
self._ rpc_notifier = rpc.get_notifier()
def execute(self, loadbalancer): RequestContext(
project_ id=loadbalancer [constants. PROJECT_ ID],
flavor_ id=loadbalancer [constants. FLAVOR_ ID]
LOG.debug( f"Sending rpc notification: {self.event_type} "
f"{ loadbalancer[ constants. LOADBALANCER_ ID]}")
self._ rpc_notifier. info(
self. event_type,
loadbalanc er
ctx = context.
)
ctx,
)
https:/ /github. com/openstack/ octavia/ blob/7376a4ad0c 305113a2aabc091 f1bb761a532b14d /octavia/ controller/ worker/ v2/tasks/ notification_ tasks.py# L32