Skip to content

Commit

Permalink
Merge branch 'main' into thampiotr/sync-loki-process-counters
Browse files Browse the repository at this point in the history
  • Loading branch information
thampiotr authored Oct 9, 2023
2 parents b786124 + 9a53c48 commit 8825874
Show file tree
Hide file tree
Showing 22 changed files with 57 additions and 45 deletions.
24 changes: 13 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Main (unreleased)
- Fixed an issue where `loki.process` validation for stage `metric.counter` was
allowing invalid combination of configuration options. (@thampiotr)

v0.37.0-rc.0 (2023-10-05)
v0.37.0-rc.1 (2023-10-06)
-----------------

### Breaking changes
Expand All @@ -42,35 +42,34 @@ v0.37.0-rc.0 (2023-10-05)
- New Grafana Agent Flow components:

- `discovery.consulagent` discovers scrape targets from Consul Agent. (@wildum)
- `discovery.dockerswarm` discovers scrape targets from Docker Swarm. (@wildum)
- `discovery.ionos` discovers scrape targets from the IONOS Cloud API. (@wildum)
- `discovery.kuma` discovers scrape targets from the Kuma control plane. (@tpaschalis)
- `discovery.linode` discovers scrape targets from the Linode API. (@captncraig)
- `discovery.marathon` discovers scrape targets from Marathon servers. (@wildum)
- `discovery.ionos` discovers scrape targets from the IONOS Cloud API. (@wildum)
- `discovery.triton` discovers scrape targets from Triton Container Monitor. (@erikbaranowski)
- `discovery.nerve` discovers scrape targets from AirBnB's Nerve. (@tpaschalis)
- `discovery.serverset` discovers Serversets stored in Zookeeper. (@thampiotr)
- `discovery.scaleway` discovers scrape targets from Scaleway virtual
instances and bare-metal machines. (@rfratto)
- `discovery.serverset` discovers Serversets stored in Zookeeper. (@thampiotr)
- `discovery.triton` discovers scrape targets from Triton Container Monitor. (@erikbaranowski)
- `faro.receiver` accepts Grafana Faro-formatted telemetry data over the
network and forwards it to other components. (@megumish, @rfratto)
- `prometheus.exporter.azure` collects metrics from Azure. (@wildum)
- `discovery.dockerswarm` discovers scrape targets from Docker Swarm. (@wildum)
- `otelcol.connector.servicegraph` creates service graph metrics from spans. It is the
flow mode equivalent to static mode's `service_graphs` processor. (@ptodev)
flow mode equivalent to static mode's `service_graphs` processor. (@ptodev)
- `otelcol.connector.spanlogs` creates logs from spans. It is the flow mode equivalent
to static mode's `automatic_logging` processor. (@ptodev)
to static mode's `automatic_logging` processor. (@ptodev)
- `otelcol.processor.k8sattributes` adds Kubernetes metadata as resource attributes
to spans, logs, and metrics. (@acr92)
to spans, logs, and metrics. (@acr92)
- `otelcol.processor.probabilistic_sampler` samples logs and traces based on configuration options. (@mar4uk)
- `otelcol.processor.transform` transforms OTLP telemetry data using the
OpenTelemetry Transformation Language (OTTL). It is most commonly used
for transformations on attributes.
- `remote.kubernetes.configmap` loads a configmap's data for use in other components (@captncraig)
- `remote.kubernetes.secret` loads a secret's data for use in other components (@captncraig)
- `prometheus.exporter.agent` exposes the agent's internal metrics. (@hainenber)
- `prometheus.exporter.azure` collects metrics from Azure. (@wildum)
- `prometheus.exporter.cadvisor` exposes cAdvisor metrics. (@tpaschalis)
- `prometheus.exporter.vsphere` exposes vmware vsphere metrics. (@marctc)
- `remote.kubernetes.configmap` loads a configmap's data for use in other components (@captncraig)
- `remote.kubernetes.secret` loads a secret's data for use in other components (@captncraig)

- Flow: allow the HTTP server to be configured with TLS in the config file
using the new `http` config block. (@rfratto)
Expand Down Expand Up @@ -182,6 +181,9 @@ v0.37.0-rc.0 (2023-10-05)

- Fixed a bug where Flow agent fails to load `comment` statement in `argument` block. (@hainenber)

- Fix initialization of the RAPL collector for the node_exporter integration
and the prometheus.exporter.unix component. (@marctc)

### Other changes

- Use Go 1.21.1 for builds. (@rfratto)
Expand Down
19 changes: 12 additions & 7 deletions component/common/loki/wal/timer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,32 @@ import (
)

const (
delta = time.Millisecond * 20
maxOvershoot = 200 * time.Millisecond
)

func TestBackoffTimer(t *testing.T) {
var min = time.Millisecond * 300
var max = time.Second
timer := newBackoffTimer(min, max)

now := time.Now()
start := time.Now()
<-timer.C
require.WithinDuration(t, now.Add(min), time.Now(), delta, "expected backing off timer to fire in the minimum")
verifyElapsedTime(t, min, time.Since(start))

// backoff, and expect it will take twice the time
now = time.Now()
start = time.Now()
timer.backoff()
<-timer.C
require.WithinDuration(t, now.Add(min*2), time.Now(), delta, "expected backing off timer to fire in the twice the minimum")
verifyElapsedTime(t, 2*min, time.Since(start))

// backoff capped, backoff will actually be 1200ms, but capped at 1000
now = time.Now()
start = time.Now()
timer.backoff()
<-timer.C
require.WithinDuration(t, now.Add(max), time.Now(), delta, "expected backing off timer to fire in the max")
verifyElapsedTime(t, max, time.Since(start))
}

func verifyElapsedTime(t *testing.T, expected time.Duration, elapsed time.Duration) {
require.GreaterOrEqual(t, elapsed, expected, "elapsed time should be greater or equal to the expected value")
require.Less(t, elapsed, expected+maxOvershoot, "elapsed time should be less than the expected value plus the max overshoot")
}
5 changes: 3 additions & 2 deletions component/discovery/consulagent/promtail_consulagent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,15 @@ func TestAllServices(t *testing.T) {

ctx, cancel := context.WithCancel(context.Background())
ch := make(chan []*targetgroup.Group)
done := make(chan struct{})
go func() {
d.Run(ctx, ch)
close(ch)
done <- struct{}{}
}()
checkOneTarget(t, <-ch)
checkOneTarget(t, <-ch)
cancel()
<-ch
<-done
}

// targetgroup with no targets is emitted if no services were discovered.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ To collect metrics from a custom set of targets, complete the following steps:

* To explicitly specify which HTTP path to collect metrics from, set
the `__metrics_path__` key to the HTTP path to use. If the
`__metrics_path__` key is not provided, the protocol to use is
`__metrics_path__` key is not provided, the path to use is
inherited by the settings of the `prometheus.scrape` component
(default `"/metrics"`).

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/reference/components/loki.write.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ You can create a `loki.write` component that sends your log entries to a managed
```river
loki.write "default" {
endpoint {
url = "https://logs-xxx.grafana.net"
url = "https://logs-xxx.grafana.net/loki/api/v1/push"
basic_auth {
username = env("LOKI_USERNAME")
password = env("GRAFANA_CLOUD_API_KEY")
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/operator/deploy-agent-operator-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ To deploy the `GrafanaAgent` resource:
labels:
app: grafana-agent
spec:
image: grafana/agent:v0.37.0-rc.0
image: grafana/agent:v0.37.0-rc.1
integrations:
selector:
matchLabels:
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 @@ -79,7 +79,7 @@ To install Agent Operator:
serviceAccountName: grafana-agent-operator
containers:
- name: operator
image: grafana/agent-operator:v0.37.0-rc.0
image: grafana/agent-operator:v0.37.0-rc.1
args:
- --kubelet-service=default/kubelet
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,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.37.0-rc.0 \
grafana/agent:v0.37.0-rc.1 \
--config.file=/etc/agent-config/agent.yaml
```

Expand Down Expand Up @@ -70,7 +70,7 @@ metadata:
name: agent
spec:
containers:
- image: grafana/agent:v0.37.0-rc.0
- image: grafana/agent:v0.37.0-rc.1
name: agent
args:
- --config.file=/etc/agent-config/agent.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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.37.0-rc.0 \
grafana/agent:v0.37.0-rc.1 \
--config.file=/etc/agent-config/agent.yaml
```

Expand All @@ -39,7 +39,7 @@ metadata:
name: agent
spec:
containers:
- image: grafana/agent:v0.37.0-rc.0
- image: grafana/agent:v0.37.0-rc.1
name: agent
args:
- --config.file=/etc/agent-config/agent.yaml
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/static/set-up/install/install-agent-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ To run a Grafana Agent Docker container on Linux, run the following command in a
docker run \
-v WAL_DATA_DIRECTORY:/etc/agent/data \
-v CONFIG_FILE_PATH:/etc/agent/agent.yaml \
grafana/agent:v0.37.0-rc.0
grafana/agent:v0.37.0-rc.1
```

Replace `CONFIG_FILE_PATH` with the configuration file path on your Linux host system.
Expand All @@ -51,7 +51,7 @@ To run a Grafana Agent Docker container on Windows, run the following command in
docker run ^
-v WAL_DATA_DIRECTORY:C:\etc\grafana-agent\data ^
-v CONFIG_FILE_PATH:C:\etc\grafana-agent ^
grafana/agent:v0.37.0-rc.0-windows
grafana/agent:v0.37.0-rc.1-windows
```

Replace the following:
Expand Down
4 changes: 4 additions & 0 deletions pkg/integrations/node_exporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,10 @@ func (c *Config) mapConfigToNodeConfig() *collector.NodeCollectorConfig {
OldDeviceExclude: &blankString,
}

cfg.Rapl = collector.RaplConfig{
ZoneLabel: &blankBool,
}

cfg.Systemd = collector.SystemdConfig{
UnitInclude: &c.SystemdUnitInclude,
UnitIncludeSet: true,
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.37.0-rc.0"
DefaultAgentVersion = "v0.37.0-rc.1"
DefaultAgentBaseImage = "grafana/agent"
DefaultAgentImage = DefaultAgentBaseImage + ":" + DefaultAgentVersion
)
Expand Down
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.37.0-rc.0
image: grafana/agent:v0.37.0-rc.1
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.37.0-rc.0
image: grafana/agent:v0.37.0-rc.1
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.37.0-rc.0
image: grafana/agent:v0.37.0-rc.1
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.37.0-rc.0'
'grafana/agent:v0.37.0-rc.1'
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.37.0-rc.0',
agent_operator: 'grafana/agent-operator:v0.37.0-rc.0',
agent: 'grafana/agent:v0.37.0-rc.1',
agent_operator: 'grafana/agent-operator:v0.37.0-rc.1',
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.37.0-rc.0
MANIFEST_BRANCH=v0.37.0-rc.1
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.37.0-rc.0
image: grafana/agent-operator:v0.37.0-rc.1
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.37.0-rc.0
image: grafana/agent:v0.37.0-rc.1
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.37.0-rc.0',
agentctl: 'grafana/agentctl:v0.37.0-rc.0',
agent: 'grafana/agent:v0.37.0-rc.1',
agentctl: 'grafana/agentctl:v0.37.0-rc.1',
},

// 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.37.0-rc.0',
agentctl: 'grafana/agentctl:v0.37.0-rc.0',
agent: 'grafana/agent:v0.37.0-rc.1',
agentctl: 'grafana/agentctl:v0.37.0-rc.1',
},
_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.37.0-rc.0',
image: 'grafana/agentctl:v0.37.0-rc.1',
schedule: '*/5 * * * *',
configs: [],
} + config,
Expand Down

0 comments on commit 8825874

Please sign in to comment.