instana

package module
v0.0.0-...-7df9de1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

README

Instana API Cribsheet

Requirements

  • Go 1.14+.
  • Make

Building

make

Execution

export INSTANA_URL={URL}
export INSTANA_TOKEN={TOKEN}

./infraq -query='entity.zone:k8s-demo' -plugin=host -metric=cpu.user -window=24h -to=2020-04-05
./infraq -query='entity.zone:k8s-demo' -plugin=kubernetesPod -metric=cpuRequests -window=24h -to=2020-04-05

Relevant API URLs

  • /api/infrastructure-monitoring/catalog/plugins - list plugins in the system.
  • /api/infrastructure-monitoring/catalog/search - list search fields.
  • /api/infrastructure-monitoring/catalog/metrics/{plugin} - list available metrics.

Metrics of Interest

Host
  • cpu.sys
  • cpu.user
  • cpu.wait
  • load.1m
  • memory.buffers
  • memory.cached
  • memory.free
  • memory.used

Namespace

  • alloc_pods_percentage
  • cap_limits_cpu
  • cap_pods
  • cap_limits_memory
  • cap_requests_cpu
  • cap_requests_memory
  • limit_cpu_percentage
  • limit_mem_percentage
  • required_cpu_percentage
  • required_mem_percentage
  • used_limits_cpu
  • used_limits_memory
  • used_pods
  • used_pods_percentage
  • used_requests_cpu
  • used_requests_memory

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDuration

func ParseDuration(s string) (int64, error)

ParseDuration parses a duration string and scales it to the value expected by the Instana API.

func Sum

func Sum(items []openapi.MetricItem, metric string) []float64

func ToInstanaTS

func ToInstanaTS(datetime string) (int64, error)

ToInstanaTS converts a datetime string to an instana Dynamic Focus Query timestamp.

func ToTabular

func ToTabular(hist PercentageHeatmap) [][]string

Types

type InfraQuery

type InfraQuery interface {
	ListMetrics(queryString string, pluginType string, metrics []string, rollup int64, windowSize int64, to int64) ([]openapi.MetricItem, error)
	ListSnapshots(queryString string, pluginType string, windowSize int64) ([]openapi.SnapshotItem, error)
}

InfraQuery is a common interface for infrastructure queries.

func NewClient

func NewClient(apiURL string, apiToken string) (InfraQuery, error)

NewClient builds an Instana API client from the specified URL and token.

type InfraQueryAPI

type InfraQueryAPI struct {
	// contains filtered or unexported fields
}

InfraQueryAPI is a concrete implementation fo the InfraQuery interface using the openapi client.

func (*InfraQueryAPI) ListMetrics

func (api *InfraQueryAPI) ListMetrics(queryString string, pluginType string, metrics []string, rollup int64, windowSize int64, to int64) ([]openapi.MetricItem, error)

ListMetrics returns the list of metrics matching the supplied query parameters.

func (*InfraQueryAPI) ListSnapshots

func (api *InfraQueryAPI) ListSnapshots(queryString string, pluginType string, windowSize int64) ([]openapi.SnapshotItem, error)

ListSnapshots returns the list of snapshots matching the supplied query parameters.

type PercentageHeatmap

type PercentageHeatmap map[string][percentBuckets]int

func ToPercentageHeatmap

func ToPercentageHeatmap(items []openapi.MetricItem, metric string) PercentageHeatmap

Directories

Path Synopsis
cmd
infraq command
webui command
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL