Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MetricKey is the FAS metric key for the CLI. MetricKey = "IDSGO.idsec_cli_golang.usage" // TagKeyCLIService is the FAS tag key for CLI service context. TagKeyCLIService = "cls" // TagKeyCLIOperation is the FAS tag key for CLI operation context. TagKeyCLIOperation = "clo" // TagKeyCLIVersion is the FAS tag key for CLI version. TagKeyCLIVersion = "clv" // TagKeyCLIResource is the FAS tag key for CLI resource path context. TagKeyCLIResource = "clr" )
Variables ¶
This section is empty.
Functions ¶
func ReportAsync ¶
func ReportAsync(ctx context.Context, idsecAPI *api.IdsecAPI, logger *sdkcommon.IdsecLogger, opts *ReportOptions)
ReportAsync sends a feature adoption report to FAS. Report failures are non-blocking and never affect command execution.
func ReportOperationDefer ¶
func ReportOperationDefer(ctx context.Context, idsecAPI *api.IdsecAPI, logger *sdkcommon.IdsecLogger, status *string, message *string, extraTags map[string]string) func()
ReportOperationDefer returns a function to be used with defer. It reports execution metrics when the calling function returns. extraTags are merged into the FAS report tags (e.g. cls, clo, clr, clv).
Types ¶
type ReportOptions ¶
type ReportOptions struct {
// OperationDuration is how long the operation took.
OperationDuration *time.Duration
// OperationStatus is the outcome of the operation ("success" or "failure").
OperationStatus string
// Message is the output status/details of the operation.
Message string
// ExtraTags adds optional report tags.
ExtraTags map[string]string
}
ReportOptions holds optional parameters for FAS reporting.
Click to show internal directories.
Click to hide internal directories.