coralogixexporter

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: 27 Imported by: 4

README

Coralogix Exporter

Status
Stability beta: traces, metrics, logs
Distributions contrib
Issues Open issues Closed issues
Code Owners @povilasv, @matej-g

The Coralogix exporter sends traces, metrics and logs to Coralogix.

Please review the Collector's security documentation, which contains recommendations on securing sensitive information such as the API key required by this exporter.

Configuration

Example configuration:

exporters:
  coralogix:
    # The Coralogix domain
    domain: "coralogix.com"
    # Your Coralogix private key is sensitive
    private_key: "xxx"

    # (Optional) Ordered list of Resource attributes that are used for Coralogix
    # AppName and SubSystem values. The first non-empty Resource attribute is used.
    # Example: application_name_attributes: ["k8s.namespace.name", "service.namespace"]
    # Example: subsystem_name_attributes: ["k8s.deployment.name", "k8s.daemonset.name", "service.name"]
    application_name_attributes:
    - "service.namespace"
    subsystem_name_attributes:
    - "service.name"

    # Traces, Metrics and Logs emitted by this OpenTelemetry exporter 
    # are tagged in Coralogix with the default application and subsystem constants.
    application_name: "MyBusinessEnvironment"
    subsystem_name: "MyBusinessSystem"

    # (Optional) Timeout is the timeout for every attempt to send data to the backend.
    timeout: 30s
v0.76.0 Coralogix Domain

Since v0.76.0 you can specify Coralogix domain in the configuration file instead of specifying different endpoints for traces, metrics and logs. For example, the configuration below, can be replaced with domain field:

Old configuration:

exporters:
  coralogix:
    traces:
      endpoint: "ingress.coralogix.com:443"
    metrics:
      endpoint: "ingress.coralogix.com:443"
    logs:
      endpoint: "ingress.coralogix.com:443"

New configuration with domain field:

exporters:
  coralogix:
    domain: "coralogix.com"
Coralogix's Domain

Depending on your region, you might need to use a different domain. Here are the available domains:

Region Domain
USA1 coralogix.us
USA2 cx498.coralogix.com
APAC1 coralogix.in
APAC2 coralogixsg.com
EUROPE1 coralogix.com
EUROPE2 eu2.coralogix.com

Additionally, Coralogix supports AWS PrivateLink, which provides private connectivity between virtual private clouds (VPCs), supported AWS services, and your on-premises networks without exposing your traffic to the public internet.

Here are available AWS PrivateLink domains:

Region Domain
USA1 private.coralogix.com
USA2 ingress.private.cx498-aws-us-west-2.coralogix.com
APAC1 private.coralogix.in
APAC2 private.coralogixsg.com
EUROPE1 private.coralogix.com
EUROPE2 private.eu2.coralogix.com
Learn more about AWS PrivateLink in the documentation page.
Application and SubSystem attributes

v0.62.0 release of OpenTelemetry Collector allows you to map Application name and Subsystem name to Resource attributes. You need to set application_name_attributes and subsystem_name_attributes fields with a list of potential Resource attributes for the AppName and Subsystem values. The first not-empty Resource attribute is going to be used. If multiple resource attributes are available, the order of the attributes in the list determines their priority.

Kubernetes attributes

When using OpenTelemetry Collector with k8sattribute processor, you can use attributes coming from Kubernetes, such as k8s.namespace.name or k8s.deployment.name. The following example shows recommended list of attributes:

exporters:
  coralogix:
    domain: "coralogix.com"
    application_name_attributes:
      - "k8s.namespace.name" 
      - "service.namespace"
    subsystem_name_attributes:
      - "k8s.deployment.name"
      - "k8s.statefulset.name"
      - "k8s.daemonset.name"
      - "k8s.cronjob.name"
      - "service.name"
Host Attributes

OpenTelemetry Collector resourcedetection processor can discover Host Resource attributes, such as host.name and provide Resource attributes using environment variables, which can be used for setting AppName and SubSystem fields in Coralogix.

Example:

processors:
  resourcedetection/system:
    detectors: ["system", "env"]
    system:
      hostname_sources: ["os"]

And setting environment variable such as:

OTEL_RESOURCE_ATTRIBUTES="env=production"

You can configure Coralogix Exporter:

exporters:
  coralogix:
    domain: "coralogix.com"
    application_name_attributes:
      - "env" 
    subsystem_name_attributes:
      - "host.name"
EC2 Attributes

OpenTelemetry Collector resourcedetection processor can discover EC2 Resource attributes, such as EC2 tags as resource attributes.

Example:

processors:
 resourcedetection/ec2:
    detectors: ["ec2"]
    ec2:
      # A list of regex's to match tag keys to add as resource attributes can be specified
      tags:
        - ^ec2.tag.name$
        - ^ec2.tag.subsystem$

NOTE: In order to fetch EC2 tags, the IAM role assigned to the EC2 instance must have a policy that includes the ec2:DescribeTags permission.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": "ec2:DescribeTags",
            "Resource": "*"
        }
    ]
}

You can configure Coralogix Exporter:

exporters:
  coralogix:
    domain: "coralogix.com"
    application_name_attributes:
      - "ec2.tag.name" 
    subsystem_name_attributes:
      - "ec2.tag.subsystem"
Custom Attributes

You can combine and create custom Resource attributes using transform processor. For example:

    processors:
      transform:
        error_mode: ignore
        log_statements:
          - context: resource
            statements:
            - set(attributes["applicationName"], Concat(["development-environment", attributes["k8s.namespace.name"]], "-"))

Then you can use the custom Resource attribute in Coralogix exporter:

exporters:
  coralogix:
    domain: "coralogix.com"
    application_name_attributes:
      - "applicationName" 
    subsystem_name_attributes:
      - "host.name"
Exporting to multiple teams based on attributes

You can export the signals based on your business logic (attributes) to different Coralogix teams. To achieve this, you'll need to use the filter processor and setup one pipeline per team. You can setup your filter processors as following (example with metrics):

processors:  
  filter/teamA:
    metrics:
      datapoint:
          - 'attributes["your_label"] != "teamA"'
  filter/teamB:
    metrics:
      datapoint:
          - 'attributes["your_label"] != "teamB"'

This configuration ensures separate processor per each team. Any data points without an attribute for a particular team will be dropped from exporting.

Secondly, set up an individual exporter per each team:

exporters:
  coralogix/teamA:
    metrics:
      endpoint: "otel-metrics.coralogix.com:443"
    private_key: <private_key_for_teamA>
    application_name: "MyBusinessEnvironment"
    subsystem_name: "MyBusinessSystem"
  coralogix/teamB:
    metrics:
      endpoint: "otel-metrics.coralogix.com:443"
    private_key: <private_key_for_teamB>
    application_name: "MyBusinessEnvironment"
    subsystem_name: "MyBusinessSystem"

Finally, join each processor and exporter (and any other components you wish) in the pipelines. Here is an example with a Prometheus receiver:

service:
  pipelines:
    metrics/1:
      receivers: [prometheus]
      processors: [filter/teamA]
      exporters: [coralogix/teamA]
    metrics/2:
      receivers: [prometheus]
      processors: [filter/teamB]
      exporters: [coralogix/teamB]
Need help?

Our world-class customer success team is available 24/7 to walk you through the setup for this exporter and answer any questions that may come up. Feel free to reach out to us via our in-app chat or by sending us an email to support@coralogix.com.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() exporter.Factory

NewFactory by Coralogix

Types

type Config

type Config struct {
	exporterhelper.QueueSettings   `mapstructure:"sending_queue"`
	configretry.BackOffConfig      `mapstructure:"retry_on_failure"`
	exporterhelper.TimeoutSettings `mapstructure:",squash"`

	// Coralogix domain
	Domain string `mapstructure:"domain"`
	// GRPC Settings used with Domain
	DomainSettings configgrpc.ClientConfig `mapstructure:"domain_settings"`

	// Deprecated: [v0.60.0] Coralogix jaeger based trace endpoint
	// will be removed in the next version
	// Please use OTLP endpoint using traces.endpoint
	configgrpc.ClientConfig `mapstructure:",squash"`

	// Coralogix traces ingress endpoint
	Traces configgrpc.ClientConfig `mapstructure:"traces"`

	// The Coralogix metrics ingress endpoint
	Metrics configgrpc.ClientConfig `mapstructure:"metrics"`

	// The Coralogix logs ingress endpoint
	Logs configgrpc.ClientConfig `mapstructure:"logs"`

	// Your Coralogix private key (sensitive) for authentication
	PrivateKey configopaque.String `mapstructure:"private_key"`

	// Ordered list of Resource attributes that are used for Coralogix
	// AppName and SubSystem values. The first non-empty Resource attribute is used.
	// Example: AppNameAttributes: ["k8s.namespace.name", "service.namespace"]
	// Example: SubSystemAttributes: ["k8s.deployment.name", "k8s.daemonset.name", "service.name"]
	AppNameAttributes   []string `mapstructure:"application_name_attributes"`
	SubSystemAttributes []string `mapstructure:"subsystem_name_attributes"`
	// Default Coralogix application and subsystem name values.
	AppName   string `mapstructure:"application_name"`
	SubSystem string `mapstructure:"subsystem_name"`
}

Config defines by Coralogix.

func (*Config) Validate

func (c *Config) Validate() error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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