Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ESClient *elasticsearch.Client
ESClient elasticsearch client instance
View Source
var OSClient *opensearch.Client
OSClient OpenSearch client instance
Functions ¶
This section is empty.
Types ¶
type Elastic ¶
type Elastic struct {
// contains filtered or unexported fields
}
Elastic ElasticSearch instance
type Indexer ¶
type Indexer interface { Index([]interface{}, IndexingOpts) (string, error) // contains filtered or unexported methods }
Indexer interface
func NewIndexer ¶
func NewIndexer(indexerConfig IndexerConfig) (*Indexer, error)
NewIndexer creates a new Indexer with the specified IndexerConfig
type IndexerConfig ¶
type IndexerConfig struct { // Type type of indexer Type IndexerType `yaml:"type"` // Servers List of ElasticSearch instances Servers []string `yaml:"esServers"` // Index index to send documents to server Index string `yaml:"defaultIndex"` // InsecureSkipVerify disable TLS ceriticate verification InsecureSkipVerify bool `yaml:"insecureSkipVerify"` // Directory to save metrics files in MetricsDirectory string `yaml:"metricsDirectory"` // Create tarball CreateTarball bool `yaml:"createTarball"` // TarBall name TarballName string `yaml:"tarballName"` }
IndexerConfig holds the indexer configuration
type IndexerType ¶
type IndexerType string
IndexerType type of indexer
const ( // Elastic indexer that sends metrics to the configured ES instance ElasticIndexer IndexerType = "elastic" // OpenSearch indexer that sends metrics to the configured Search Instance OpenSearchIndexer IndexerType = "opensearch" // Local indexer that writes metrics to local directory LocalIndexer IndexerType = "local" )
Types of indexers
type IndexingOpts ¶
type IndexingOpts struct {
MetricName string // MetricName, required for local indexer
}
Indexing options
type OpenSearch ¶
type OpenSearch struct {
// contains filtered or unexported fields
}
OpenSearch OpenSearch instance
func (*OpenSearch) Index ¶
func (OpenSearchIndexer *OpenSearch) Index(documents []interface{}, opts IndexingOpts) (string, error)
Index uses bulkIndexer to index the documents in the given index
Click to show internal directories.
Click to hide internal directories.