Skip to content
Get started

Stream instance logs (SSE)

client.Instances.Logs(ctx, id, query) (*string, error)
get/instances/{id}/logs

Streams instance logs as Server-Sent Events. Use the source parameter to select which log to stream:

  • app (default): Guest application logs (serial console)
  • vmm: Cloud Hypervisor VMM logs
  • hypeman: Hypeman operations log

Returns the last N lines (controlled by tail parameter), then optionally continues streaming new lines if follow=true.

ParametersExpand Collapse
id string
query InstanceLogsParams
Follow param.Field[bool]optional

Continue streaming new lines after initial output

Source param.Field[InstanceLogsParamsSource]optional

Log source to stream:

  • app: Guest application logs (serial console output)
  • vmm: Cloud Hypervisor VMM logs (hypervisor stdout+stderr)
  • hypeman: Hypeman operations log (actions taken on this instance)
const InstanceLogsParamsSourceApp InstanceLogsParamsSource = "app"
const InstanceLogsParamsSourceVmm InstanceLogsParamsSource = "vmm"
const InstanceLogsParamsSourceHypeman InstanceLogsParamsSource = "hypeman"
Tail param.Field[int64]optional

Number of lines to return from end

ReturnsExpand Collapse
type InstanceLogsResponse string
Stream instance logs (SSE)
package main

import (
  "context"
  "fmt"

  "github.com/onkernel/hypeman-go"
  "github.com/onkernel/hypeman-go/option"
)

func main() {
  client := hypeman.NewClient(
    option.WithAPIKey("My API Key"),
  )
  stream := client.Instances.LogsStreaming(
    context.TODO(),
    "id",
    hypeman.InstanceLogsParams{

    },
  )
  if stream.Err() != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
Returns Examples