Documentation
¶
Overview ¶
Package tintri is an OpenTelemetry Collector receiver for Tintri VMstore and Tintri Global Center storage telemetry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
NewFactory creates a factory for the Tintri receiver.
Types ¶
type Config ¶
type Config struct {
scraperhelper.ControllerConfig `mapstructure:",squash"`
metadata.MetricsBuilderConfig `mapstructure:",squash"`
TGC *TGCConfig `mapstructure:"tgc"`
VMstores []VMstoreConfig `mapstructure:"vmstores"`
// ResourceAttributes holds the free-form string passthrough attributes.
// It is populated manually by Unmarshal from the string-valued entries
// under `resource_attributes`; it must NOT auto-bind that key, or it
// would shadow the squashed MetricsBuilderConfig.ResourceAttributes and
// fail to decode map-valued (enable/disable) entries.
ResourceAttributes map[string]string `mapstructure:"-"`
}
Config is the top-level receiver configuration.
func (*Config) Unmarshal ¶
Unmarshal is a custom decoder that splits the `resource_attributes` YAML block between two consumers:
- Keys whose value is a string scalar are passthrough resource attributes — they land in Config.ResourceAttributes and are applied via ResourceBuilder.PutStr at scrape time.
- Keys whose value is a map (e.g., `tintri.vmstore.id: { enabled: true }`) are per-resource-attribute enable/disable settings consumed by the embedded metadata.MetricsBuilderConfig.
Without this split, mapstructure's strict decoding rejects a free-form passthrough like `tintri.site: datacenter-east` against the typed metadata.ResourceAttributesConfig schema.
type TGCConfig ¶
type TGCConfig struct {
confighttp.ClientConfig `mapstructure:",squash"`
Username string `mapstructure:"username"`
Password configopaque.String `mapstructure:"password"`
APIVersion string `mapstructure:"api_version"`
RefreshInterval time.Duration `mapstructure:"refresh_interval"`
}
TGCConfig holds Tintri Global Center connection settings.
func (*TGCConfig) Unmarshal ¶
Unmarshal seeds the TGC defaults before decoding so that values omitted from YAML (api_version, refresh_interval) receive their defaults instead of Go zero values. Without this, a tgc block without refresh_interval would produce RefreshInterval=0, which panics time.NewTicker at startup.
type VMstoreConfig ¶
type VMstoreConfig struct {
confighttp.ClientConfig `mapstructure:",squash"`
Username string `mapstructure:"username"`
Password configopaque.String `mapstructure:"password"`
APIVersion string `mapstructure:"api_version"`
CollectDatastores bool `mapstructure:"collect_datastores"`
CollectVMs bool `mapstructure:"collect_vms"`
CollectVDisks bool `mapstructure:"collect_vdisks"`
VDiskCapacityCollection bool `mapstructure:"vdisk_capacity_collection"`
}
VMstoreConfig holds settings for a single Tintri VMstore.
func (*VMstoreConfig) Unmarshal ¶
func (c *VMstoreConfig) Unmarshal(conf *confmap.Conf) error
Unmarshal seeds the per-VMstore defaults before decoding. confmap decodes slice elements with their Go zero values, so without this the collect_* flags would default to false (collecting nothing) and api_version to "". Defaulting here also gives each VMstore the standard confighttp client defaults. Explicitly-set fields in YAML override the seeded defaults.
func (*VMstoreConfig) Validate ¶
func (c *VMstoreConfig) Validate() error
Validate returns an error if required VMstore fields are missing.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
client
Package client is a minimal session-authenticated REST client for the Tintri VMstore and Tintri Global Center APIs.
|
Package client is a minimal session-authenticated REST client for the Tintri VMstore and Tintri Global Center APIs. |
|
inventory
Package inventory caches TGC topology (VMstores, datastores, VMs) and provides attribute enrichment + datastore-UUID resolution.
|
Package inventory caches TGC topology (VMstores, datastores, VMs) and provides attribute enrichment + datastore-UUID resolution. |
|
metadata
Package metadata contains the autogenerated telemetry and build information for the receiver/tintri component.
|
Package metadata contains the autogenerated telemetry and build information for the receiver/tintri component. |
|
mockserver
Package mockserver provides a test-only HTTP server that emulates the Tintri VMstore and Tintri Global Center REST APIs by replaying curated JSON response bodies.
|
Package mockserver provides a test-only HTTP server that emulates the Tintri VMstore and Tintri Global Center REST APIs by replaying curated JSON response bodies. |