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 support for raw byte for http response body #704

Merged
merged 6 commits into from
Oct 16, 2023

Conversation

wiyu
Copy link
Contributor

@wiyu wiyu commented Oct 13, 2023

What does this PR do?

Add support to the blackhole to return a raw byte array/vector response. This is to support custom binary types which is used by the datadog process agent.

Testing

1. Baseline
Running the agent with the nothing response from lading shows the process agent logs errors due to the invalid/empty response

  - http:
      binding_addr: "127.0.0.1:9092"
      body_variant: "nothing"
2023-10-16 20:11:43 UTC | PROCESS | ERROR | (pkg/process/runner/runner.go:489 in readResponseStatuses) | [process] Could not decode response body: invalid message length: 0

1. Process Response RT Mode Disabled

  - http:
      binding_addr: "127.0.0.1:9092"
      body_variant: "raw_bytes"
      # process agent RT mode disabled response
      raw_bytes: [0x1, 0x0, 0x17, 0x0, 0xa, 0x2, 0x20, 0x17, 0x1a, 0x2, 0x10, 0xa]

The process agent logs show no errors from the response

2. Process Response RT Mode Enabled

- http:
  binding_addr: "127.0.0.1:9092"
  # process agent RT mode enabled response
  raw_bytes: [0x1, 0x0, 0x17, 0x0, 0xa, 0x2, 0x20, 0x17, 0x1a, 0x4, 0x8, 0x2, 0x10, 0x2]

The process agent logs show RT mode is enabled

2023-10-16 20:36:53 UTC | PROCESS | INFO | (pkg/process/runner/runner.go:229 in logCheckDuration) | Finished process check #2 in 20.911458ms
2023-10-16 20:36:53 UTC | PROCESS | INFO | (pkg/process/runner/runner.go:415 in UpdateRTStatus) | Detected 2 active clients, enabling real-time mode

Motivation

What inspired you to submit this pull request?

Related issues

A list of issues either fixed, containing architectural discussions, otherwise relevant
for this Pull Request.

Additional Notes

Anything else we should know when reviewing?

@wiyu wiyu force-pushed the william.yu/PROCS-3308-process-agent-response branch from 5405fa4 to ea59c4e Compare October 13, 2023 14:32
@wiyu wiyu marked this pull request as ready for review October 16, 2023 20:43
Copy link
Contributor

@GeorgeHahn GeorgeHahn left a comment

Choose a reason for hiding this comment

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

This looks great!

@wiyu wiyu merged commit f55b583 into main Oct 16, 2023
13 checks passed
@wiyu wiyu deleted the william.yu/PROCS-3308-process-agent-response branch October 16, 2023 20:57
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.

2 participants