Skip to content

Commit

Permalink
Merge v0.18.2 to main (#822)
Browse files Browse the repository at this point in the history
* Initialize biggest ref to existing ref when reading a segment (#676)

* initialize biggest ref to existing ref when reading a segment

* changelog

* allow new test to be less hard-coded

* explain error if test fails

* clarify changelog issue

* prepare for v0.16.1 release (#679)

* adding docker-compose example for local testing

(cherry picked from commit 992e3cf)

* Cherry picking kafka importer

* update Operator FAQ to describe custom scrape jobs (#658)

* Merge

* merge for race condition

* Wall cherry pick

* Import Kafka

* Bump version number to v0.17.0

* Initial release of v0.18.0 includes github_exporter, enabled flag issue, OTLP HTPP, and updated postgres exporter

* Tempo/traces docs fixes for v0.18.0 (#784)

* Needs to be loki for the naming change

* Update date

* No change, just trying to trigger drone

* Fix for drone naming

* Changes that needed to me imported for drone to work.

* Update drone issues

* sign drone

* Drone changes

* Update operator

* standardize on seego

* Test tag

* fix tag

* updated makefile

* release tag fixing

* remove extra tag

* consul specific list support added

* Fix type

* Add comment

* Fix for etcd issue that I introduced

* Update to v0.18.1

* Fix for test error

* Fix small naming/style issues

* Update version number to v0.18.2 and fix issues with prefixes.

* Update missed merges

* Add operate allowed version

Co-authored-by: Robert Fratto <robert.fratto@grafana.com>
Co-authored-by: Gabriel <g.amaral.antunes@gmail.com>
Co-authored-by: Mario <mariorvinas@gmail.com>
  • Loading branch information
4 people authored Aug 12, 2021
1 parent f4cb115 commit b5416fd
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 21 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
`backend: logs_instance`. (@rfratto)


# v0.18.2 (2021-08-12)

- [BUGFIX] Honor the prefix and remove prefix from consul list results (@mattdurham)

# v0.18.1 (2021-08-09)

- [BUGFIX] Reduce number of consul calls when ran in scrape service mode (@mattdurham)
Expand Down
2 changes: 1 addition & 1 deletion docs/operator/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:
serviceAccountName: grafana-agent-operator
containers:
- name: operator
image: grafana/agent-operator:v0.18.1
image: grafana/agent-operator:v0.18.2
---

apiVersion: v1
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var (
"v0.17.0",
"v0.18.0",
"v0.18.1",
"v0.18.2",

// NOTE(rfratto): when performing an upgrade, add the newest version above instead of changing the existing reference.
}
Expand Down
23 changes: 12 additions & 11 deletions pkg/prom/instance/configstore/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (

"github.com/weaveworks/common/instrument"

"github.com/cortexproject/cortex/pkg/ring/kv/consul"

"github.com/hashicorp/go-cleanhttp"

"github.com/hashicorp/consul/api"
Expand Down Expand Up @@ -59,8 +57,8 @@ type Remote struct {
// consul kv stores
type agentRemoteClient struct {
kv.Client
consul *api.Client
consulConfig consul.Config
consul *api.Client
config kv.Config
}

// NewRemote creates a new Remote store that uses a Key-Value client to store
Expand Down Expand Up @@ -102,7 +100,7 @@ func (r *Remote) ApplyConfig(cfg kv.Config, enable bool) error {
r.reg.UnregisterAll()

if !enable {
r.setClient(nil, nil)
r.setClient(nil, nil, kv.Config{})
return nil
}

Expand All @@ -129,19 +127,20 @@ func (r *Remote) ApplyConfig(cfg kv.Config, enable bool) error {
return fmt.Errorf("failed to create kv client: %w", err)
}

r.setClient(cli, consulClient)
r.setClient(cli, consulClient, cfg)
return nil
}

// setClient sets the active client and notifies run to restart the
// kv watcher.
func (r *Remote) setClient(client kv.Client, consulClient *api.Client) {
func (r *Remote) setClient(client kv.Client, consulClient *api.Client, config kv.Config) {
if client == nil && consulClient == nil {
r.kv = nil
} else {
r.kv = &agentRemoteClient{
Client: client,
consul: consulClient,
config: config,
}
}
r.reloadKV <- struct{}{}
Expand Down Expand Up @@ -227,14 +226,13 @@ func (r *Remote) listConsul(ctx context.Context) (api.KVPairs, error) {

var pairs api.KVPairs
options := &api.QueryOptions{
AllowStale: !r.kv.consulConfig.ConsistentReads,
RequireConsistent: r.kv.consulConfig.ConsistentReads,
AllowStale: !r.kv.config.Consul.ConsistentReads,
RequireConsistent: r.kv.config.Consul.ConsistentReads,
}
// This is copied from cortex list so that stats stay the same
err := instrument.CollectedRequest(ctx, "List", consulRequestDuration, instrument.ErrorCode, func(ctx context.Context) error {
var err error
// This mirrors the default prefix in cortex
pairs, _, err = r.kv.consul.KV().List("configurations/", options.WithContext(ctx))
pairs, _, err = r.kv.consul.KV().List(r.kv.config.Prefix, options.WithContext(ctx))
return err
})

Expand All @@ -246,6 +244,9 @@ func (r *Remote) listConsul(ctx context.Context) (api.KVPairs, error) {
blankPairs := make(api.KVPairs, 0)
return blankPairs, nil
}
for _, kvp := range pairs {
kvp.Key = strings.TrimPrefix(kvp.Key, r.kv.config.Prefix)
}
return pairs, nil
}

Expand Down
2 changes: 1 addition & 1 deletion production/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ directory on your host that you want the agent to store its WAL.
docker run \
-v /tmp/agent:/etc/agent/data \
-v /path/to/config.yaml:/etc/agent/agent.yaml \
grafana/agent:v0.18.1
grafana/agent:v0.18.2
```

## Running the Agent locally
Expand Down
2 changes: 1 addition & 1 deletion production/grafanacloud-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PACKAGE_SYSTEM=${PACKAGE_SYSTEM:=}
#
# Global constants.
#
RELEASE_VERSION="0.18.1"
RELEASE_VERSION="0.18.2"

RELEASE_URL="https://github.com/grafana/agent/releases/download/v${RELEASE_VERSION}"
DEB_URL="${RELEASE_URL}/grafana-agent-${RELEASE_VERSION}-1.${ARCH}.deb"
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 @@ -66,7 +66,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: grafana/agent:v0.18.1
image: grafana/agent:v0.18.2
imagePullPolicy: IfNotPresent
name: 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 @@ -64,7 +64,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: grafana/agent:v0.18.1
image: grafana/agent:v0.18.2
imagePullPolicy: IfNotPresent
name: agent
ports:
Expand Down
2 changes: 1 addition & 1 deletion production/kubernetes/agent-tempo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: grafana/agent:v0.18.1
image: grafana/agent:v0.18.2
imagePullPolicy: IfNotPresent
name: agent
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.18.1'
'grafana/agent:v0.18.2'
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.18.1
MANIFEST_BRANCH=v0.18.2
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/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/tempo.libsonnet') +
{
_images:: {
agent: 'grafana/agent:v0.18.1',
agentctl: 'grafana/agentctl:v0.18.1',
agent: 'grafana/agent:v0.18.2',
agentctl: 'grafana/agentctl:v0.18.2',
},

// new creates a new DaemonSet deployment of the grafana-agent. By default,
Expand Down

0 comments on commit b5416fd

Please sign in to comment.