tintri

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

README

tintri

OpenTelemetry Collector receiver for Tintri storage infrastructure (VMstore appliances and Tintri Global Center).

Status

Status
Stability alpha: metrics
Distributions []
Code Owners @integrationplumbers

Note: this receiver lives in its own repository (github.com/IntegrationPlumbers/tintri), not in opentelemetry-collector-contrib. The status table is hand-maintained rather than mdatagen-driven because mdatagen's generated badges hardcode the contrib monorepo URL.

Implements VMstore + TGC metric collection ported from the Python ip-tintri-otel-receiver. See docs/superpowers/plans/ for the porting plan and migration history.

What it collects

  • Datastore realtime + capacity + savings + replication + health
  • VM realtime stats + capacity + QoS
  • VDISK realtime stats (capacity optional)
  • TGC inventory used for attribute enrichment when configured

Out of scope: system-aggregated metrics, per-entity alert collection, tenants/applications/hypervisors (these are commented out in the Python source).

Building a Collector with this receiver

Install the OCB:

go install go.opentelemetry.io/collector/cmd/builder@latest

Build:

builder --config examples/builder-config.yaml
./bin/tintri-otelcol --config examples/config.yaml

Prerequisites

  • A Tintri VMstore (and, optionally, a Tintri Global Center) reachable over HTTPS.
  • Credentials for an account permitted to read the Tintri REST API on each endpoint.
  • The receiver targets Tintri REST API v310 by default; override per endpoint with api_version if your appliance differs.

Configuration

See examples/config.yaml for a complete example. At least one vmstores[] entry is required. The full list of emitted metrics and their attributes lives in documentation.md (generated from metadata.yaml).

Receiver level (from scraperhelper.ControllerConfig):

Field Default Description
collection_interval 60s How often each VMstore is scraped.
initial_delay 1s Delay before the first scrape.
timeout 0s Per-scrape timeout (0 = none).

tgc: (optional — enables inventory enrichment and TGC-served datastore stats):

Field Default Description
endpoint TGC base URL (required when tgc is set).
username / password TGC credentials; use ${env:VAR} for secrets.
api_version v310 Tintri REST API version.
refresh_interval 5m TGC inventory cache refresh cadence.
tls.*, timeout, … Standard confighttp.ClientConfig options.

vmstores[]: (at least one required):

Field Default Description
endpoint VMstore base URL (required).
username / password VMstore credentials; use ${env:VAR} for secrets.
api_version v310 Tintri REST API version.
collect_datastores true Collect datastore metrics.
collect_vms true Collect VM metrics.
collect_vdisks true Collect VDISK realtime metrics.
vdisk_capacity_collection false Also collect VDISK capacity — off by default because the /virtualDisk listing is the slowest part of a scrape.
tls.*, timeout, … Standard confighttp.ClientConfig options.

Other:

  • Per-metric enable/disable via the metrics: block at the receiver level (see documentation.md).
  • resource_attributes: is a free-form string passthrough applied to every resource. Map-valued entries (e.g. tintri.vmstore.id: {enabled: false}) instead toggle the typed resource attributes declared in metadata.yaml.
Migrating from earlier alpha versions

The 2026-05-28 contrib-conformance refactor changes config field locations (no graceful fallback — the receiver is alpha):

Removed Replacement
vmstores[*].collection_interval collection_interval (receiver top-level)
vmstores[*].timeout vmstores[*].timeout (from confighttp)
vmstores[*].insecure_skip_verify vmstores[*].tls.insecure_skip_verify
tgc.timeout tgc.timeout (from confighttp)
tgc.insecure_skip_verify tgc.tls.insecure_skip_verify
tgc.collection_interval tgc.refresh_interval

The metric tintri.datastore.health.status changed from an integer encoding to a constant-1 gauge with a health.status enum attribute (OK/WARN/CRITICAL/UNKNOWN). Dashboards reading the numeric value need to filter by attribute instead.

As of 2026-05-29, every tintri.vm.* metric carries two additional datapoint attributes — tintri.hypervisor.cluster and tintri.hypervisor.host — populated from TGC inventory (empty strings when TGC enrichment isn't configured, the same convention as tintri.vm.name). This raises per-VM series cardinality; queries that aggregate across VMs are unaffected, but exact series matchers may need updating.

Resource model

Each scraped VMstore is emitted as a single OpenTelemetry resource, identified by the tintri.vmstore.id resource attribute (the appliance hostname). Datastore, VM, and VDISK identity is carried as datapoint attributes (tintri.datastore.*, tintri.vm.*, tintri.vdisk.*) rather than as separate resources.

The receiver intentionally does not set the semantic-convention host.name resource attribute. tintri.vmstore.id is the stable, vendor-specific identity of the appliance, and a VMstore is a storage controller rather than a host running the collector, so mapping it onto host.name would risk colliding or incorrectly correlating with host-level telemetry (e.g. hostmetrics) from an unrelated machine. If you need that correlation in your backend, map tintri.vmstore.id to host.name explicitly (e.g. via a transform/resource processor) where the semantics are known to match.

Architecture

  • internal/client/ — session-authenticated REST clients for VMstore and TGC
  • internal/inventory/ — TGC inventory cache for attribute enrichment
  • internal/scraper/ — per-VMstore metric collection
  • factory.go — Collector component composition: the receiver factory, tintriReceiver lifecycle (Start/Shutdown), and per-VMstore scraper wiring
  • vmstore_scraper.go — adapts one VMstore into a scraperhelper scraper
  • receiver.go — shared URL/UUID helper utilities

Testing

go test ./...

Tests use an in-process HTTP mock at internal/mockserver/ that replays curated response bodies from internal/mockserver/responses/. Source captures live under testdata/api_captures/.

API endpoint ownership

GET /vmstore is TGC-only. The VMstore client never calls it. The /datastore/{uuid}/stats* endpoints take the VMstore UUID as the path parameter (not the datastore's own UUID) and are served by TGC when available — see the vmstoreScraper.start method in vmstore_scraper.go for the routing logic.

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

func NewFactory() receiver.Factory

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

func (c *Config) Unmarshal(conf *confmap.Conf) error

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.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks required fields across the receiver config.

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

func (c *TGCConfig) Unmarshal(conf *confmap.Conf) error

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.

func (*TGCConfig) Validate

func (c *TGCConfig) Validate() error

Validate returns an error if required TGC fields are missing.

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.

Jump to

Keyboard shortcuts

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