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

Consider adding a "status compressed/full" flag to AgentToServer #109

Closed
tigrannajaryan opened this issue Jul 13, 2022 · 7 comments
Closed
Labels
required-for-stable Required to be resolved before 1.0

Comments

@tigrannajaryan
Copy link
Member

The Server currently cannot tell if the status was compressed. As a consequence when it receives a message from an Agent it didn't see before it needs to ask for the full status. This unnecessary extra exchange when the Agent reports to the Server for the first time.
This can be avoided if we add a bit flag to indicate the that the status was compressed. If it is not (as is the case for newly starting Agents) the Server won't ask for full status.

@tigrannajaryan tigrannajaryan added the required-for-stable Required to be resolved before 1.0 label Jul 13, 2022
@tigrannajaryan tigrannajaryan changed the title Consider adding a "status compressed" flag to AgentToServer Consider adding a "status compressed/full" flag to AgentToServer Jul 15, 2022
tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this issue Jul 15, 2022
This is a draft PR to demonstrate how open-telemetry/opamp-spec#109
can be resolved.

The new StatusIsFullSet is set by the agent the status is fully set the message.
The server checks the flag to know if it needs to request the full status.

This is a backward compatible change. New servers that work with old agents may
make an extra request for the full status because old agents don't set this flag,
but this was already a problem in the past even before this change.
@tigrannajaryan
Copy link
Member Author

Here is a draft implementation with the new flag: open-telemetry/opamp-go#103

@andykellr
Copy link
Contributor

andykellr commented Jul 15, 2022

I am on vacation right now, but I thought that the AgentToServer message would be one of the following:

For each submessage, either

  1. The submessage is not nil because either
    a. It has changed since the last message
    b. The server requested the full state
  2. The submessage is nil and has been omitted because
    a. It has not changed (compressed)
    b. It is not supported by the agent as indicated by the AgentCapabilities flags

A message would be considered compressed if any submessage supported by the agent is nil. The message is full if no submessages supported by the agent are nil.

If an agent contacts the server and sends a compressed message (as determined above), the server adds the ServerToAgent_ReportFullState flag to receive the full status of the agent.

@tigrannajaryan
Copy link
Member Author

b. It is not supported by the agent as indicated by the AgentCapabilities flags

That's a good point. The problem is that we don't have all necessary capability flags to indicate this. There is none for AgentHealth and for RemoteConfigStatus. Perhaps that's what we are missing. If all compressible submessages have a corresponding capabilities flag then the fact of compression is possible to establish without this new flag I suggested.

Let me think a bit.

@andykellr
Copy link
Contributor

andykellr commented Jul 15, 2022

BindPlane OP does not currently support AgentHealth (coming soon!), but for RemoteConfigStatus I check AgentCapabilities_AcceptsRemoteConfig. I figured that if it accepts remote config then it should support reporting RemoteConfigStatus.

For AgentHeath we could add AgentCapabilities_ReportsAgentHealth.

tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this issue Jul 15, 2022
This is an alternate draft PR to demonstrate how open-telemetry/opamp-spec#109
can be resolved without adding a new "compressed/full" flag, suggested by @andykellr
@tigrannajaryan
Copy link
Member Author

@andykellr he is another draft PR that implements the approach you suggested: open-telemetry/opamp-go#105

It is a smaller change, but I am reluctant with this approach since it requires more checks to detect compression, which is a potential source of bug.

Thoughts?

@andykellr
Copy link
Contributor

I don't feel that strongly about it, but in general my instinct is to avoid a second piece of information that can already be derived from the information that exists. Typically this leads to ambiguity when the flag says it is complete (but it isn't) or the flag says it is not complete (but it is).

In this particular case, as long as we consider the flag authoritative, I don't see an issue. This means that if the flag says it is complete, ReportFullState should not report additional information and if the flag says it is incomplete, ReportFullState should report additional information. It does simplify reasoning about the message.

@tigrannajaryan
Copy link
Member Author

@andykellr I thought a bit more and I agree with you. Closing this in favour of #111 and open-telemetry/opamp-go#105

tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this issue Jul 22, 2022
We check the omitted and the corresponding capability bit to understand
if the compression was used.

Related to spec issue open-telemetry/opamp-spec#109
The issue was discarded in favour of the implementation that does not
change the spec, but instead uses already existing information.
tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this issue Jul 22, 2022
We check the omitted field and the corresponding capability bit to understand
if the compression was used.

Related to spec issue open-telemetry/opamp-spec#109
The issue was discarded in favour of the implementation that does not
change the spec, but instead uses already existing information.
tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this issue Jul 22, 2022
We check the omitted field and the corresponding capability bit to understand
if the compression was used.

Related to spec issue open-telemetry/opamp-spec#109
The issue was discarded in favour of the implementation that does not
change the spec, but instead uses already existing information.
tigrannajaryan added a commit to open-telemetry/opamp-go that referenced this issue Jul 28, 2022
We check the omitted field and the corresponding capability bit to understand
if the compression was used.

Related to spec issue open-telemetry/opamp-spec#109
The issue was discarded in favour of the implementation that does not
change the spec, but instead uses already existing information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
required-for-stable Required to be resolved before 1.0
Projects
None yet
Development

No branches or pull requests

2 participants