Skip to content

Commit

Permalink
Merge pull request grafana#89 from grafana/main
Browse files Browse the repository at this point in the history
[release-5.6] Update from upstream/main repository
  • Loading branch information
periklis authored Nov 30, 2022
2 parents 5182f7e + 54e6c19 commit 434e4d0
Show file tree
Hide file tree
Showing 44 changed files with 2,489 additions and 410 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* [7731](https://github.com/grafana/loki/pull/7731) **bitkill**: Add healthchecks to the docker-compose example.
* [7759](https://github.com/grafana/loki/pull/7759) **kavirajk**: Improve error message for loading config with ENV variables.
* [7785](https://github.com/grafana/loki/pull/7785) **dannykopping**: Add query blocker for queries and rules.
* [7804](https://github.com/grafana/loki/pull/7804) **sandeepsukhani**: Use grpc for communicating with compactor for query time filtering of data requested for deletion.

##### Fixes

Expand Down
2 changes: 1 addition & 1 deletion clients/pkg/promtail/targets/cloudflare/fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var (
allFields = append(extendedFields, []string{
"BotScore", "BotScoreSrc", "ClientRequestBytes", "ClientSrcPort", "ClientXRequestedWith", "CacheTieredFill", "EdgeResponseCompressionRatio", "EdgeServerIP", "FirewallMatchesSources",
"FirewallMatchesActions", "FirewallMatchesRuleIDs", "OriginResponseBytes", "OriginResponseTime", "ClientDeviceType", "WAFFlags", "WAFMatchedVar", "EdgeColoID",
"RequestHeaders", "ResponseHeaders",
"RequestHeaders", "ResponseHeaders",
}...)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func Test_validateJobName(t *testing.T) {
},
},
},
wantErr: false,
wantErr: false,
expectedJob: "job_1_2_3_4_job",
},
}
Expand Down
4 changes: 4 additions & 0 deletions docs/sources/configuration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2911,6 +2911,10 @@ This way, one doesn't have to replicate configuration in multiple places.
# CLI flag: -common.compactor-address
[compactor_address: <string> | default = ""]

# Address and port number where the compactor grpc requests are being served.
# CLI flag: -common.compactor-grpc-address
[compactor_grpc_address: <string> | default = ""]

## analytics

The `analytics` block configures the reporting of Loki analytics to grafana.com.
Expand Down
112 changes: 74 additions & 38 deletions docs/sources/installation/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ null
<td>string</td>
<td></td>
<td><pre lang="json">
"{{- if .Values.enterprise.adminApi.enabled }}\n{{- if or .Values.minio.enabled (eq .Values.loki.storage.type \"s3\") (eq .Values.loki.storage.type \"gcs\") }}\nadmin_client:\n storage:\n s3:\n bucket_name: {{ .Values.loki.storage.bucketNames.admin }}\n{{- end }}\n{{- end }}\nauth:\n type: {{ .Values.enterprise.adminApi.enabled | ternary \"enterprise\" \"trust\" }}\nauth_enabled: {{ .Values.loki.auth_enabled }}\ncluster_name: {{ include \"loki.clusterName\" . }}\nlicense:\n path: /etc/loki/license/license.jwt\n"
"{{- if .Values.enterprise.adminApi.enabled }}\n{{- if or .Values.minio.enabled (eq .Values.loki.storage.type \"s3\") (eq .Values.loki.storage.type \"gcs\") (eq .Values.loki.storage.type \"azure\") }}\nadmin_client:\n storage:\n s3:\n bucket_name: {{ .Values.loki.storage.bucketNames.admin }}\n{{- end }}\n{{- end }}\nauth:\n type: {{ .Values.enterprise.adminApi.enabled | ternary \"enterprise\" \"trust\" }}\nauth_enabled: {{ .Values.loki.auth_enabled }}\ncluster_name: {{ include \"loki.clusterName\" . }}\nlicense:\n path: /etc/loki/license/license.jwt\n"
</pre>
</td>
</tr>
Expand All @@ -81,12 +81,21 @@ null
<td><pre lang="json">
false
</pre>
</td>
</tr>
<tr>
<td>enterprise.externalConfigName</td>
<td>string</td>
<td>Name of the external config secret to use</td>
<td><pre lang="json">
""
</pre>
</td>
</tr>
<tr>
<td>enterprise.externalLicenseName</td>
<td>string</td>
<td>Name of external licesne secret to use</td>
<td>Name of external license secret to use</td>
<td><pre lang="json">
null
</pre>
Expand Down Expand Up @@ -157,6 +166,7 @@ null
"annotations": {},
"enabled": true,
"env": [],
"extraVolumeMounts": [],
"image": {
"pullPolicy": "IfNotPresent",
"registry": "docker.io",
Expand Down Expand Up @@ -202,6 +212,15 @@ true
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>enterprise.provisioner.extraVolumeMounts</td>
<td>list</td>
<td>Volume mounts to add to the provisioner pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -318,6 +337,7 @@ null
"extraVolumeMounts": [],
"extraVolumes": [],
"labels": {},
"priorityClassName": "",
"securityContext": {
"fsGroup": 10001,
"runAsGroup": 10001,
Expand Down Expand Up @@ -400,6 +420,15 @@ true
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
<td>enterprise.tokengen.priorityClassName</td>
<td>string</td>
<td>The name of the PriorityClass for tokengen Pods</td>
<td><pre lang="json">
""
</pre>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -712,6 +741,15 @@ false
}
]
</pre>
</td>
</tr>
<tr>
<td>gateway.ingress.ingressClassName</td>
<td>string</td>
<td>Ingress Class Name. MAY be required for Kubernetes versions >= 1.18</td>
<td><pre lang="json">
""
</pre>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -1030,6 +1068,15 @@ false
<td><pre lang="json">
"loki.example.com"
</pre>
</td>
</tr>
<tr>
<td>ingress.ingressClassName</td>
<td>string</td>
<td></td>
<td><pre lang="json">
""
</pre>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -1192,6 +1239,15 @@ false
<td><pre lang="json">
"/loki/api/v1/push"
</pre>
</td>
</tr>
<tr>
<td>ingress.tls</td>
<td>list</td>
<td></td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -1501,6 +1557,13 @@ null
<td>Storage config. Providing this will automatically populate all necessary storage configs in the templated config.</td>
<td><pre lang="json">
{
"azure": {
"accountKey": null,
"accountName": null,
"requestTimeout": null,
"useManagedIdentity": false,
"userAssignedId": null
},
"bucketNames": {
"admin": "admin",
"chunks": "chunks",
Expand Down Expand Up @@ -1637,42 +1700,6 @@ false
"rootUser": "enterprise-logs"
}
</pre>
</td>
</tr>
<tr>
<td>monitoring.alerts.annotations</td>
<td>object</td>
<td>Additional annotations for the alerts PrometheusRule resource</td>
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
<td>monitoring.alerts.enabled</td>
<td>bool</td>
<td>If enabled, create PrometheusRule resource with Loki alerting rules</td>
<td><pre lang="json">
true
</pre>
</td>
</tr>
<tr>
<td>monitoring.alerts.labels</td>
<td>object</td>
<td>Additional labels for the alerts PrometheusRule resource</td>
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
<td>monitoring.alerts.namespace</td>
<td>string</td>
<td>Alternative namespace to create alerting rules PrometheusRule resource in</td>
<td><pre lang="json">
null
</pre>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -2592,6 +2619,15 @@ true
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>serviceAccount.labels</td>
<td>object</td>
<td>Labels for the service account</td>
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
Expand Down
1 change: 1 addition & 0 deletions integration/loki_micro_services_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/grafana/loki/integration/client"
"github.com/grafana/loki/integration/cluster"

"github.com/grafana/loki/pkg/storage"
)

Expand Down
1 change: 1 addition & 0 deletions operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Main

- [7815](https://github.com/grafana/loki/pull/7815) **periklis**: Apply delete client changes for compat with release-2.7.x
- [7809](https://github.com/grafana/loki/pull/7809) **xperimental**: Fix histogram-based alerting rules
- [7808](https://github.com/grafana/loki/pull/7808) **xperimental**: Replace fifocache usage by embedded_cache
- [7753](https://github.com/grafana/loki/pull/7753) **periklis**: Check for mandatory CA configmap name in ObjectStorageTLS spec
Expand Down
3 changes: 1 addition & 2 deletions operator/internal/manifests/internal/config/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2440,7 +2440,7 @@ querier:
max_concurrent: 2
query_ingesters_within: 3h
tail_max_duration: 1h
compactor_client:
delete_client:
tls_enabled: true
tls_cert_path: /var/run/tls/http/tls.crt
tls_key_path: /var/run/tls/http/tls.key
Expand Down Expand Up @@ -2631,7 +2631,6 @@ overrides:
}
cfg, rCfg, err := Build(opts)
require.NoError(t, err)
t.Log(string(cfg))
require.YAMLEq(t, expCfg, string(cfg))
require.YAMLEq(t, expRCfg, string(rCfg))
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ querier:
tail_max_duration: 1h
max_concurrent: {{ .MaxConcurrent.AvailableQuerierCPUCores }}
{{- if .Gates.HTTPEncryption }}
compactor_client:
delete_client:
tls_enabled: true
tls_cert_path: {{ .TLS.Paths.HTTP.Certificate }}
tls_key_path: {{ .TLS.Paths.HTTP.Key }}
Expand Down
4 changes: 2 additions & 2 deletions pkg/logql/syntax/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ var tokens = map[string]int{
OpParserTypePattern: PATTERN,

// fmt
OpFmtLabel: LABEL_FMT,
OpFmtLine: LINE_FMT,
OpFmtLabel: LABEL_FMT,
OpFmtLine: LINE_FMT,

// filter functions
OpFilterIP: IP,
Expand Down
3 changes: 2 additions & 1 deletion pkg/logqlmodel/logqlmodel.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package logqlmodel

import (
"github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions"
"github.com/prometheus/prometheus/promql/parser"

"github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions"

"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/logqlmodel/stats"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/logqlmodel/metadata/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"errors"
"testing"

"github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions"
"github.com/stretchr/testify/require"

"github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions"
)

func TestHeaders(t *testing.T) {
Expand Down
4 changes: 4 additions & 0 deletions pkg/loki/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ type Config struct {

// CompactorAddress is the http address of the compactor in the form http://host:port
CompactorAddress string `yaml:"compactor_address"`

// CompactorAddress is the grpc address of the compactor in the form host:port
CompactorGRPCAddress string `yaml:"compactor_grpc_address"`
}

func (c *Config) RegisterFlags(f *flag.FlagSet) {
Expand All @@ -57,6 +60,7 @@ func (c *Config) RegisterFlags(f *flag.FlagSet) {
throwaway.Var((*flagext.StringSlice)(&c.InstanceInterfaceNames), "common.instance-interface-names", "List of network interfaces to read address from.")

f.StringVar(&c.CompactorAddress, "common.compactor-address", "", "the http address of the compactor in the form http://host:port")
f.StringVar(&c.CompactorGRPCAddress, "common.compactor-grpc-address", "", "the grpc address of the compactor in the form host:port")
}

type Storage struct {
Expand Down
Loading

0 comments on commit 434e4d0

Please sign in to comment.