Skip to content

Segregate Data Receiver Traffic by Account

Segregate Data Receiver traffic per account by updating endpoint mappings and HAProxy rules.

5 min read Updated SS MR

Introduction#

In the HEAL environment, if there are multiple accounts, each mapped to a specific tenant, such as ROC, non-ROC & CBTO, all these are connected to the same Data Receiver infrastructure. This creates a dependency where an issue in one cluster can impact all accounts, even when they belong to different tenants or operate on separate clusters.

For example: In a specific environment where more than fourteen accounts are operating across multiple clusters and all KPI data is currently routed to a single, common Data Receiver. As a result, a failure or performance issue within one cluster interrupts data processing for all other accounts, regardless of their tenant or cluster assignment.

To prevent cross-cluster impact and ensure isolation, it is essential to segregate Data Receivers based on account-to-tenant mappings and cluster allocation. Segregating data receivers ensures that each account’s data is routed to the correct endpoint.

This document describes the steps required to:

  • Update HTTP endpoints in Percona (MySQL)
  • Update the corresponding HAProxy configuration

This guide assumes the HEAL infrastructure components (Percona and HAProxy) are already installed and running. For background on these components, see the Infrastructure Components and Percona Guide articles.

Prerequisites#

Ensure the following prerequisites are met:

  • Backup of the current haproxy.cfg file.
  • Component agents are configured to communicate via HTTP mode.
  • MySQL access with permissions to query and update the data_communication_details table.
  • SSH access to HAProxy servers with rights to edit haproxy.cfg.
  • Note the Account ID and target endpoint values (e.g., /raw-kpi-data-roc, /raw-kpi-data-cbto) for which updates are required.
  • Note the existing cluster-to-tenant mappings.

Updating HTTP Endpoints in Percona (MySQL)#

Follow the steps below to update HTTP endpoints in Percona (MySQL):

Retrieve Component Agent (CA) Mapping for an Account#

To retrieve the CA mapping for an account, follow the steps below:

  1. Log in to MySQL.
  2. Execute the following query to list all component agents mapped to the specified account, along with their data communication details.

    Note: Output is in read-only mode.

    SELECT
        aam.account_id,
        a.id AS agent_id,
        a.name AS agent_name,
        a.agent_type_id,
        ca.id AS component_agent_id,
        ca.data_communication_id,
        dcd.protocol_id,
        dcd.host,
        dcd.port,
        dcd.endpoint,
        dcd.forensic_endpoint,
        dcd.action_endpoint,
        dcd.status AS data_comm_status
    FROM
        agent_account_mapping aam
        JOIN agent a ON a.id = aam.agent_id
        JOIN component_agent ca ON ca.agent_id = a.id
        JOIN data_communication_details dcd ON dcd.id = ca.data_communication_id
    WHERE
        aam.account_id = <account_id>
        AND a.agent_type_id = 1;
    
    • Replace <account_id> with the respective value.
    • Update the endpoint in the data_communication_details table below:
    UPDATE data_communication_details dcd
    JOIN component_agent ca ON dcd.id = ca.data_communication_id
    JOIN agent a ON a.id = ca.agent_id
    JOIN agent_account_mapping aam ON aam.agent_id = a.id
    SET dcd.endpoint = '<endpoint>'
    WHERE
        aam.account_id = <account_id>
        AND a.agent_type_id = 1;
    
    • Replace <endpoint> with the required value.
    • Replace <account_id> with the respective value.

    For example:

    • /raw-kpi-data-roc
    • /raw-kpi-data-cbto
    • After updating, rerun the query in Step 2 to validate the changes.

    Important: Component Agents running on the target must communicate via HTTP mode.

Updating the HAProxy Configuration#

Follow the steps below to update the HAProxy Configuration:

  1. On the HAProxy server, navigate to the HAProxy configuration directory: /a1home/Appsone_Service/conf/HAPROXY
  2. Back up the haproxy.cfg file.
  3. Open the haproxy.cfg for editing.
  4. Search for the existing endpoint entry:

    /raw-kpi-data
    

    a. Add the below new ACL entries above the existing /raw-kpi-data parameter.

    acl url_dr_http7 path_beg -i /raw-kpi-data-roc
    acl url_dr_http8 path_beg -i /raw-kpi-data-cbto
    

    Note: The endpoint names must match exactly with the values updated in MySQL (data_communication_details).

    For example: If CA is mapped to 2 account IDs (account 2 uses /raw-kpi-data-roc and account 3 uses /raw-kpi-data-cbto), then the new entries should be added in the haproxy.cfg file as below:

    acl url_dr_http1 path_beg -i /raw-txn-data
    acl url_dr_http7 path_beg -i /raw-kpi-data-roc
    acl url_dr_http8 path_beg -i /raw-kpi-data-cbto
    acl url_dr_http2 path_beg -i /raw-kpi-data
    acl url_dr_http3 path_beg -i /raw-batch-job-data
    acl url_dr_http4 path_beg -i /ApmPtmTxnService
    acl url_dr_http5 path_beg -i /log-forwarder-txn-data
    acl url_dr_http6 path_beg -i /raw-agents-kpi-data
    acl download_url path_beg -i /downloads
    acl url_sc_cf path_beg -i /mle
    

    b. Add new use_backend configurations for the new endpoints as below. Then add these entries above the /raw-kpi-data parameter:

    use_backend data_receiver_http2_backend if url_dr_http7
    use_backend data_receiver_http3_backend if url_dr_http8
    

    For example: Here, the /raw-kpi-data parameters are url_dr_http2.

    use_backend data_receiver_http_backend if url_dr_http1
    use_backend data_receiver_http2_backend if url_dr_http7
    use_backend data_receiver_http3_backend if url_dr_http8
    use_backend data_receiver_http_backend if url_dr_http2
    use_backend data_receiver_http_backend if url_dr_http3
    use_backend data_receiver_http_backend if url_dr_http4
    use_backend data_receiver_http_backend if url_dr_http5
    use_backend data_receiver_http_backend if url_dr_http6
    default_backend data_receiver_grpc_backend
    
  5. Add an HTTP backend section for the data receiver. Each HTTP backend is mapped to a corresponding frontend; add the http-request set-path /raw-kpi-data directive to rewrite the incoming path to /raw-kpi-data.

    http-request set-path /raw-kpi-data
    

    For example:

    backend data_receiver_http2_backend
       balance roundrobin
       mode http
       stick-table type string len 32 size 5m expire 1m peers sticktables
       stick store-response res.cook(JSESSIONID)
       stick on req.cook(JSESSIONID)
       tcp-request content track-sc0 req.cook(JSESSIONID)
       option redispatch
       http-request set-path /raw-kpi-data
       server <backend-ip>_DATARECEIVER_1 <ip>:<http_port> check inter 3s rise 2 fall 3
    
  6. Repeat Step 5 for each additional endpoint, creating a matching backend section (for example, data_receiver_http3_backend for /raw-kpi-data-cbto) with the same http-request set-path /raw-kpi-data rewrite so every new backend forwards to the data receiver.

  7. Validate the updated configuration syntax before applying it:

    haproxy -c -f haproxy.cfg
    
  8. Save the updated haproxy.cfg file.

  9. Copy the updated file to the HAProxy Node 2 server to keep both nodes synchronized.
  10. Restart HAProxy to apply the changes.
  11. Restart the Component Agent (CA) in the target environment to download the latest agent-details.json for HTTP mode.

Next

  • HEAL Services — understand the platform services that consume the segregated data receiver endpoints.
  • Percona Guide — database layer that stores the endpoint mappings you updated here.
  • Infrastructure Components — where Percona and HAProxy fit in the HEAL deployment.