Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add log patterns ingestion and query API. #12403

Merged
merged 64 commits into from
Apr 4, 2024

Conversation

cyriltovena
Copy link
Contributor

@cyriltovena cyriltovena commented Mar 29, 2024

What this PR does / why we need it:

This adds a new component off by default (--pattern-ingester.enabled=false) which detects and store timeseries of log patterns over time.

Right now storing those is out of scope and will only be a view of the last 6 hours in memory (configurable).

The API is as follow:

curl -v -L -d query="{service_name=\"mimir-ingester\"}"  -G  http://localhost:3100/loki/api/experimental/patterns | jq
 
{
  "status": "success",
  "data": [
    {
      "pattern": "<_> caller=grpc_logging.go:66 <_> level=info method=/cortex.Ingester/Push <_> msg=gRPC",
      "samples": [
        [
          1711727470,
          103
        ],
        [
          1711727480,
          55
        ]
      ]
    },
    {
      "pattern": "<_> caller=grpc_logging.go:66 <*> level=error method=/cortex.Ingester/Push <_> msg=gRPC err=\"connection refused to object store\"",
      "samples": [
        [
          1711727460,
          2
        ],
        [
          1711727470,
          2
        ]
      ]
    }
  ]
}

start and end can also be provided to filter by time.
query is a label matcher selector.

The returned json returned samples a list with where the first value is timestamp and the next value is count of log matched for the given timestamp.

Special notes for your reviewer:

todo:

  • Rolling out timeseries so we don't OOM
  • Add jsonnet code.
  • Add helm integrations.
  • Add API documentation

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
    • If the change is worth mentioning in the release notes, add add-to-release-notes label
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@cyriltovena cyriltovena marked this pull request as ready for review April 4, 2024 20:25
@cyriltovena cyriltovena requested a review from a team as a code owner April 4, 2024 20:25
Copy link
Collaborator

@slim-bean slim-bean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

cyriltovena and others added 2 commits April 4, 2024 23:02
@slim-bean slim-bean merged commit 491d251 into grafana:main Apr 4, 2024
11 checks passed
grafanabot added a commit that referenced this pull request Apr 4, 2024
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
Signed-off-by: Edward Welch <[email protected]>
Co-authored-by: Anton Kolesnikov <[email protected]>
Co-authored-by: Sven Grossmann <[email protected]>
Co-authored-by: Edward Welch <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add-to-release-notes size/XXL type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants