Skip to content

Add order to coder_agent's metadata fields #8487

Closed
@matifali

Description

@matifali

Currently, they are sorted alphanumerically.
So to get a desired order, one can name the key filed as,

metadata {
    display_name = "CPU Usage"
    key          = "0_cpu_usage"
    script       = "coder stat cpu"
    interval     = 10
    timeout      = 1
  }

  metadata {
    display_name = "RAM Usage"
    key          = "1_ram_usage"
    script       = "coder stat mem"
    interval     = 10
    timeout      = 1
  }
...

This will then follow the order. With the order field available, we can do so with

metadata {
    display_name = "CPU Usage"
    key          = "cpu_usage"
	order        = 1
    script       = "coder stat cpu"
    interval     = 10
    timeout      = 1
  }

  metadata {
    display_name = "RAM Usage"
    key          = "ram_usage"
    order        = 2
    script       = "coder stat mem"
    interval     = 10
    timeout      = 1
  }
...

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