logicmonitorexporter

package module
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 25 Imported by: 3

README

LogicMonitor Exporter

Status
Stability alpha: traces, logs
Distributions contrib
Issues Open issues Closed issues
Code Owners @bogdandrutu, @khyatigandhi6, @avadhut123pisal

This exporter supports sending traces & logs to Logicmonitor.

Configuration Options

The following configuration options are supported:

endpoint (required): The target base URL to send data to (e.g.: https://<company_name>.logicmonitor.com/rest). For logs, "/log/ingest" path will be appended by default.
api_token : API Token of Logicmonitor

Prerequisite

Below environment variable must be provided

Key Value
LOGICMONITOR_ACCOUNT Company name

NOTE: For ingesting data into the Logicmonitor, either its API Token or Bearer Token is required.

Example

Ingestion through API Token

Pass access_id and access_key through config.yaml as shown in example OR
Set the environment variables LOGICMONITOR_ACCESS_ID and LOGICMONITOR_ACCESS_KEY

  exporters:
    logicmonitor:
      endpoint: "https://<company_name>.logicmonitor.com/rest"
      api_token:
        access_id: "<access_id of logicmonitor>"
        access_key: "<access_key of logicmonitor>"
Ingestion through Bearer token

Pass bearer token as Authorization headers through config.yaml as shown in example OR Set the environment variable LOGICMONITOR_BEARER_TOKEN

  exporters:
    logicmonitor:
      endpoint: "https://<company_name>.logicmonitor.com/rest"
      headers:
        Authorization: Bearer <bearer token of logicmonitor>

Resource Mapping for Logs

As per the LogicMonitor's Log Ingestion documentation, if more than one resource property exists, only the first property will be mapped. In case of OTLP logs, there can be multiple resource attributes and its order also cannot be guaranteed.

Recently we have made the resource mapping for logs more flexible. With that, any of the resource attributes present in the log matches can be considered for resource mapping. But, this is not the default behaviour. In order to make the resource mapping flexible, you can configure the resource_mapping_op in the LogicMonitor's exporter.

  exporters:
    logicmonitor:
      endpoint: https://company.logicmonitor.com/rest
      headers:
        Authorization: Bearer <token>
      logs:
        resource_mapping_op: "OR"

The value for resource_mapping_op can be AND or OR. The values are case-insensitive.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() exporter.Factory

NewFactory creates a LogicMonitor exporter factory

Types

type APIToken

type APIToken struct {
	AccessID  string              `mapstructure:"access_id"`
	AccessKey configopaque.String `mapstructure:"access_key"`
}

type Config

type Config struct {
	confighttp.ClientConfig `mapstructure:",squash"`

	exporterhelper.QueueSettings `mapstructure:"sending_queue"`
	configretry.BackOffConfig    `mapstructure:"retry_on_failure"`
	ResourceToTelemetrySettings  resourcetotelemetry.Settings `mapstructure:"resource_to_telemetry_conversion"`

	// ApiToken of Logicmonitor Platform
	APIToken APIToken `mapstructure:"api_token"`
	// Logs defines the Logs exporter specific configuration
	Logs LogsConfig `mapstructure:"logs"`
}

Config defines configuration for LogicMonitor exporter.

func (*Config) Validate

func (c *Config) Validate() error

type LogsConfig added in v0.92.0

type LogsConfig struct {
	// Operation to be performed for resource mapping. Valid values are `and`, `or`.
	ResourceMappingOperation MappingOperation `mapstructure:"resource_mapping_op"`
}

LogsConfig defines the logs exporter specific configuration options

type MappingOperation added in v0.92.0

type MappingOperation string
const (
	And MappingOperation = "and"
	Or  MappingOperation = "or"
)

func (*MappingOperation) UnmarshalText added in v0.92.0

func (mop *MappingOperation) UnmarshalText(in []byte) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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