Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/grafana/alloy into main
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxvms committed Nov 6, 2024
2 parents e09c73d + 8ac3098 commit 70006be
Show file tree
Hide file tree
Showing 190 changed files with 2,278 additions and 6,408 deletions.
5 changes: 3 additions & 2 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ platform:
version: "1809"
steps:
- commands:
- go test -tags="nodocker,nonetwork" ./...
- '& "C:/Program Files/git/bin/bash.exe" -c ''go test -tags="nodocker,nonetwork"
./...'''
image: grafana/alloy-build-image:v0.1.6-windows
name: Run Go tests
trigger:
Expand Down Expand Up @@ -835,6 +836,6 @@ kind: secret
name: updater_private_key
---
kind: signature
hmac: 353fac6e335a14f055d7e7a43b4d40517a1b5e28b3b3ad4d4e68df82b7f013b9
hmac: fd0699c2276e04bf3f9957b8eca427f3812c0aaf17bb969760f66574dcaf250c

...
4 changes: 3 additions & 1 deletion .drone/pipelines/test.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ local pipelines = import '../util/pipelines.jsonnet';
steps: [{
name: 'Run Go tests',
image: build_image.windows,
commands: ['go test -tags="nodocker,nonetwork" ./...'],
commands: [
pipelines.windows_command('go test -tags="nodocker,nonetwork" ./...'),
],
}],
},
]
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,26 @@ internal API changes are not present.
Main (unreleased)
-----------------

### Features

- Add `add_cloudwatch_timestamp` to `prometheus.exporter.cloudwatch` metrics. (@captncraig)

v1.5.0-rc.0
-----------------

### Breaking changes

- `import.git`: The default value for `revision` has changed from `HEAD` to `main`. (@ptodev)
It is no longer allowed to set `revision` to `"HEAD"`, `"FETCH_HEAD"`, `"ORIG_HEAD"`, `"MERGE_HEAD"`, or `"CHERRY_PICK_HEAD"`.

- The Otel update to v0.112.0 has a few breaking changes:
- [`otelcol.processor.deltatocumulative`] Change `max_streams` default value to `9223372036854775807` (max int).
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/35048
- [`otelcol.connector.spanmetrics`] Change `namespace` default value to `traces.span.metrics`.
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/34485
- [`otelcol.exporter.logging`] Removed in favor of the `otelcol.exporter.debug`.
https://github.com/open-telemetry/opentelemetry-collector/issues/11337

### Features

- Add the function `path_join` to the stdlib. (@wildum)
Expand Down Expand Up @@ -73,6 +88,21 @@ Main (unreleased)

- Fix dead link for RelabelConfig in the PodLog documentation page (@TheoBrigitte)

- Most notable changes coming with the OTel update from v0.108.0 vo v0.112.0 besides the breaking changes: (@wildum)
- [`http config`] Add support for lz4 compression.
https://github.com/open-telemetry/opentelemetry-collector/issues/9128
- [`otelcol.processor.interval`] Add support for gauges and summaries.
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/34803
- [`otelcol.receiver.kafka`] Add possibility to tune the fetch sizes.
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/34431
- [`otelcol.processor.tailsampling`] Add `invert_match` to boolean attribute.
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/34730
- [`otelcol.receiver.kafka`] Add support to decode to `otlp_json`.
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33627
- [`otelcol.processor.transform`] Add functions `convert_exponential_histogram_to_histogram` and `aggregate_on_attribute_value`.
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/33824
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/33423

v1.4.3
-----------------

Expand Down
13 changes: 13 additions & 0 deletions LICENSING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Licensing

License names used in this document are as per [SPDX License List](https://spdx.org/licenses/).

The default license for this project is [Apache-2.0](LICENSE).

## MIT

The following files are licensed under MIT:

```
internal/component/loki/secretfilter/gitleaks.toml
```
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
#
# Lines starting with "#" and blank lines are ignored.

v1.5.0
v1.6.0
4 changes: 2 additions & 2 deletions docs/sources/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: Grafana Alloy
description: Grafana Alloy is a a vendor-neutral distribution of the OTel Collector
weight: 350
cascade:
ALLOY_RELEASE: v1.5.0
OTEL_VERSION: v0.105.0
ALLOY_RELEASE: v1.6.0
OTEL_VERSION: v0.112.0
PROM_WIN_EXP_VERSION: v0.27.3
SNMP_VERSION: v0.26.0
FULL_PRODUCT_NAME: Grafana Alloy
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/_index.md.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Grafana Alloy is a a vendor-neutral distribution of the OTel Collec
weight: 350
cascade:
ALLOY_RELEASE: $ALLOY_VERSION
OTEL_VERSION: v0.105.0
OTEL_VERSION: v0.112.0
PROM_WIN_EXP_VERSION: v0.27.3
SNMP_VERSION: v0.26.0
FULL_PRODUCT_NAME: Grafana Alloy
Expand Down
1 change: 0 additions & 1 deletion docs/sources/reference/compatibility/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ The following components, grouped by namespace, _export_ OpenTelemetry `otelcol.
- [otelcol.exporter.debug](../components/otelcol/otelcol.exporter.debug)
- [otelcol.exporter.kafka](../components/otelcol/otelcol.exporter.kafka)
- [otelcol.exporter.loadbalancing](../components/otelcol/otelcol.exporter.loadbalancing)
- [otelcol.exporter.logging](../components/otelcol/otelcol.exporter.logging)
- [otelcol.exporter.loki](../components/otelcol/otelcol.exporter.loki)
- [otelcol.exporter.otlp](../components/otelcol/otelcol.exporter.otlp)
- [otelcol.exporter.otlphttp](../components/otelcol/otelcol.exporter.otlphttp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,32 @@ aggregates Request, Error and Duration (R.E.D) OpenTelemetry metrics from the sp
view call counts just on `service.name` and `span.name`.

Requests are tracked using a `calls` metric with a `status.code` datapoint attribute set to `Ok`:

```
calls { service.name="shipping", span.name="get_shipping/{shippingId}", span.kind="SERVER", status.code="Ok" }
```

- **Error** counts are computed from the number of spans with an `Error` status code.

Errors are tracked using a `calls` metric with a `status.code` datapoint attribute set to `Error`:
```
calls { service.name="shipping", span.name="get_shipping/{shippingId}, span.kind="SERVER", status.code="Error" }
```
Errors are tracked using a `calls` metric with a `status.code` datapoint attribute set to `Error`:

```
calls { service.name="shipping", span.name="get_shipping/{shippingId}, span.kind="SERVER", status.code="Error" }
```

- **Duration** is computed from the difference between the span start and end times and inserted
into the relevant duration histogram time bucket for each unique set dimensions.
into the relevant duration histogram time bucket for each unique set dimensions.

Span durations are tracked using a `duration` histogram metric:
```
duration { service.name="shipping", span.name="get_shipping/{shippingId}", span.kind="SERVER", status.code="Ok" }
```
Span durations are tracked using a `duration` histogram metric:

> **NOTE**: `otelcol.connector.spanmetrics` is a wrapper over the upstream
> OpenTelemetry Collector `spanmetrics` connector. Bug reports or feature requests
> will be redirected to the upstream repository, if necessary.
```
duration { service.name="shipping", span.name="get_shipping/{shippingId}", span.kind="SERVER", status.code="Ok" }
```

{{< admonition type="note" >}}
`otelcol.connector.spanmetrics` is a wrapper over the upstream OpenTelemetry Collector `spanmetrics` connector.
Bug reports or feature requests will be redirected to the upstream repository, if necessary.
{{< /admonition >}}

Multiple `otelcol.connector.spanmetrics` components can be specified by giving them
different labels.
Expand All @@ -60,17 +64,17 @@ otelcol.connector.spanmetrics "LABEL" {

`otelcol.connector.spanmetrics` supports the following arguments:

| Name | Type | Description | Default | Required |
| --------------------------------- | -------------- | ------------------------------------------------------------------------------------------ | -------------- | -------- |
| `aggregation_temporality` | `string` | Configures whether to reset the metrics after flushing. | `"CUMULATIVE"` | no |
| `dimensions_cache_size` | `number` | How many dimensions to cache. | `1000` | no |
| `exclude_dimensions` | `list(string)` | List of dimensions to be excluded from the default set of dimensions. | `[]` | no |
| `metrics_flush_interval` | `duration` | How often to flush generated metrics. | `"60s"` | no |
| `metrics_expiration` | `duration` | Time period after which metrics are considered stale and are removed from the cache. | `"0s"` | no |
| `metric_timestamp_cache_size` | `number` | Controls the size of a cache used to keep track of the last time a metric was flushed. | `1000` | no |
| `namespace` | `string` | Metric namespace. | `""` | no |
| `resource_metrics_cache_size` | `number` | The size of the cache holding metrics for a service. | `1000` | no |
| `resource_metrics_key_attributes` | `list(string)` | Limits the resource attributes used to create the metrics. | `[]` | no |
| Name | Type | Description | Default | Required |
| --------------------------------- | -------------- | -------------------------------------------------------------------------------------- | ----------------------- | -------- |
| `aggregation_temporality` | `string` | Configures whether to reset the metrics after flushing. | `"CUMULATIVE"` | no |
| `dimensions_cache_size` | `number` | How many dimensions to cache. | `1000` | no |
| `exclude_dimensions` | `list(string)` | List of dimensions to be excluded from the default set of dimensions. | `[]` | no |
| `metrics_flush_interval` | `duration` | How often to flush generated metrics. | `"60s"` | no |
| `metrics_expiration` | `duration` | Time period after which metrics are considered stale and are removed from the cache. | `"0s"` | no |
| `metric_timestamp_cache_size` | `number` | Controls the size of a cache used to keep track of the last time a metric was flushed. | `1000` | no |
| `namespace` | `string` | Metric namespace. | `"traces.span.metrics"` | no |
| `resource_metrics_cache_size` | `number` | The size of the cache holding metrics for a service. | `1000` | no |
| `resource_metrics_key_attributes` | `list(string)` | Limits the resource attributes used to create the metrics. | `[]` | no |

Adjusting `dimensions_cache_size` can improve the {{< param "PRODUCT_NAME" >}} process' memory usage.

Expand All @@ -85,9 +89,9 @@ Setting `metrics_expiration` to `"0s"` means that the metrics will never expire.

`resource_metrics_cache_size` is mostly relevant for cumulative temporality. It helps avoid issues with increasing memory and with incorrect metric timestamp resets.

`metric_timestamp_cache_size` is only relevant for delta temporality span metrics.
It controls the size of a cache used to keep track of the last time a metric was flushed.
When a metric is evicted from the cache, its next data point will indicate a "reset" in the series.
`metric_timestamp_cache_size` is only relevant for delta temporality span metrics.
It controls the size of a cache used to keep track of the last time a metric was flushed.
When a metric is evicted from the cache, its next data point will indicate a "reset" in the series.
Downstream components converting from delta to cumulative may handle these resets by setting cumulative counters back to 0.

`resource_metrics_key_attributes` can be used to avoid situations where resource attributes may change across service restarts,
Expand All @@ -100,17 +104,17 @@ For example, `["service.name", "telemetry.sdk.language", "telemetry.sdk.name"]`.
The following blocks are supported inside the definition of
`otelcol.connector.spanmetrics`:

| Hierarchy | Block | Description | Required |
| ----------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| dimension | [dimension][] | Dimensions to be added in addition to the default ones. | no |
| events | [events][] | Configures the events metric. | no |
| events > dimension | [dimension][] | Span event attributes to add as dimensions to the events metric, _on top of_ the default ones and the ones configured in the top-level `dimension` block. | no |
| exemplars | [exemplars][] | Configures how to attach exemplars to histograms. | no |
| histogram | [histogram][] | Configures the histogram derived from spans durations. | yes |
| histogram > explicit | [explicit][] | Configuration for a histogram with explicit buckets. | no |
| histogram > exponential | [exponential][] | Configuration for a histogram with exponential buckets. | no |
| output | [output][] | Configures where to send telemetry data. | yes |
debug_metrics | [debug_metrics][] | Configures the metrics that this component generates to monitor its state. | no
| Hierarchy | Block | Description | Required |
| ----------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| dimension | [dimension][] | Dimensions to be added in addition to the default ones. | no |
| events | [events][] | Configures the events metric. | no |
| events > dimension | [dimension][] | Span event attributes to add as dimensions to the events metric, _on top of_ the default ones and the ones configured in the top-level `dimension` block. | no |
| exemplars | [exemplars][] | Configures how to attach exemplars to histograms. | no |
| histogram | [histogram][] | Configures the histogram derived from spans durations. | yes |
| histogram > explicit | [explicit][] | Configuration for a histogram with explicit buckets. | no |
| histogram > exponential | [exponential][] | Configuration for a histogram with exponential buckets. | no |
| output | [output][] | Configures where to send telemetry data. | yes |
| debug_metrics | [debug_metrics][] | Configures the metrics that this component generates to monitor its state. | no |

It is necessary to specify either a "[exponential][]" or an "[explicit][]" block:

Expand Down Expand Up @@ -201,8 +205,8 @@ The `explicit` block configures a histogram with explicit buckets.

The following attributes are supported:

| Name | Type | Description | Default | Required |
| --------- | ---------------- | -------------------------- | ------------------------------------------ | -------- |
| Name | Type | Description | Default | Required |
| --------- | ---------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -------- |
| `buckets` | `list(duration)` | List of histogram buckets. | `["2ms", "4ms", "6ms", "8ms", "10ms", "50ms", "100ms", "200ms", "400ms", "800ms", "1s", "1400ms", "2s", "5s", "10s", "15s"]` | no |

### exemplars block
Expand Down Expand Up @@ -665,6 +669,7 @@ This problem can be solved by doing **either** of the following:
- **Recommended approach:** Prior to `otelcol.connector.spanmetrics`, remove all resource attributes from the incoming spans which are not needed by `otelcol.connector.spanmetrics`.

{{< collapse title="Example configuration to remove unnecessary resource attributes." >}}

```alloy
otelcol.receiver.otlp "default" {
http {}
Expand Down Expand Up @@ -725,14 +730,16 @@ This problem can be solved by doing **either** of the following:
}
}
```

{{< /collapse >}}

- Or, after `otelcol.connector.spanmetrics`, copy each of the resource attributes as a metric datapoint attribute.
This has the advantage that the resource attributes will be visible as metric labels.
However, the {{< term "cardinality" >}}cardinality{{< /term >}} of the metrics may be much higher, which could increase the cost of storing and querying them.
The example below uses the [merge_maps][] OTTL function.
This has the advantage that the resource attributes will be visible as metric labels.
However, the {{< term "cardinality" >}}cardinality{{< /term >}} of the metrics may be much higher, which could increase the cost of storing and querying them.
The example below uses the [merge_maps][] OTTL function.

{{< collapse title="Example configuration to add all resource attributes as metric datapoint attributes." >}}

```alloy
otelcol.receiver.otlp "default" {
http {}
Expand Down Expand Up @@ -784,6 +791,7 @@ The example below uses the [merge_maps][] OTTL function.
}
}
```

{{< /collapse >}}

If the resource attributes are not treated in either of the ways described above, an error such as this one could be logged by `prometheus.remote_write`:
Expand Down
Loading

0 comments on commit 70006be

Please sign in to comment.