Skip to content

Commit

Permalink
Release 0.34.3 (#4275)
Browse files Browse the repository at this point in the history
* otelcol.exporter.prometheus: Make histogram counts cumulative for Prometheus (#4196)

* Use sha256 for rpm signing to allow installation on fips-enabed systems (#4268)

* Use sha256 for rpm digest signing to allow installation on fips-enabled systems

* add changelog

* fix startup order for prometheus.operator.servicemonitors. Fixes #4142 (#4146)

* update versions for 0.34.3

* build: update to go 1.20.5

---------

Co-authored-by: Nikola Grcevski <[email protected]>
Co-authored-by: kfriedrich123 <[email protected]>
  • Loading branch information
3 people authored Jun 27, 2023
1 parent 8db6922 commit 4f652a8
Show file tree
Hide file tree
Showing 24 changed files with 110 additions and 34 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ This document contains a historical list of changes between releases. Only
changes that impact end-user behavior are listed; changes to documentation or
internal API changes are not present.

v0.34.3 (2023-06-27)
--------------------

### Bugfixes

- Fixes a bug in conversion of OpenTelemetry histograms when exported to Prometheus. (@grcevski)
- Enforce sha256 digest signing for rpms enabling installation on FIPS-enabled OSes. (@kfriedrich123)
- Fix panic from improper startup ordering in `prometheus.operator.servicemonitors`. (@captncraig)

### Other changes

- Build with go version 1.20.5 (@captncraig)

v0.34.2 (2023-06-20)
--------------------

Expand Down
2 changes: 1 addition & 1 deletion build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ FROM alpine:3.17 as helm
RUN apk add --no-cache helm

# Dependency: Go and Go dependencies
FROM golang:1.20.4-bullseye as golang
FROM golang:1.20.5-bullseye as golang

# Keep in sync with cmd/grafana-agent-operator/DEVELOPERS.md
ENV CONTROLLER_GEN_VERSION v0.9.2
Expand Down
2 changes: 1 addition & 1 deletion build-image/windows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM library/golang:1.20.4-windowsservercore-1809
FROM library/golang:1.20.5-windowsservercore-1809

SHELL ["powershell", "-command"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package convert
import (
"context"
"fmt"
"math"
"sort"
"strconv"
"sync"
"time"
Expand Down Expand Up @@ -458,11 +460,36 @@ func (conv *Converter) consumeHistogram(app storage.Appender, memResource *memor
}
}

// Sort the histogram by bounds ascending
bSize := int(math.Min(float64(dp.ExplicitBounds().Len()), float64(dp.BucketCounts().Len())))
buckets := make(map[float64]uint64, bSize)
bounds := make([]float64, 0, bSize)
for i := 0; i < dp.ExplicitBounds().Len() && i < dp.BucketCounts().Len(); i++ {
bound := dp.ExplicitBounds().At(i)
buckets[bound] = dp.BucketCounts().At(i)
bounds = append(bounds, bound)
}

sort.Float64s(bounds)

// Calculate cumulative count values. Prometheus expects cummulative bucket counts for histograms.
// This has nothing to do with temporality, it doesn't affect cummulative vs delta histograms, it
// simply matches the format of bucket counts expected by Prometheus.
var c uint64 = 0
for i := 0; i < len(bounds); i++ {
bound := bounds[i]
c += buckets[bound]
buckets[bound] = c
}

// Process the boundaries. The number of buckets = number of explicit
// bounds + 1.
for i := 0; i < dp.ExplicitBounds().Len() && i < dp.BucketCounts().Len(); i++ {
bound := dp.ExplicitBounds().At(i)
count := dp.BucketCounts().At(i)
count, ok := buckets[bound]
if !ok {
count = dp.BucketCounts().At(i)
}

bucketLabel := labels.Label{
Name: model.BucketLabel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,41 @@ func TestConverter(t *testing.T) {
# TYPE test_metric_seconds histogram
test_metric_seconds_bucket{le="0.25"} 0
test_metric_seconds_bucket{le="0.5"} 111
test_metric_seconds_bucket{le="0.75"} 0
test_metric_seconds_bucket{le="1.0"} 222
test_metric_seconds_bucket{le="0.75"} 111
test_metric_seconds_bucket{le="1.0"} 333
test_metric_seconds_bucket{le="+Inf"} 333
test_metric_seconds_sum 100.0
test_metric_seconds_count 333
`,
},
{
name: "Histogram out-of-order bounds",
input: `{
"resource_metrics": [{
"scope_metrics": [{
"metrics": [{
"name": "test_metric_seconds",
"histogram": {
"aggregation_temporality": 2,
"data_points": [{
"start_time_unix_nano": 1000000000,
"time_unix_nano": 1000000000,
"count": 333,
"sum": 100,
"bucket_counts": [0, 111, 0, 222],
"explicit_bounds": [0.5, 1.0, 0.25, 0.75]
}]
}
}]
}]
}]
}`,
expect: `
# TYPE test_metric_seconds histogram
test_metric_seconds_bucket{le="0.25"} 0
test_metric_seconds_bucket{le="0.5"} 0
test_metric_seconds_bucket{le="0.75"} 222
test_metric_seconds_bucket{le="1.0"} 333
test_metric_seconds_bucket{le="+Inf"} 333
test_metric_seconds_sum 100.0
test_metric_seconds_count 333
Expand Down
11 changes: 6 additions & 5 deletions component/prometheus/operator/common/crdmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ func (c *crdManager) Run(ctx context.Context) error {
}
}()

if err := c.runInformers(restConfig, ctx); err != nil {
return err
}
level.Info(c.logger).Log("msg", "informers started")

// Start prometheus scrape manager.
flowAppendable := prometheus.NewFanout(c.args.ForwardTo, c.opts.ID, c.opts.Registerer)
opts := &scrape.Options{}
Expand All @@ -112,6 +107,12 @@ func (c *crdManager) Run(ctx context.Context) error {
}
}()

// run informers after everything else is running
if err := c.runInformers(restConfig, ctx); err != nil {
return err
}
level.Info(c.logger).Log("msg", "informers started")

// Start the target discovery loop to update the scrape manager with new targets.
for {
select {
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/operator/deploy-agent-operator-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ To deploy the `GrafanaAgent` resource:
labels:
app: grafana-agent
spec:
image: grafana/agent:v0.34.2
image: grafana/agent:v0.34.3
integrations:
selector:
matchLabels:
agent: grafana-agent-integrations
image: grafana/agent:v0.34.2
image: grafana/agent:v0.34.3
logLevel: info
serviceAccountName: grafana-agent
metrics:
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/operator/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ To install Agent Operator:
serviceAccountName: grafana-agent-operator
containers:
- name: operator
image: grafana/agent-operator:v0.34.2
image: grafana/agent-operator:v0.34.3
args:
- --kubelet-service=default/kubelet
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ docker run \
-v "/proc:/host/proc:ro,rslave" \
-v /tmp/agent:/etc/agent \
-v /path/to/config.yaml:/etc/agent-config/agent.yaml \
grafana/agent:v0.34.2 \
grafana/agent:v0.34.3 \
--config.file=/etc/agent-config/agent.yaml
```

Expand Down Expand Up @@ -67,7 +67,7 @@ metadata:
name: agent
spec:
containers:
- image: grafana/agent:v0.34.2
- image: grafana/agent:v0.34.3
name: agent
args:
- --config.file=/etc/agent-config/agent.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ docker run \
-v "/proc:/proc:ro" \
-v /tmp/agent:/etc/agent \
-v /path/to/config.yaml:/etc/agent-config/agent.yaml \
grafana/agent:v0.34.2 \
grafana/agent:v0.34.3 \
--config.file=/etc/agent-config/agent.yaml
```

Expand All @@ -37,7 +37,7 @@ metadata:
name: agent
spec:
containers:
- image: grafana/agent:v0.34.2
- image: grafana/agent:v0.34.3
name: agent
args:
- --config.file=/etc/agent-config/agent.yaml
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/static/set-up/install-agent-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Grafana Agent is available as a Docker container image on the following platform
docker run \
-v WAL_DATA_DIRECTORY:/etc/agent/data \
-v CONFIG_FILE_PATH:/etc/agent/agent.yaml \
grafana/agent:v0.34.2
grafana/agent:v0.34.3
```

- Replace `CONFIG_FILE_PATH` with the configuration file path on your Linux host system.
Expand All @@ -47,7 +47,7 @@ Grafana Agent is available as a Docker container image on the following platform
docker run ^
-v WAL_DATA_DIRECTORY:c:\etc\grafana-agent\data ^
-v CONFIG_FILE_PATH:c:\etc\grafana-agent ^
grafana/agent:v0.34.2-windows
grafana/agent:v0.34.3-windows
```

- Replace `CONFIG_FILE_PATH` with the configuration file path on your Windows host system.
Expand Down
1 change: 1 addition & 0 deletions packaging/grafana-agent-flow/rpm/gpg-sign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ echo "%_gpg_name Grafana <[email protected]>
%_signature gpg
%_gpg_path /root/.gnupg
%_gpgbin /usr/bin/gpg
%_gpg_digest_algo sha256
%__gpg /usr/bin/gpg
%__gpg_sign_cmd %{__gpg} \
gpg --no-tty --batch --yes --no-verbose --no-armor \
Expand Down
1 change: 1 addition & 0 deletions packaging/grafana-agent/rpm/gpg-sign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ echo "%_gpg_name Grafana <[email protected]>
%_signature gpg
%_gpg_path /root/.gnupg
%_gpgbin /usr/bin/gpg
%_gpg_digest_algo sha256
%__gpg /usr/bin/gpg
%__gpg_sign_cmd %{__gpg} \
gpg --no-tty --batch --yes --no-verbose --no-armor \
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package operator

// Supported versions of the Grafana Agent.
var (
DefaultAgentVersion = "v0.34.2"
DefaultAgentVersion = "v0.34.3"
DefaultAgentBaseImage = "grafana/agent"
DefaultAgentImage = DefaultAgentBaseImage + ":" + DefaultAgentVersion
)
2 changes: 1 addition & 1 deletion production/kubernetes/agent-bare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: grafana/agent:v0.34.2
image: grafana/agent:v0.34.3
imagePullPolicy: IfNotPresent
name: grafana-agent
ports:
Expand Down
2 changes: 1 addition & 1 deletion production/kubernetes/agent-loki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: grafana/agent:v0.34.2
image: grafana/agent:v0.34.3
imagePullPolicy: IfNotPresent
name: grafana-agent-logs
ports:
Expand Down
2 changes: 1 addition & 1 deletion production/kubernetes/agent-traces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: grafana/agent:v0.34.2
image: grafana/agent:v0.34.3
imagePullPolicy: IfNotPresent
name: grafana-agent-traces
ports:
Expand Down
2 changes: 1 addition & 1 deletion production/kubernetes/build/lib/version.libsonnet
Original file line number Diff line number Diff line change
@@ -1 +1 @@
'grafana/agent:v0.34.2'
'grafana/agent:v0.34.3'
4 changes: 2 additions & 2 deletions production/kubernetes/build/templates/operator/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ local ksm = import 'kube-state-metrics/kube-state-metrics.libsonnet';
local this = self,

_images:: {
agent: 'grafana/agent:v0.34.2',
agent_operator: 'grafana/agent-operator:v0.34.2',
agent: 'grafana/agent:v0.34.3',
agent_operator: 'grafana/agent-operator:v0.34.3',
ksm: 'registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.5.0',
},

Expand Down
2 changes: 1 addition & 1 deletion production/kubernetes/install-bare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ check_installed() {
check_installed curl
check_installed envsubst

MANIFEST_BRANCH=v0.34.2
MANIFEST_BRANCH=v0.34.3
MANIFEST_URL=${MANIFEST_URL:-https://raw.githubusercontent.com/grafana/agent/${MANIFEST_BRANCH}/production/kubernetes/agent-bare.yaml}
NAMESPACE=${NAMESPACE:-default}

Expand Down
4 changes: 2 additions & 2 deletions production/operator/templates/agent-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ spec:
containers:
- args:
- --kubelet-service=default/kubelet
image: grafana/agent-operator:v0.34.2
image: grafana/agent-operator:v0.34.3
imagePullPolicy: IfNotPresent
name: grafana-agent-operator
serviceAccount: grafana-agent-operator
Expand Down Expand Up @@ -436,7 +436,7 @@ metadata:
name: grafana-agent
namespace: ${NAMESPACE}
spec:
image: grafana/agent:v0.34.2
image: grafana/agent:v0.34.3
integrations:
selector:
matchLabels:
Expand Down
4 changes: 2 additions & 2 deletions production/tanka/grafana-agent/v1/main.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ local service = k.core.v1.service;
(import './lib/traces.libsonnet') +
{
_images:: {
agent: 'grafana/agent:v0.34.2',
agentctl: 'grafana/agentctl:v0.34.2,
agent: 'grafana/agent:v0.34.3',
agentctl: 'grafana/agentctl:v0.34.3,
},
// new creates a new DaemonSet deployment of the grafana-agent. By default,
Expand Down
4 changes: 2 additions & 2 deletions production/tanka/grafana-agent/v2/internal/base.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ function(name='grafana-agent', namespace='') {
local this = self,

_images:: {
agent: 'grafana/agent:v0.34.2',
agentctl: 'grafana/agentctl:v0.34.2',
agent: 'grafana/agent:v0.34.3',
agentctl: 'grafana/agentctl:v0.34.3',
},
_config:: {
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function(
) {
local _config = {
api: error 'api must be set',
image: 'grafana/agentctl:v0.34.2',
image: 'grafana/agentctl:v0.34.3',
schedule: '*/5 * * * *',
configs: [],
} + config,
Expand Down

0 comments on commit 4f652a8

Please sign in to comment.