Documentation
¶
Overview ¶
Package opensearchexporter contains an opentelemetry-collector exporter for OpenSearch.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
NewFactory creates a factory for OpenSearch exporter.
Types ¶
type Config ¶
type Config struct {
confighttp.ClientConfig `mapstructure:"http"`
configretry.BackOffConfig `mapstructure:"retry_on_failure"`
TimeoutSettings exporterhelper.TimeoutConfig `mapstructure:",squash"`
MappingsSettings `mapstructure:"mapping"`
QueueConfig configoptional.Optional[exporterhelper.QueueBatchConfig] `mapstructure:"sending_queue"`
// The Observability indices would follow the recommended for immutable data stream ingestion pattern using
// the data_stream concepts. See https://opensearch.org/docs/latest/dashboards/im-dashboards/datastream/
// Index pattern will follow the next naming template ss4o_{type}-{dataset}-{namespace}
Dataset string `mapstructure:"dataset"`
Namespace string `mapstructure:"namespace"`
// LogsIndex configures the index, index alias, or data stream name logs should be indexed in.
// https://opensearch.org/docs/latest/im-plugin/index/
// https://opensearch.org/docs/latest/dashboards/im-dashboards/datastream/
LogsIndex string `mapstructure:"logs_index"`
LogsIndexFallback string `mapstructure:"logs_index_fallback"`
LogsIndexTimeFormat string `mapstructure:"logs_index_time_format"`
// TracesIndex configures the index, index alias, or data stream name traces should be indexed in.
// https://opensearch.org/docs/latest/im-plugin/index/
// https://opensearch.org/docs/latest/dashboards/im-dashboards/datastream/
TracesIndex string `mapstructure:"traces_index"`
TracesIndexFallback string `mapstructure:"traces_index_fallback"`
TracesIndexTimeFormat string `mapstructure:"traces_index_time_format"`
// BulkAction configures the action for ingesting data. Only `create` and `index` are allowed here.
// If not specified, the default value `create` will be used.
BulkAction string `mapstructure:"bulk_action"`
// Pipeline is the optional ID of an ingest pipeline to apply when indexing documents.
// https://opensearch.org/docs/latest/ingest-pipelines/
Pipeline string `mapstructure:"pipeline"`
}
Config defines configuration for OpenSearch exporter.
type MappingMode ¶
type MappingMode int
const ( MappingSS4O MappingMode = iota MappingECS MappingFlattenAttributes MappingBodyMap MappingOTelV1 )
Enum values for MappingMode.
func (MappingMode) String ¶
func (m MappingMode) String() string
type MappingsSettings ¶
type MappingsSettings struct {
// Mode configures the field mappings.
// Supported modes are the following:
//
// ss4o: exports logs in the Simple Schema for Observability standard.
// This mode is enabled by default.
// See: https://opensearch.org/docs/latest/observing-your-data/ss4o/
//
// ecs: maps fields defined in the OpenTelemetry Semantic Conventions
// to the Elastic Common Schema.
// See: https://www.elastic.co/guide/en/ecs/current/index.html
//
// flatten_attributes: uses the ECS mapping but flattens all resource and
// log attributes in the record to the top-level.
//
// bodymap: supports only logs and uses the "body" of a log record as the exact content
// of the OpenSearch document, without any transformation.
// This mapping mode is intended for use cases where the client wishes to have complete control over the
// OpenSearch document structure.
//
// otel-v1: exports logs and traces using the OTel v1 schema published by the
// OpenSearch Data Prepper project (https://github.com/opensearch-project/data-prepper).
// Documents are compatible with OpenSearch Observability dashboards that consume
// Data Prepper indices. See the upstream index templates for the canonical field mappings:
// https://github.com/opensearch-project/data-prepper/blob/main/data-prepper-plugins/opensearch/src/main/resources/index-template/otel-v1-apm-span-index-standard-template.json
// https://github.com/opensearch-project/data-prepper/blob/main/data-prepper-plugins/opensearch/src/main/resources/index-template/logs-otel-v1-index-standard-template.json
Mode string `mapstructure:"mode"`
// Additional field mappings.
Fields map[string]string `mapstructure:"fields"`
// File to read additional fields mappings from.
File string `mapstructure:"file"`
// Field to store timestamp in. If not set uses the default @timestamp
TimestampField string `mapstructure:"timestamp_field"`
// Whether to store timestamp in Epoch milliseconds
UnixTimestamp bool `mapstructure:"unix_timestamp"`
// Try to find and remove duplicate fields
Dedup bool `mapstructure:"dedup"`
Dedot bool `mapstructure:"dedot"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.