Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitRay9615 authored Nov 21, 2024
2 parents 2428803 + 733d99f commit b48615c
Show file tree
Hide file tree
Showing 69 changed files with 416 additions and 2,803 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/helm-tagged-release-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
bash .github/workflows/scripts/helm-tagged-release.sh ${RELEASE_VERSION}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.get_github_app_token.outputs.token }}
title: "chore: release loki helm chart ${{ steps.update.outputs.new_chart_version }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/helm-weekly-release-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
bash .github/workflows/scripts/helm-weekly-release.sh -k
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.get_github_app_token.outputs.token }}
title: "chore: release loki helm chart ${{ steps.update-k.outputs.new_chart_version }}"
Expand All @@ -57,7 +57,7 @@ jobs:
bash .github/workflows/scripts/helm-weekly-release.sh
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.get_github_app_token.outputs.token }}
title: "chore: release loki helm chart ${{ steps.update.outputs.new_chart_version }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
id: go
- uses: actions/checkout@v4
- name: Lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
args: --timeout=5m
Expand Down
2 changes: 1 addition & 1 deletion clients/cmd/promtail/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// embed time zone data
_ "time/tzdata"

"k8s.io/klog"
"k8s.io/klog/v2"

"github.com/go-kit/log/level"
"github.com/grafana/dskit/flagext"
Expand Down
2 changes: 1 addition & 1 deletion clients/pkg/promtail/targets/serverutils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package serverutils
import (
"flag"

"dario.cat/mergo"
"github.com/grafana/dskit/server"
"github.com/imdario/mergo"
)

// MergeWithDefaults applies server.Config defaults to a given and different server.Config.
Expand Down
12 changes: 8 additions & 4 deletions docs/sources/get-started/labels/structured-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ You should only use structured metadata in the following situations:

- If you are ingesting data in OpenTelemetry format, using Grafana Alloy or an OpenTelemetry Collector. Structured metadata was designed to support native ingestion of OpenTelemetry data.
- If you have high cardinality metadata that should not be used as a label and does not exist in the log line. Some examples might include `process_id` or `thread_id` or Kubernetes pod names.

It is an antipattern to extract information that already exists in your log lines and put it into structured metadata.
- If you are using [Explore Logs](https://grafana.com/docs/grafana-cloud/visualizations/simplified-exploration/logs/) to visualize and explore your Loki logs.
- If you are a large-scale customer, who is ingesting more than 75TB of logs a month and are using [Bloom filters](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/bloom-filters/)

We do not recommend extracting information that already exists in your log lines and putting it into structured metadata.

## Attaching structured metadata to log lines

Expand All @@ -37,9 +39,10 @@ See the [Promtail: Structured metadata stage](https://grafana.com/docs/loki/<LOK
With Loki version 1.2.0, support for structured metadata has been added to the Logstash output plugin. For more information, see [logstash](https://grafana.com/docs/loki/<LOKI_VERSION>/send-data/logstash/).

{{< admonition type="warning" >}}
Structured metadata size is taken into account while asserting ingestion rate limiting.
Structured metadata size is taken into account while asserting ingestion rate limiting.
Along with that, there are separate limits on how much structured metadata can be attached per log line.
```

```yaml
# Maximum size accepted for structured metadata per log line.
# CLI flag: -limits.max-structured-metadata-size
[max_structured_metadata_size: <int> | default = 64KB]
Expand All @@ -48,6 +51,7 @@ Along with that, there are separate limits on how much structured metadata can b
# CLI flag: -limits.max-structured-metadata-entries-count
[max_structured_metadata_entries_count: <int> | default = 128]
```
{{< /admonition >}}
## Querying structured metadata
Expand Down
30 changes: 19 additions & 11 deletions docs/sources/query/query_accceleration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Query acceleration (Experimental)
title: Query acceleration
menuTitle: Query acceleration
description: Provides instructions on how to write LogQL queries to benefit from query acceleration.
weight: 900
Expand All @@ -8,10 +8,11 @@ keywords:
- query acceleration
---

# Query acceleration (Experimental)
# Query acceleration

{{< admonition type="warning" >}}
Query acceleration using blooms is an [experimental feature](/docs/release-life-cycle/). Engineering and on-call support is not available. No SLA is provided.
In Loki and Grafana Enterprise Logs (GEL), Query acceleration using blooms is an [experimental feature](/docs/release-life-cycle/). Engineering and on-call support is not available. No SLA is provided.
In Grafana Cloud, Query acceleration using blooms is enabled for large-scale customers that send more than 75TB of logs a month as a [public preview](/docs/release-life-cycle/) with limited support and no SLA.
{{< /admonition >}}

If [bloom filters][] are enabled, you can write LogQL queries using [structured metadata][] to benefit from query acceleration.
Expand All @@ -26,19 +27,26 @@ If [bloom filters][] are enabled, you can write LogQL queries using [structured
Queries will be accelerated for any [label filter expression][] that satisfies _all_ of the following criteria:

* The label filter expression using **string equality**, such as `| key="value"`.
* `or` and `and` operators can be used to match multiple values, such as `| detected_level="error" or detected_level="warn"`.
* _Basic_ regular expressions are automatically simplified into a supported expression:
* `| key=~"value"` is converted to `| key="value"`.
* `| key=~"value1|value2"` is converted to `| key="value1" or key="value2"`.
* `| key=~".+"` checks for existence of `key`. `.*` is not supported.
* `or` and `and` operators can be used to match multiple values, such as `| detected_level="error" or detected_level="warn"`.
* _Basic_ regular expressions are automatically simplified into a supported expression:
* `| key=~"value"` is converted to `| key="value"`.
* `| key=~"value1|value2"` is converted to `| key="value1" or key="value2"`.
* `| key=~".+"` checks for existence of `key`. `.*` is not supported.
* The label filter expression is querying for structured metadata and not a stream label.
* The label filter expression is placed before any [parser expression][], [labels format expression][], [drop labels expression][], or [keep labels expression][].

To take full advantage of query acceleration with blooms, ensure that filtering structured metadata is done before any parse expression:
To take full advantage of query acceleration with blooms, ensure that filtering structured metadata is done before any parser expression:

In the following example, the query is not accelerated because the structured metadata filter, `detected_level="error"`, is after a parser stage, `json`.

```logql
{cluster="prod"} | logfmt | json | detected_level="error"
```

In the following example, the query is accelerated because the structured metadata filter is before any parser stage.

```logql
{cluster="prod"} | logfmt | json | detected_level="error" # NOT ACCELERATED: structured metadata filter is after a parse stage
{cluster="prod"} | detected_level="error" | logfmt | json # ACCELERATED: structured metadata filter is before any parse stage
{cluster="prod"} | detected_level="error" | logfmt | json
```

[bloom filters]: https://grafana.com/docs/loki/<LOKI_VERSION>/operations/bloom-filters/
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/send-data/promtail/cloud/eks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ initContainer:

image:
repository: grafana/promtail
tag: 3.2.1
tag: 3.3.0
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
Expand Down
6 changes: 3 additions & 3 deletions docs/sources/setup/install/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3062,7 +3062,7 @@ null
"pullPolicy": "IfNotPresent",
"registry": "docker.io",
"repository": "grafana/enterprise-logs",
"tag": null
"tag": "3.3.0"
},
"license": {
"contents": "NOTAVALIDLICENSE"
Expand Down Expand Up @@ -3235,7 +3235,7 @@ null
<td>string</td>
<td>Docker image tag</td>
<td><pre lang="json">
null
"3.3.0"
</pre>
</td>
</tr>
Expand Down Expand Up @@ -6090,7 +6090,7 @@ null
<td>string</td>
<td>Overrides the image tag whose default is the chart's appVersion</td>
<td><pre lang="json">
null
"3.3.0"
</pre>
</td>
</tr>
Expand Down
19 changes: 9 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
cloud.google.com/go/bigtable v1.33.0
cloud.google.com/go/pubsub v1.45.1
cloud.google.com/go/storage v1.47.0
dario.cat/mergo v1.0.1
github.com/Azure/azure-pipeline-go v0.2.3
github.com/Azure/azure-storage-blob-go v0.15.0
github.com/Azure/go-autorest/autorest/adal v0.9.24
Expand Down Expand Up @@ -55,11 +56,10 @@ require (
github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc
github.com/grafana/tail v0.0.0-20230510142333-77b18831edf0
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645
github.com/hashicorp/consul/api v1.30.0
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/imdario/mergo v0.3.16
github.com/influxdata/telegraf v1.16.3
github.com/jmespath/go-jmespath v0.4.0
github.com/joncrlsn/dque v0.0.0-20211108142734-c2ef48c5192a
Expand Down Expand Up @@ -90,7 +90,7 @@ require (
github.com/segmentio/fasthash v1.0.3
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546
github.com/sony/gobreaker v0.5.0
github.com/sony/gobreaker/v2 v2.0.0
github.com/spf13/afero v1.11.0
github.com/stretchr/testify v1.9.0
github.com/uber/jaeger-client-go v2.30.0+incompatible
Expand All @@ -103,11 +103,11 @@ require (
golang.org/x/sync v0.9.0
golang.org/x/sys v0.27.0
golang.org/x/time v0.8.0
google.golang.org/api v0.206.0
google.golang.org/api v0.207.0
google.golang.org/grpc v1.68.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.130.1
)

require (
Expand Down Expand Up @@ -151,15 +151,14 @@ require (
google.golang.org/protobuf v1.35.2
gotest.tools v2.2.0+incompatible
k8s.io/apimachinery v0.31.2
k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3
k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078
)

require (
cel.dev/expr v0.16.1 // indirect
cloud.google.com/go/auth v0.10.2 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.5 // indirect
cloud.google.com/go/monitoring v1.21.2 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.1 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect
Expand All @@ -173,6 +172,7 @@ require (
github.com/goccy/go-json v0.10.3 // indirect
github.com/gorilla/handlers v1.5.2 // indirect
github.com/hashicorp/golang-lru v0.6.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
Expand Down Expand Up @@ -363,15 +363,14 @@ require (
golang.org/x/mod v0.19.0 // indirect
golang.org/x/term v0.26.0 // indirect
golang.org/x/tools v0.23.0 // indirect
google.golang.org/genproto v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f // indirect
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
k8s.io/api v0.29.3 // indirect
k8s.io/client-go v0.29.3 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
rsc.io/binaryregexp v0.2.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
Loading

0 comments on commit b48615c

Please sign in to comment.