Skip to content

STS QoS Part 2 changes - Extract stats to perform QoS from haproxy to syslog server - #41

Closed
rohit2219 wants to merge 0 commit into
bloomberg:mainfrom
rohit2219:hap-syslog-changes
Closed

STS QoS Part 2 changes - Extract stats to perform QoS from haproxy to syslog server #41
rohit2219 wants to merge 0 commit into
bloomberg:mainfrom
rohit2219:hap-syslog-changes

Conversation

@rohit2219

@rohit2219 rohit2219 commented Apr 10, 2026

Copy link
Copy Markdown

Description

This will extract the STS Token + verb and bandwidth usage(no active request yet) from haproxy till syslog server. It wont push the token or usage stats to redis yet. That will be another PR. Raising small PR's for easier review.

Please provide a meaningful description of what this change will do, or is for.

Bonus points for including links to related issues, other PRs, or technical
references.

Note that by not including a description, you are asking reviewers to do extra
work to understand the context of this change, which may lead to your PR taking
much longer to review, or result in it not being reviewed at all.

Type of Change

  • Bugfix
    ✅ New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

✅ I have read the contributing guidelines
✅ Existing issues have been referenced (where applicable)
✅ I have verified this change is not present in other open pull requests
✅ Functionality is documented
✅ New code contribution is covered by automated tests

@rohit2219
rohit2219 requested a review from a team as a code owner April 10, 2026 17:49
@rohit2219
rohit2219 marked this pull request as draft April 10, 2026 17:50

@jacquesh jacquesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we also please write up a decent explanation of how the dynamic key extraction works and fits into the rest of the system (in docs/ I mean)?

ntohs(addr_in->sin_port), LOG_DELIMITER, access_key, LOG_DELIMITER,
(data_direction == RL_DOWNLOAD ? "dwn" : "up"), LOG_DELIMITER, done);

if (sts_transaction_key) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need a separate STS-specific dataxfer message? This is new to me.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Let me think a bit more on this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Logic changed to align with existing code. Check now

Comment thread examples/dev_cfg/haproxy_localdev.conf Outdated
Comment thread haproxy-lua/added-files/src/flt_weir.c Outdated
Comment thread haproxy-lua/added-files/src/flt_weir.c Outdated
struct htx* htx = htxbuf(&msg->chn->buf);
struct http_hdr_ctx ctx = {.blk = NULL};

if (http_find_header(htx, ist("x-amz-security-token"), &ctx, 0) && (ctx.value.len > 0)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we agree that the lua for extracting these belongs in weir-s3.lua, then this cannot live here because it is not generic across APIs. My understanding from our previous conversation was that we were going to pass this in as a parameter via the config (which can then evaluate some lua code to extract the key).

@rohit2219 rohit2219 Apr 20, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thats what I missed . Let me try to fix these and get back . This is precisely what i intended to catch when I raised the PR

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed

Comment thread haproxy-lua/added-files/src/flt_weir.c Outdated
memcpy(token_copy, sts_token.ptr, (size_t)sts_token.len);
ha_free(&st->sts_token);
st->sts_token = token_copy;
send_log(NULL, LOG_INFO, "req_ststoken~|~%s:%d~|~%.*s~|~%s~|~%s~|~%s~|~%d~|~%s",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need a separate message instead of adding the sts token to the regular req log above? The existing parsing should support extra fields and if it doesn't....we should probably make it do that.

@rohit2219 rohit2219 Apr 20, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hmm interesting thought (Let me also think a bit more if thats possible).. My intention was to separate the STS token and the access key rate limiting logics completely as they are two different problems and need separate handling..

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

For that alone, I just decided to keep it that way . Either way, performance wise there is no difference. But i believe the logic is better separated this way and looks cleaner.

Comment thread haproxy-lua/src/weir-s3.lua Outdated
@rohit2219 rohit2219 changed the title Code to extract the syslog server from haproxy to syslog server STS QoS Part 2 changes - Extract Stats to do QoS from haproxy to syslog server Apr 24, 2026
@rohit2219
rohit2219 marked this pull request as ready for review April 26, 2026 03:09
@rohit2219
rohit2219 requested review from a team and jacquesh April 26, 2026 03:09
@rohit2219 rohit2219 changed the title STS QoS Part 2 changes - Extract Stats to do QoS from haproxy to syslog server STS QoS Part 2 changes - Extract stats to perform QoS from haproxy to syslog server Apr 26, 2026

@aokhovat aokhovat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@rohit2219 rohit2219 closed this Aug 7, 2026
@rohit2219
rohit2219 force-pushed the hap-syslog-changes branch from e7e8d52 to 3e8e0e7 Compare August 7, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants