Skip to content

Use google.protobuf.Duration for VM uptime in metald/v1/vm.proto #3910

@coderabbitai

Description

@coderabbitai

Description

In the VM proto definition, the uptime field currently uses int64 uptime_seconds which should be replaced with google.protobuf.Duration uptime for better type safety and consistency with protobuf best practices.

Current Implementation

message VmMetrics {
  // VM uptime in seconds
  int64 uptime_seconds = 5;
}

Proposed Change

import "google/protobuf/duration.proto";

message VmMetrics {
  // VM uptime
  google.protobuf.Duration uptime = 5;
}

Benefits

  • Better type safety
  • Consistent with protobuf best practices
  • More semantic representation of time duration
  • Field number remains the same (5) to maintain wire compatibility

Context

File Location

go/proto/metald/v1/vm.proto lines 141-156

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions