Skip to content

Commit

Permalink
fix: downgrade protobuf to the minimum supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamir David authored and Tamir David committed Sep 10, 2024
1 parent d39a9c3 commit 60e68d9
Show file tree
Hide file tree
Showing 6 changed files with 559 additions and 205 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ ipython_config.py


# Virtual environment
venv/
*venv/
104 changes: 58 additions & 46 deletions opamp/anyvalue_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions opamp/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ def worker(self):
opamp_logger.error(f"Error fetching data: {e}")
self.condition.wait(30)

def send_heartbeat(self) -> opamp_pb2.ServerToAgent:
def send_heartbeat(self) -> opamp_pb2.ServerToAgent: # type: ignore
opamp_logger.debug("Sending heartbeat to OpAMP server...")
try:
agent_to_server = opamp_pb2.AgentToServer(remote_config_status=self.remote_config_status)
return self.send_agent_to_server_message(agent_to_server)
except requests_odigos.RequestException as e:
opamp_logger.error(f"Error sending heartbeat to OpAMP server: {e}")

def get_agent_description(self) -> opamp_pb2.AgentDescription:
def get_agent_description(self) -> opamp_pb2.AgentDescription: # type: ignore
identifying_attributes = [
anyvalue_pb2.KeyValue(
key=ResourceAttributes.SERVICE_INSTANCE_ID,
Expand All @@ -175,10 +175,10 @@ def get_agent_description(self) -> opamp_pb2.AgentDescription:
non_identifying_attributes=[]
)

def get_agent_disconnect(self) -> opamp_pb2.AgentDisconnect:
def get_agent_disconnect(self) -> opamp_pb2.AgentDisconnect: # type: ignore
return opamp_pb2.AgentDisconnect()

def get_agent_health(self, component_health: bool = None, last_error : str = None, status: str = None) -> opamp_pb2.ComponentHealth:
def get_agent_health(self, component_health: bool = None, last_error : str = None, status: str = None) -> opamp_pb2.ComponentHealth: # type: ignore
health = opamp_pb2.ComponentHealth(
)
if component_health is not None:
Expand All @@ -191,7 +191,7 @@ def get_agent_health(self, component_health: bool = None, last_error : str = Non
return health


def send_agent_to_server_message(self, message: opamp_pb2.AgentToServer) -> opamp_pb2.ServerToAgent:
def send_agent_to_server_message(self, message: opamp_pb2.AgentToServer) -> opamp_pb2.ServerToAgent: # type: ignore

message.instance_uid = self.instance_uid.encode('utf-8')
message.sequence_num = self.next_sequence_num
Expand Down Expand Up @@ -255,7 +255,7 @@ def shutdown(self, custom_failure_message: str = None):

self.send_agent_to_server_message(disconnect_message)

def update_remote_config_status(self, server_to_agent: opamp_pb2.ServerToAgent) -> bool:
def update_remote_config_status(self, server_to_agent: opamp_pb2.ServerToAgent) -> bool: # type: ignore
if server_to_agent.HasField("remote_config"):
remote_config_hash = server_to_agent.remote_config.config_hash
remote_config_status = opamp_pb2.RemoteConfigStatus(last_remote_config_hash=remote_config_hash)
Expand Down
Loading

0 comments on commit 60e68d9

Please sign in to comment.