Signal to Metrics

Description

This connector generates custom metrics from logs, metrics, and traces using OTTL expressions.

Use

Use this connector to:

  • Count log events as metrics for monitoring error rates or request frequencies

  • Generate latency histograms from trace spans

  • Derive new metrics from existing metric datapoints

  • Build custom service level indicators from raw telemetry

Stability

  • Alpha

Supported Types

Metrics
Logs
Traces

All input types produce metrics as output.

Configuration

Field
Description

Telemetry Types

Select which signal types to process: Logs, Metrics, or Traces. At least one must be selected.

Metric Definitions

One or more metrics to generate. See metric definition fields below.

Metric Definition

Field
Description

Name

The metric name (e.g., http.request.count).

Description

Description of the metric.

Unit

Metric unit (e.g., ms, bytes, logs).

Type

Sum, Gauge, Histogram, or Exponential Histogram.

Value Expression

OTTL expression that returns the metric value.

Condition

OTTL condition to filter which signals generate this metric.

Buckets

Bucket boundaries (Histogram only). Default: [2, 4, 6, 8, 10, 50, 100, 200, 400, 800, 1000, 1400, 2000, 5000, 10000, 15000].

Max Size

Max bucket count (Exponential Histogram only). Default: 160.

Attributes

Attributes to include in the output metric.

Resource Attributes

Resource attributes to include in the output metric.

Metric Types

Type
Description

Sum

Aggregates numeric values. Use for counters and cumulative metrics.

Gauge

Records the last observed value. Use for current state metrics.

Histogram

Distributes values across explicit buckets. Optionally configure Buckets (default: [2, 4, 6, 8, 10, 50, 100, 200, 400, 800, 1000, 1400, 2000, 5000, 10000, 15000]).

Exponential Histogram

Uses dynamic bucket sizing. Optionally configure Max Size (default: 160).

Attributes

Specify which attributes from the source signal to include in the output metric. If no attributes are defined, the output metric will have no attributes.

Field
Description

Key

The attribute key to include.

Behavior

Required (default): incoming signals missing this attribute are skipped entirely. Optional: attribute is included if present on incoming signals, excluded if not. Has Default: use default value if attribute is missing from incoming signals.

Default Value

Value to use when attribute is missing (only with Has Default).

Resource Attributes

Specify which resource attributes to include in the output metric. If no resource attributes are defined, all incoming resource attributes are included.

Field
Description

Key

The resource attribute key to include.

Behavior

Optional (default) or Has Default. Same behavior as attributes, but Required is not available.

Default Value

Value to use when attribute is missing (only with Has Default).

Conditions

Filter which signals generate metrics using OTTL conditions.

Example conditions:

  • attributes["http.status_code"] >= 400 — only error responses

  • severity_number >= SEVERITY_NUMBER_ERROR — only error logs

  • name == "HTTP GET" — specific span names

OTTL Expressions

The connector supports OTTL functionsarrow-up-right for extracting values.

Common expressions:

  • 1 — literal value for counting

  • Int(attributes["response_time"]) — extract integer attribute

  • Double(attributes["duration_ms"]) — extract float attribute

For spans, AdjustedCount() calculates accurate counts when sampling is enabled:

Example Configuration(s)

Count Log Records by Severity

Count all log records, grouped by severity level.

  • Signal Type: logs

  • Name: log.record.count

  • Type: Sum

  • Value Expression: 1

  • Attributes: Key severity, Behavior Optional

HTTP Request Duration Histogram

Generate a latency histogram from HTTP server spans.

  • Signal Type: spans

  • Name: http.server.duration

  • Unit: ms

  • Type: Histogram

  • Value Expression: Double(attributes["http.server.request.duration"])

  • Condition: kind == SPAN_KIND_SERVER

  • Buckets: [5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000]

  • Attributes: Key http.route, Behavior Optional; Key http.method, Behavior Required

Error Count by Service

Count error logs grouped by service name.

  • Signal Type: logs

  • Name: error.count

  • Type: Sum

  • Value Expression: 1

  • Condition: severity_number >= SEVERITY_NUMBER_ERROR

  • Resource Attributes: Key service.name, Behavior Optional

Span Count with Sampling Adjustment

Accurately count spans when sampling is enabled.

  • Signal Type: spans

  • Name: span.count

  • Type: Sum

  • Value: Int(AdjustedCount())

Technical Notes

The connector automatically adds signaltometrics.service.instance.id to every output metric for single-writer compliance.

The connector does not perform time-based aggregation. Metrics are aggregated per batch only.

Last updated

Was this helpful?