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

processor_labels: Add a documentation for processor_labels #1371

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cosmo0920
Copy link
Contributor

Corresponding to fluent/fluent-bit#8824

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@cosmo0920 cosmo0920 force-pushed the cosmo0920-add-processor-labels-doc branch from 4a73996 to 11bc012 Compare May 15, 2024 06:23
This is because using hash algorithm is actually SHA-256.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
pipeline/processors/labels.md Outdated Show resolved Hide resolved

| Key | Description |
| :---------- | :--- |
| update | Update an existing key with a value into metrics. The key-value pair is required. |
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if it does not exist? Failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, just dismissed the operation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you clarify that in the docs? Some things seem to error and some ignore so useful to know.

| update | Update an existing key with a value into metrics. The key-value pair is required. |
| insert | Insert a new key with a value into metrics. The key-value pair is required. |
| upsert | Upsert a specific key with a value, the `upsert` operation will try to update the value of the key. If the key does not exist, the key will be created. The key-value pair is required. |
| delete | Delete a key from the labels of metrics. The key-value pair is required. |
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if it does not exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just ignored and dismissed in that case.

| :---------- | :--- |
| update | Update an existing key with a value into metrics. The key-value pair is required. |
| insert | Insert a new key with a value into metrics. The key-value pair is required. |
| upsert | Upsert a specific key with a value, the `upsert` operation will try to update the value of the key. If the key does not exist, the key will be created. The key-value pair is required. |
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like the option to always use :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, but it's both of effective whether existing the key or not. :)

| Key | Description |
| :---------- | :--- |
| update | Update an existing key with a value into metrics. The key-value pair is required. |
| insert | Insert a new key with a value into metrics. The key-value pair is required. |
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if it exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just ignored in that case on fluent/fluent-bit#8824 patch.

| insert | Insert a new key with a value into metrics. The key-value pair is required. |
| upsert | Upsert a specific key with a value, the `upsert` operation will try to update the value of the key. If the key does not exist, the key will be created. The key-value pair is required. |
| delete | Delete a key from the labels of metrics. The key-value pair is required. |
| hash | Replace the key value with a hash generated by the SHA-256 algorithm from the specified label name, the binary value generated is finally set as an hex string representation. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Weirdly specific option - can we change the hash algorithm and other stuff in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure. But I suppose that we shouldn't do this. Because there is no reason to use weaker hash algorithms such as SHA-1 or MD5.

Signed-off-by: Pat <patrick.j.k.stephens@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants