otlc

package module
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: MIT Imports: 0 Imported by: 0

README

otlc

"otlc" is a command line tool that allows you to easily post metrics by OTLP. It acts as a simple exporter and helps you testing for the OTLP endpoint.

Install

Currently we support macOS and Linux. You may be able to run otlc on Windows by using docker or go install.

Homebrew
brew install Arthur1/tap/otlc
Docker
go install
go install github.com/Arthur1/otlc/cmd/otlc@latest

Run

post metrics
$ export OTEL_EXPORTER_OTLP_ENDPOINT="otlp.mackerelio.com:4317"
$ export OTEL_EXPORTER_OTLP_HEADERS="Mackerel-Api-Key=***your_api_key***"
$ otlc metrics post --name awesome_gauge --attrs hoge=poyo,fuga=1 123.45
exported.
Usage: otlc metrics post --otlp-endpoint=STRING --name=STRING <data-point-value> [flags]

post a metric datapoint

Arguments:
  <data-point-value>    datapoint value

Flags:
  -h, --help                             Show context-sensitive help.
  -v, --version                          print version and quit

      --otlp-endpoint=STRING             OTLP endpoint ($OTEL_EXPORTER_OTLP_ENDPOINT,
                                         $OTEL_EXPORTER_OTLP_METRICS_ENDPOINT)
      --otlp-headers=KEY=VALUE,...       OTLP headers ($OTEL_EXPORTER_OTLP_HEADERS,
                                         $OTEL_EXPORTER_OTLP_METRICS_HEADERS)
      --otlp-protocol="grpc"             OTLP protocol ($OTEL_EXPORTER_OTLP_PROTOCOL)
      --otlp-insecure                    disable secure connection (required for such as localhost)
  -n, --name=STRING                      metric name
  -t, --type="gauge"                     metric type
  -d, --description=STRING               metric description
  -u, --unit="1"                         metric unit
      --resource-attrs=KEY=VALUE,...     resource attributes
      --scope-name=STRING                instrumentation scope name
      --scope-version=STRING             instrumentation scope version
      --scope-schemaurl=STRING           instrumentation scope schema url
      --scope-attrs=KEY=VALUE,...        instrumentation scope attributes
      --datapoint-attrs=KEY=VALUE,...    datapoint attributes (--attrs is an alias)
      --timestamp=INT-64                 datapoint timestamp (unix seconds)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version string = "unknown"
)

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
otlc command
internal
cli

Jump to

Keyboard shortcuts

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