alibabacloudlogserviceexporter

package module
v0.83.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 27 Imported by: 4

README

AlibabaCloud LogService Exporter

Status
Stability beta: traces, metrics, logs
Distributions contrib, observiq
Issues Open issues Closed issues
Code Owners @shabicheng, @kongluoxing, @qiansheng91

This exporter supports sending OpenTelemetry data to LogService.

Configuration options:

  • endpoint (required): LogService's Endpoint.
  • project (required): LogService's Project Name.
  • logstore (required): LogService's store Name. For metrics data, you should use metric store.
  • access_key_id (optional): AlibabaCloud access key id.
  • access_key_secret (optional): AlibabaCloud access key secret.
  • ecs_ram_role (optional): set AlibabaCLoud ECS ram role if you are using ACK.
  • token_file_path (optional): Set token file path if you are using ACK.

Example:

Simple Trace Data

receivers:
  examplereceiver:

exporters:
  alibabacloud_logservice:
    endpoint: "cn-hangzhou.log.aliyuncs.com"
    project: "demo-project"
    logstore: "traces-store"
    access_key_id: "access-key-id"
    access_key_secret: "access-key-secret"

service:
  pipelines:
    traces:
      receivers: [examplereceiver]
      exporters: [alibabacloud_logservice]

All Telemetry Data

If you are using OpenTelemetry Collector to collect different types of telemetry data, you should send to different LogService's store.

receivers:
  examplereceiver:

exporters:
  alibabacloud_logservice/logs:
    endpoint: "cn-hangzhou.log.aliyuncs.com"
    project: "demo-project"
    logstore: "logs-store"
    access_key_id: "access-key-id"
    access_key_secret: "access-key-secret"
  alibabacloud_logservice/metrics:
    endpoint: "cn-hangzhou.log.aliyuncs.com"
    project: "demo-project"
    logstore: "metrics-store"
    access_key_id: "access-key-id"
    access_key_secret: "access-key-secret"
  alibabacloud_logservice/traces:
    endpoint: "cn-hangzhou.log.aliyuncs.com"
    project: "demo-project"
    logstore: "traces-store"
    access_key_id: "access-key-id"
    access_key_secret: "access-key-secret"

service:
  pipelines:
    traces:
      receivers: [examplereceiver]
      exporters: [alibabacloud_logservice/traces]
    logs:
      receivers: [examplereceiver]
      exporters: [alibabacloud_logservice/logs]
    metrics:
      receivers: [examplereceiver]
      exporters: [alibabacloud_logservice/metrics]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory added in v0.9.0

func NewFactory() exporter.Factory

NewFactory creates a factory for AlibabaCloud LogService exporter.

Types

type Config

type Config struct {
	// LogService's Endpoint, https://www.alibabacloud.com/help/doc-detail/29008.htm
	// for AlibabaCloud Kubernetes(or ECS), set {region-id}-intranet.log.aliyuncs.com, eg cn-hangzhou-intranet.log.aliyuncs.com;
	//  others set {region-id}.log.aliyuncs.com, eg cn-hangzhou.log.aliyuncs.com
	Endpoint string `mapstructure:"endpoint"`
	// LogService's Project Name
	Project string `mapstructure:"project"`
	// LogService's Logstore Name
	Logstore string `mapstructure:"logstore"`
	// AlibabaCloud access key id
	AccessKeyID string `mapstructure:"access_key_id"`
	// AlibabaCloud access key secret
	AccessKeySecret configopaque.String `mapstructure:"access_key_secret"`
	// Set AlibabaCLoud ECS ram role if you are using ACK
	ECSRamRole string `mapstructure:"ecs_ram_role"`
	// Set Token File Path if you are using ACK
	TokenFilePath string `mapstructure:"token_file_path"`
}

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

type KeyValues

type KeyValues struct {
	// contains filtered or unexported fields
}

func (*KeyValues) Append

func (kv *KeyValues) Append(key, value string)

func (*KeyValues) Clone

func (kv *KeyValues) Clone() KeyValues

func (*KeyValues) Len

func (kv *KeyValues) Len() int

func (*KeyValues) Less

func (kv *KeyValues) Less(i, j int) bool

func (*KeyValues) Replace

func (kv *KeyValues) Replace(key, value string)

func (*KeyValues) Sort

func (kv *KeyValues) Sort()

func (*KeyValues) String

func (kv *KeyValues) String() string

func (*KeyValues) Swap

func (kv *KeyValues) Swap(i, j int)

type LogServiceClient

type LogServiceClient interface {
	// SendLogs send message to LogService
	SendLogs(logs []*sls.Log) error
}

LogServiceClient log Service's client wrapper

func NewLogServiceClient

func NewLogServiceClient(config *Config, logger *zap.Logger) (LogServiceClient, error)

NewLogServiceClient Create Log Service client

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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