coralogixexporter

package module
v0.156.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 45 Imported by: 4

README

Coralogix Exporter

Status
Stability alpha: profiles
beta: traces, metrics, logs
Distributions contrib
Warnings Authentication issues in v0.127.0
Issues Open issues Closed issues
Code coverage codecov
Code Owners @povilasv, @iblancasa, @douglascamata

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) Protocol to use for communication: "grpc" (default) or "http"
    protocol: "grpc"

    # (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) Configure the sending queue for batching capabilities
    sending_queue:
      sizer: bytes
      batch:
        min_size: 4194304
        max_size: 8388608

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

    # (Optional) Use AWS PrivateLink for private connectivity. When true, data is sent to
    # ingress.private.<domain>. See "Coralogix's Domain" section below for details.
    # private_link: true
Transport Protocol

The Coralogix exporter supports two transport protocols:

  • gRPC (default): Uses gRPC for efficient binary communication
  • HTTP: Uses HTTP with protobuf encoding, useful for proxy support or environments where gRPC is restricted

To use HTTP protocol:

exporters:
  coralogix:
    protocol: "http"
    domain: "coralogix.com"
Using HTTP Protocol with Proxy

When using HTTP protocol, you can configure proxy settings:

exporters:
  coralogix:
    protocol: "http"
    domain: "coralogix.com"
    private_key: "xxx"
    application_name: "MyApp"
    subsystem_name: "MySubsystem"
    domain_settings:
      proxy_url: "http://proxy.example.com:8080"
      timeout: 30s

Notes:

  • Proxy support (proxy_url) is only available when using the HTTP protocol. gRPC protocol does not support this setting.
  • Signal-specific settings (logs, traces, metrics) take precedence over domain_settings.
  • The profiles signal is not supported when using HTTP protocol. Use gRPC protocol (default) if you need to send profiles data.

### Compression

By default, the Coralogix exporter uses gzip compression. Alternatively, you can use zstd compression, for example:

```yaml
exporters:
  coralogix:
    domain_settings:
      compression: "zstd"
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 and, you might need to use a different domain. For an up-to-date list of domains, please refer to the official Coralogix's Domain documentation.

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. For an up-to-date list of AWS PrivateLink domains, please refer to Coralogix's official AWS PrivateLink documentation.

To automatically use the PrivateLink endpoint that corresponds to the configured domain, you can set the private_link configuration field to true. For example:

exporters:
  coralogix:
    domain: "eu2.coralogix.com"
    private_link: true
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 Resource Detection 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:
  resource_detection/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 Resource Detection processor can discover EC2 Resource attributes, such as EC2 tags as resource attributes.

Example:

processors:
 resource_detection/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]
Custom application and subsystem name

You can pass custom application and subsystem name via the following resource attributes:

  • cx.subsystem.name
  • cx.application.name For example:
receivers:
  file_log/nginx:
    include:
      - '/tmp/tmp.log'
    include_file_path: true
    include_file_name: false
    start_at: end
    resource: 
      cx.subsystem.name: nginx
  file_log/access-log:
    include:
      - '/tmp/access.log'
    include_file_path: true
    include_file_name: false
    resource: 
      cx.subsystem.name: access-log
exporters:
  coralogix:
    domain: 'coralogix.com'
    private_key: "XXX"
    application_name: 'app_name'
    timeout: 30s
service:
  pipelines:
    logs:
      receivers: [file_log/nginx, file_log/access-log]
      exporters: [coralogix]

Warnings

Authentication issues in v0.127.0

Version 0.127.0 introduced a regression in the Coralogix exporter. As a consequence, it requires an updated authentication configuration to ensure proper telemetry data transmission to Coralogix. If you're using this version, please modify your configuration to include the authentication headers as shown below:

coralogix:
  traces:
    headers:
      "Authorization": "Bearer ${env:CORALOGIX_PRIVATE_KEY}"
  metrics:
    headers:
      "Authorization": "Bearer ${env:CORALOGIX_PRIVATE_KEY}"
  logs:
    headers:
      "Authorization": "Bearer ${env:CORALOGIX_PRIVATE_KEY}"

This configuration ensures proper authentication with the Coralogix backend. Prior versions (v0.126.0 and earlier) and subsequent versions (v0.128.0 and later) are not affected by this authentication issue.

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

Overview

Copyright The OpenTelemetry Authors SPDX-License-Identifier: Apache-2.0

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 {
	QueueSettings             configoptional.Optional[exporterhelper.QueueBatchConfig] `mapstructure:"sending_queue"`
	configretry.BackOffConfig `mapstructure:"retry_on_failure"`
	TimeoutSettings           exporterhelper.TimeoutConfig `mapstructure:",squash"`

	// Protocol to use for communication. Options: "grpc" (default), "http"
	Protocol string `mapstructure:"protocol"`

	// Coralogix domain
	Domain string `mapstructure:"domain"`

	// Transport settings used with Domain (supports both gRPC and HTTP)
	DomainSettings TransportConfig `mapstructure:"domain_settings"`

	// PrivateLink, when enabled, automatically routes telemetry to the AWS PrivateLink ingress
	// endpoint (ingress.private.<domain>) for the configured domain. AWS PrivateLink provides
	// private connectivity between VPCs, supported AWS services, and on-premises networks
	// without exposing traffic to the public internet. If the domain already contains
	// "private.", no additional prefix is added. For up-to-date PrivateLink endpoints, see
	// https://coralogix.com/docs/integrations/aws/aws-privatelink/aws-privatelink/#privatelink-endpoints
	PrivateLink bool `mapstructure:"private_link"`

	// Coralogix traces ingress endpoint (supports both gRPC and HTTP)
	Traces TransportConfig `mapstructure:"traces"`

	// The Coralogix metrics ingress endpoint (supports both gRPC and HTTP)
	Metrics TransportConfig `mapstructure:"metrics"`

	// The Coralogix logs ingress endpoint (supports both gRPC and HTTP)
	Logs TransportConfig `mapstructure:"logs"`

	// The Coralogix profiles ingress endpoint (gRPC only)
	Profiles configgrpc.ClientConfig `mapstructure:"profiles"`

	// 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"`

	RateLimiter RateLimiterConfig `mapstructure:"rate_limiter"`
}

Config defines configuration for Coralogix exporter.

func (*Config) Unmarshal added in v0.142.0

func (c *Config) Unmarshal(conf *confmap.Conf) error

func (*Config) Validate

func (c *Config) Validate() error

type RateLimiterConfig added in v0.127.0

type RateLimiterConfig struct {
	Enabled   bool          `mapstructure:"enabled"`
	Threshold int           `mapstructure:"threshold"`
	Duration  time.Duration `mapstructure:"duration"`
}

type TransportConfig added in v0.138.0

type TransportConfig struct {
	// Embed the gRPC configuration to ensure backward compatibility
	configgrpc.ClientConfig `mapstructure:",squash"`

	// The following fields are only used when protocol is "http"
	ProxyURL string        `mapstructure:"proxy_url,omitempty"` // Used only if protocol is http
	Timeout  time.Duration `mapstructure:"timeout,omitempty"`   // Used only if protocol is http

	// AcceptEncoding specifies the compression encoding to accept for gRPC responses.
	// Defaults to "gzip" if not set. Only used when protocol is "grpc".
	AcceptEncoding string `mapstructure:"accept_encoding,omitempty"`
}

TransportConfig extends configgrpc.ClientConfig with additional HTTP-specific settings

func (*TransportConfig) GetAcceptEncoding added in v0.143.0

func (c *TransportConfig) GetAcceptEncoding() string

GetAcceptEncoding returns the accept encoding to use for gRPC responses.

func (*TransportConfig) ToHTTPClient added in v0.138.0

func (c *TransportConfig) ToHTTPClient(ctx context.Context, host component.Host, settings component.TelemetrySettings) (*http.Client, error)

Directories

Path Synopsis
internal
metadata
Package metadata contains the autogenerated telemetry and build information for the exporter/coralogix component.
Package metadata contains the autogenerated telemetry and build information for the exporter/coralogix component.

Jump to

Keyboard shortcuts

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