Skip to content
Open
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
27 changes: 27 additions & 0 deletions .chloggen/feat_45675.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: "enhancement"

# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog)
component: "exporter/loadbalancing"

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Support metrics routing by attributes in the loadbalancing exporter"

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [45675]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
4 changes: 2 additions & 2 deletions exporter/loadbalancingexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The options for `routing_key` are: `service`, `traceID`, `metric` (metric name),
| resource | metrics |
| metric | metrics |
| streamID | metrics |
| attributes | spans |
| attributes | spans, metrics |

If no `routing_key` is configured, the default routing mechanism is `traceID` for traces, while `service` is the default for metrics. This means that spans belonging to the same `traceID` (or `service.name`, when `service` is used as the `routing_key`) will be sent to the same backend.

Expand Down Expand Up @@ -118,7 +118,7 @@ Refer to [config.yaml](./testdata/config.yaml) for detailed examples on using th
* `TODO`: Feature request [29771](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/29771) aims to cover the pagination for this scenario
* The `routing_key` property is used to specify how to route values (spans or metrics) to exporters based on different parameters. This functionality is currently enabled only for `trace` and `metric` pipeline types. It supports one of the following values:
* `service`: Routes values based on their service name. This is useful when using processors like the span metrics, so all spans for each service are sent to consistent collector instances for metric collection. Otherwise, metrics for the same services are sent to different collectors, making aggregations inaccurate.
* `attributes`: Routes based on values in the attributes of the traces. This is similar to service, but useful for situations in which a single service overwhelms any given instance of the collector, and should be split over multiple collectors. In addition to resource / span attributes, `span.kind`, `span.name` (the top level properties of a span) are also supported.
* `attributes`: Routes based on values in attributes. This is similar to service, but useful for situations in which a single service overwhelms any given instance of the collector, and should be split over multiple collectors. For traces, resource / scope / span attributes plus `span.kind` and `span.name` (top-level span fields) are supported. For metrics, resource / scope / datapoint attributes are supported.
* `traceID`: Routes spans based on their `traceID`. Invalid for metrics.
* `metric`: Routes metrics based on their metric name. Invalid for spans.
* `streamID`: Routes metrics based on their datapoint streamID. That's the unique hash of all it's attributes, plus the attributes and identifying information of its resource, scope, and metric data
Expand Down
5 changes: 3 additions & 2 deletions exporter/loadbalancingexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ type Config struct {
// RoutingKey is a single routing key value
RoutingKey string `mapstructure:"routing_key"`

// RoutingAttributes creates a composite routing key, based on several resource attributes of the application.
// RoutingAttributes creates a composite routing key from the listed attributes.
//
// Supports all attributes available (both resource and span), as well as the pseudo attributes "span.kind" and
// For traces, attributes can come from resource, scope, or span, plus the pseudo attributes "span.kind" and
// "span.name".
// For metrics, attributes can come from resource, scope, or datapoint attributes.
RoutingAttributes []string `mapstructure:"routing_attributes"`
}

Expand Down
Loading