telemetry

package module
v0.0.0-...-c863867 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

README

telemetry

SUSE Telemetry Client Library and associated client CLI tools

See examples directory for examples of how to use the Telemetry Client library.

See the [doc][doc/] directory for details on the telemetry server REST API and the fundamental concepts of the telemetry service.

What's available

cmd/generator

A simple CLI tool that can be used to add telemetry data items to the local staging, optionally bundling them up into bundles, collecting them into reports, and submitting them to the telemetry server.

cmd/clientds

A simple CLI tool that can report status about the datastores used for the local staging of telemetry data items, bundles and reports.

pkg/client

The pkg/client module provides the following functionality:

  • Client Regsitration
  • Telemetry data item addition to local staging
  • Local staging of telemetry bundles, created from locally staged data items
  • Local staging of telemetry reports, created from locally staged bundles
  • Submission of locally staged reports to the Telemetry Server

pkg/config

The pkg/config module is used to parse client config files.

pkg/restapi

The pkg/restapi module provides definitions for the client requests and server reponses.

pkg/types

The pkg/types module defined useful common types

pkg/lib

The pkg/lib module provides functionality for managing the local staging of data items, bundles and reports.

Testing

Verification Testing

The verification tests can be run from within the telemetry repo as follows:

% cd telemetry
% make test

Local Developer Testing

First ensure that the SUSE/telemetry-server is running with the local server config file. Then run the cmd/generator tool from the telemetry tool as follows to generate telemetry data, including a DEVTEST tag, and submit telemetry to the server, self-registering as a client with the server if needed:

% cd telemetry/cmd/generator
% go run . --config ../../testdata/config/localClient.yaml \
      --telemetry=SLE-SERVER-SCCHwInfo --tag DEVTEST \
      ../../testdata/telemetry/SLE-SERVER-SCCHwInfo/sle12sp5-test.json

If you just want to generate but not submit, then you can include the --nosubmit option.

See Also

See the companion telemetry-server repo for a basic implementation of a telemetry server to handle the requests generated by the telemetry client tools.

Documentation

Index

Constants

View Source
const (
	MANDATORY_TELEMETRY = types.MANDATORY_TELEMETRY
	OPT_OUT_TELEMETRY   = types.OPT_OUT_TELEMETRY
	OPT_IN_TELEMETRY    = types.OPT_IN_TELEMETRY
)

Variables

This section is empty.

Functions

func Generate

func Generate(telemetry types.TelemetryType, class TelemetryClass, content []byte, tags types.Tags, flags GenerateFlags) (err error)

Types

type ClientStatus

type ClientStatus int64
const (
	CLIENT_UNINITIALIZED ClientStatus = iota
	CLIENT_CONFIG_ACCESSIBLE
	CLIENT_DISABLED
	CLIENT_MISCONFIGURED
	CLIENT_DATASTORE_ACCESSIBLE
	CLIENT_INSTANCE_ID_ACCESSIBLE
	CLIENT_REGISTERED
)

func Status

func Status() (status ClientStatus)

func (*ClientStatus) String

func (cs *ClientStatus) String() string

type GenerateFlags

type GenerateFlags uint64
const (
	GENERATE GenerateFlags = iota
	SUBMIT   GenerateFlags = 1 << (iota - 1)
)

func (GenerateFlags) FlagSet

func (gf GenerateFlags) FlagSet(flag GenerateFlags) bool

func (*GenerateFlags) String

func (gf *GenerateFlags) String() string

func (GenerateFlags) SubmitRequested

func (gf GenerateFlags) SubmitRequested() bool

type Tags

type Tags = types.Tags

type TelemetryClass

type TelemetryClass = types.TelemetryClass

type TelemetryType

type TelemetryType = types.TelemetryType

Directories

Path Synopsis
cmd
clientds Module
pkg
lib

Jump to

Keyboard shortcuts

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