Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .chloggen/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ components:
- connector/servicegraph
- connector/signal_to_metrics
- connector/slowsql
- connector/spanmetrics
- connector/span_metrics
- connector/sum
- exporter/alertmanager
- exporter/alibabacloud_logservice
Expand Down
5 changes: 5 additions & 0 deletions .chloggen/rename-spanmetrics-connector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
change_type: deprecation
component: connector/span_metrics
note: Rename component type from `spanmetrics` to `span_metrics` to follow snake_case naming convention. The old name is kept as a deprecated alias.
issues: [47963]
change_logs: [user]
31 changes: 18 additions & 13 deletions connector/spanmetricsconnector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
[Stability Level]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#stability-levels
<!-- end autogenerated section -->

> **Deprecation Notice:** The component type has been renamed from `spanmetrics` to `span_metrics`
> to follow the OpenTelemetry snake_case naming convention.
> The old name `spanmetrics` still works but is deprecated and will be removed in a future release.
> Please update your configuration to use `span_metrics`.

⚠️ Breaking Change Warning:
The default duration metrics unit will change from `ms` to `s` to adhere to the OpenTelemetry semantic conventions and a feature gate `connector.spanmetrics.useSecondAsDefaultMetricsUnit` is also added.

Expand Down Expand Up @@ -159,7 +164,7 @@ exporters:
nop:

connectors:
spanmetrics:
span_metrics:
histogram:
dimensions:
- name: url.scheme
Expand Down Expand Up @@ -195,9 +200,9 @@ service:
pipelines:
traces:
receivers: [nop]
exporters: [spanmetrics]
exporters: [span_metrics]
metrics:
receivers: [spanmetrics]
receivers: [span_metrics]
exporters: [nop]
```

Expand Down Expand Up @@ -225,16 +230,16 @@ exporters:
enabled: true

connectors:
spanmetrics:
span_metrics:
namespace: span.metrics

service:
pipelines:
traces:
receivers: [otlp]
exporters: [spanmetrics]
exporters: [span_metrics]
metrics:
receivers: [spanmetrics]
receivers: [span_metrics]
exporters: [prometheusremotewrite]
```

Expand Down Expand Up @@ -278,7 +283,7 @@ To reduce the risk of conflicting writes:
* Add `resource_metrics_key_attributes` to your configuration.
```
connectors:
spanmetrics:
span_metrics:
resource_metrics_key_attributes:
- service.name
- telemetry.sdk.language
Expand Down Expand Up @@ -343,7 +348,7 @@ processors:
...

connectors:
spanmetrics:
span_metrics:

exporters:
otlp_http/observability-backend:
Expand All @@ -354,9 +359,9 @@ service:
traces:
receivers: [otlp]
processors: [transform/sanitize_spans, ...]
exporters: [otlp_http/observability-backend, spanmetrics]
exporters: [otlp_http/observability-backend, span_metrics]
metrics:
receivers: [otlp, spanmetrics]
receivers: [otlp, span_metrics]
processors: [...]
exporters: [otlp_http/observability-backend]
# ...
Expand Down Expand Up @@ -406,7 +411,7 @@ processors:
...

connectors:
spanmetrics:
span_metrics:

exporters:
otlp_http/observability-backend:
Expand All @@ -417,9 +422,9 @@ service:
traces:
receivers: [otlp]
processors: [transform/sanitize_spans, ...]
exporters: [otlp_http/observability-backend, spanmetrics]
exporters: [otlp_http/observability-backend, span_metrics]
metrics:
receivers: [otlp, spanmetrics]
receivers: [otlp, span_metrics]
processors: [...]
exporters: [otlp_http/observability-backend]
# ...
Expand Down
6 changes: 4 additions & 2 deletions connector/spanmetricsconnector/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/jonboulle/clockwork"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/connector"
"go.opentelemetry.io/collector/connector/xconnector"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/featuregate"
"go.opentelemetry.io/collector/pdata/pcommon"
Expand Down Expand Up @@ -72,10 +73,11 @@ func init() {

// NewFactory creates a factory for the spanmetrics connector.
func NewFactory() connector.Factory {
return connector.NewFactory(
return xconnector.NewFactory(
metadata.Type,
createDefaultConfig,
connector.WithTracesToMetrics(createTracesToMetricsConnector, metadata.TracesToMetricsStability),
xconnector.WithTracesToMetrics(createTracesToMetricsConnector, metadata.TracesToMetricsStability),
xconnector.WithDeprecatedTypeAlias(metadata.DeprecatedType),
)
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion connector/spanmetricsconnector/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ require (
go.opentelemetry.io/collector/confmap/xconfmap v0.150.1-0.20260424074859-d91c0edd1da5
go.opentelemetry.io/collector/connector v0.150.1-0.20260424074859-d91c0edd1da5
go.opentelemetry.io/collector/connector/connectortest v0.150.1-0.20260424074859-d91c0edd1da5
go.opentelemetry.io/collector/connector/xconnector v0.150.1-0.20260424074859-d91c0edd1da5
go.opentelemetry.io/collector/consumer v1.56.1-0.20260424074859-d91c0edd1da5
go.opentelemetry.io/collector/consumer/consumertest v0.150.1-0.20260424074859-d91c0edd1da5
go.opentelemetry.io/collector/featuregate v1.56.1-0.20260424074859-d91c0edd1da5
Expand Down Expand Up @@ -48,7 +49,6 @@ require (
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/collector/connector/xconnector v0.150.1-0.20260424074859-d91c0edd1da5 // indirect
go.opentelemetry.io/collector/consumer/xconsumer v0.150.1-0.20260424074859-d91c0edd1da5 // indirect
go.opentelemetry.io/collector/internal/componentalias v0.150.1-0.20260424074859-d91c0edd1da5 // indirect
go.opentelemetry.io/collector/internal/fanoutconsumer v0.150.1-0.20260424074859-d91c0edd1da5 // indirect
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion connector/spanmetricsconnector/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type: spanmetrics
type: span_metrics
deprecated_type: spanmetrics
display_name: Span Metrics Connector

status:
Expand Down
28 changes: 14 additions & 14 deletions connector/spanmetricsconnector/testdata/config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# default configuration
spanmetrics/default:
span_metrics/default:

# default configuration with explicit buckets histogram
spanmetrics/default_explicit_histogram:
span_metrics/default_explicit_histogram:
histogram:
explicit:

# configuration with all possible parameters
spanmetrics/full:
span_metrics/full:
histogram:
unit: "s"
explicit:
Expand Down Expand Up @@ -40,56 +40,56 @@ spanmetrics/full:
metrics_flush_interval: 30s

# default configuration with exponential buckets histogram
spanmetrics/exponential_histogram:
span_metrics/exponential_histogram:
histogram:
exponential:
max_size: 10

# invalid histogram configuration
spanmetrics/exponential_and_explicit_histogram:
span_metrics/exponential_and_explicit_histogram:
histogram:
exponential:
max_size: 10
explicit:
buckets: [ 10ms, 100ms, 250ms ]

spanmetrics/invalid_histogram_unit:
span_metrics/invalid_histogram_unit:
histogram:
unit: "h"

spanmetrics/invalid_metrics_expiration:
span_metrics/invalid_metrics_expiration:
metrics_expiration: -20s

# exemplars enabled
spanmetrics/exemplars_enabled:
span_metrics/exemplars_enabled:
exemplars:
enabled: true

# exemplars enabled with max per datapoint configured
spanmetrics/exemplars_enabled_with_max_per_datapoint:
span_metrics/exemplars_enabled_with_max_per_datapoint:
exemplars:
enabled: true
max_per_data_point: 10

# resource metrics key attributes filter
spanmetrics/resource_metrics_key_attributes:
span_metrics/resource_metrics_key_attributes:
resource_metrics_key_attributes:
- service.name
- telemetry.sdk.language
- telemetry.sdk.name

spanmetrics/custom_delta_timestamp_cache_size:
span_metrics/custom_delta_timestamp_cache_size:
aggregation_temporality: "AGGREGATION_TEMPORALITY_DELTA"
metric_timestamp_cache_size: 123

spanmetrics/invalid_delta_timestamp_cache_size:
span_metrics/invalid_delta_timestamp_cache_size:
aggregation_temporality: "AGGREGATION_TEMPORALITY_DELTA"
metric_timestamp_cache_size: 0

spanmetrics/default_delta_timestamp_cache_size:
span_metrics/default_delta_timestamp_cache_size:
aggregation_temporality: "AGGREGATION_TEMPORALITY_DELTA"

spanmetrics/separate_calls_and_duration_dimensions:
span_metrics/separate_calls_and_duration_dimensions:
histogram:
dimensions:
- name: http.status_code
Expand Down
2 changes: 1 addition & 1 deletion reports/distributions/contrib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ components:
- routing
- servicegraph
- signal_to_metrics
- spanmetrics
- span_metrics
- sum
exporter:
- alibabacloud_logservice
Expand Down
Loading