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

Add docs for non-indexed labels #10073

Merged
merged 25 commits into from
Aug 24, 2023
Merged

Conversation

salvacorts
Copy link
Contributor

@salvacorts salvacorts commented Jul 26, 2023

What this PR does / why we need it:

Adds documentation for the new experimental non-indexed labels feature.

@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Jul 26, 2023
docs/sources/get-started/labels/_index.md Outdated Show resolved Hide resolved
docs/sources/get-started/labels/_index.md Outdated Show resolved Hide resolved
docs/sources/get-started/labels/bp-labels.md Outdated Show resolved Hide resolved
docs/sources/get-started/labels/non-indexed-labels.md Outdated Show resolved Hide resolved
docs/sources/get-started/labels/non-indexed-labels.md Outdated Show resolved Hide resolved
docs/sources/get-started/labels/non-indexed-labels.md Outdated Show resolved Hide resolved
docs/sources/reference/api.md Outdated Show resolved Hide resolved
salvacorts and others added 9 commits July 28, 2023 11:05
Co-authored-by: J Stickler <julie.stickler@grafana.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

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

Left just 2 minor nits. It looks good to me.

docs/sources/get-started/architecture.md Outdated Show resolved Hide resolved
docs/sources/reference/api.md Outdated Show resolved Hide resolved
Copy link
Contributor

@vlad-diachenko vlad-diachenko left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: Vladyslav Diachenko <82767850+vlad-diachenko@users.noreply.github.com>
For more information on how to push logs to Loki via the HTTP endpoint, refer to the [HTTP API documentation]({{< relref "../../reference/api#push-log-entries-to-loki" >}}).

Alternatively, you can use the Grafana Agent or Promtail to extract and attach non-indexed labels to your log lines.
See the [Promtail: Non-indexed labels stage]({{< relref "../../clients/promtail/stages/non-indexed-labels" >}}) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [doc-validator] reported by reviewdog 🐶
The link '{{< relref "../../clients/promtail/stages/non-indexed-labels" >}}' references a page in the project that does not exist.
Check if the page has moved within the repository.

Verify the link by building the docs locally using the make docs webserver.

Copy link
Member

@gouthamve gouthamve left a comment

Choose a reason for hiding this comment

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

Looks great! Left some minor improvements.

{job="example"} | trace_id="0242ac120002" | user_id="superUser123"
```

Note that since non-indexed labels are extracted automatically to the results labels, some metric queries might return
Copy link
Member

Choose a reason for hiding this comment

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

If traceid is driving the number of series. For example, if there are 60000 traceids, how does keep stage help?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Keep would help with filtering out high-cardinality labels similarly to drop. The example I added here is not illustrating this correctly. I've modified it by:

count_over_time({job="example"} | trace_id="0242ac120002" | keep job  [5m])

docs/sources/reference/api.md Show resolved Hide resolved
@salvacorts salvacorts marked this pull request as ready for review August 24, 2023 10:38
@salvacorts salvacorts requested a review from a team as a code owner August 24, 2023 10:38
Copy link
Contributor

@JStickler JStickler left a comment

Choose a reason for hiding this comment

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

[Docs team] LGTM

@salvacorts salvacorts merged commit 603eb63 into main Aug 24, 2023
3 checks passed
@salvacorts salvacorts deleted the salvacorts/add-docs-non-indexed-labels branch August 24, 2023 13:37
@grafanabot
Copy link
Collaborator

The backport to release-2.9.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-10073-to-release-2.9.x origin/release-2.9.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 603eb637f65efed6084ec6050aed552408f28059
# When the conflicts are resolved, stage and commit the changes
git add . && git cherry-pick --continue

If you have the GitHub CLI installed:

# Create the PR body template
PR_BODY=$(gh pr view 10073 --json body --template 'Backport 603eb637f65efed6084ec6050aed552408f28059 from #10073{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Push the branch to GitHub and a PR
echo "${PR_BODY}" | gh pr create --title "[release-2.9.x] Add docs for non-indexed labels" --body-file - --label "size/L" --label "type/docs" --label "backport" --base release-2.9.x --milestone release-2.9.x --web

Or, if you don't have the GitHub CLI installed (we recommend you install it!):

# If you don't have the GitHub CLI installed: Push the branch to GitHub and manually create a PR:
git push --set-upstream origin backport-10073-to-release-2.9.x
# Remove the local backport branch
git switch main
git branch -D backport-10073-to-release-2.9.x

Unless you've used the GitHub CLI above, now create a pull request where the base branch is release-2.9.x and the compare/head branch is backport-10073-to-release-2.9.x.

vlad-diachenko added a commit that referenced this pull request Sep 4, 2023
**What this PR does / why we need it**:

Adds documentation for the new experimental non-indexed labels feature.

---------

Co-authored-by: J Stickler <julie.stickler@grafana.com>
Co-authored-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
Co-authored-by: Vladyslav Diachenko <82767850+vlad-diachenko@users.noreply.github.com>

(cherry picked from commit 603eb63)
Signed-off-by: Vladyslav Diachenko <vlad.diachenko@grafana.com>
vlad-diachenko added a commit that referenced this pull request Sep 4, 2023
…0441)

manual backport of #10073

---------

Signed-off-by: Vladyslav Diachenko <vlad.diachenko@grafana.com>
Co-authored-by: Salva Corts <salva.corts@grafana.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
Co-authored-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-2.9.x backport-failed size/L 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.

6 participants