You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 5, 2025. It is now read-only.
The bundle_send metric is not incremented when using the API queue protocol in the send_stix2_bundle method of the OpenCTIConnectorHelper class. This leads to inaccurate metrics reporting, as the bundle_send_total counter remains at 0 even when bundles are successfully sent through the API protocol.
Environment
Cloud Instance
OpenCTI version: 6.7.3
Other environment details: - CONNECTOR_QUEUE_PROTOCOL=api # Use api to send bundle through HTTP query to the API, amqp (default) to send to rabbit
Reproducible Steps
Current Behavior
In the send_stix2_bundle method of opencti_connector_helper.py, there are two different code paths based on the queue protocol:
When using the AMQP protocol (self.queue_protocol == "amqp"), bundles are sent via the _send_bundle method, which correctly increments the bundle_send metric:
self.metric.inc("bundle_send")
When using the API protocol (self.queue_protocol == "api"), bundles are sent via the send_bundle_to_api method, but the metric is not incremented:
The bundle_send metric should be incremented regardless of the queue protocol used, ensuring consistent and accurate metrics reporting.
Proposed Fix
Add the metric increment after the API call in the API protocol branch:
elifself.queue_protocol=="api":
self.api.send_bundle_to_api(
connector_id=self.connector_id, bundle=bundle
)
self.metric.inc("bundle_send") # Add this line
Description
The
bundle_sendmetric is not incremented when using the API queue protocol in thesend_stix2_bundlemethod of theOpenCTIConnectorHelperclass. This leads to inaccurate metrics reporting, as thebundle_send_totalcounter remains at 0 even when bundles are successfully sent through the API protocol.Environment
Reproducible Steps
Current Behavior
In the
send_stix2_bundlemethod ofopencti_connector_helper.py, there are two different code paths based on the queue protocol:When using the AMQP protocol (
self.queue_protocol == "amqp"), bundles are sent via the_send_bundlemethod, which correctly increments thebundle_sendmetric:When using the API protocol (
self.queue_protocol == "api"), bundles are sent via thesend_bundle_to_apimethod, but the metric is not incremented:Expected behaviour
The
bundle_sendmetric should be incremented regardless of the queue protocol used, ensuring consistent and accurate metrics reporting.Proposed Fix
Add the metric increment after the API call in the API protocol branch:
Additional information
Affected Files
pycti/connector/opencti_connector_helper.py