telemetry

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: Apache-2.0 Imports: 6 Imported by: 1

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

For a more detailed test run, including coverage details, the test-verbose target can be used:

% cd telemetry
% make test-verbose

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 ConfigPath

func ConfigPath() string

get the active config path

func DefaultConfigPath

func DefaultConfigPath() string

retrieve the default config path

func Generate

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

func GetTelemetryClientId

func GetTelemetryClientId() (clientId string, err error)

func GetTelemetryCustomerId

func GetTelemetryCustomerId() (clientId string, err error)

func Register added in v0.1.5

func Register() (err error)

func SetConfigPath

func SetConfigPath(path string)

set the active config path

func UpdateTelemetryClientId

func UpdateTelemetryClientId(clientId string) (err error)

func UpdateTelemetryCustomerId

func UpdateTelemetryCustomerId(customerId string) (err error)

Types

type ClientStatus

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

func Status

func Status() (status ClientStatus)

func (ClientStatus) Disabled added in v0.1.5

func (cs ClientStatus) Disabled() bool

func (ClientStatus) Ready added in v0.1.5

func (cs ClientStatus) Ready() bool

func (ClientStatus) RegistrationRequired added in v0.1.5

func (cs ClientStatus) RegistrationRequired() bool

func (*ClientStatus) String

func (cs *ClientStatus) String() string

type GenerateFlags

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

func (GenerateFlags) IsFlagSet

func (gf GenerateFlags) IsFlagSet(flag GenerateFlags) bool

func (*GenerateFlags) SetFlag added in v0.1.5

func (gf *GenerateFlags) SetFlag(flag GenerateFlags)

func (*GenerateFlags) SetSubmitRequested added in v0.1.5

func (gf *GenerateFlags) SetSubmitRequested()

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

Telemetry Class, Type and Tags

Directories

Path Synopsis
cmd
authenticator module
clientds module
generator module
examples
app module
pkg
lib

Jump to

Keyboard shortcuts

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