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

Docs feedback: decision_cache is documented as a block but behaves as an attribute #1813

Open
clayton-cornell opened this issue Oct 2, 2024 · 6 comments · May be fixed by #1822
Open

Docs feedback: decision_cache is documented as a block but behaves as an attribute #1813

clayton-cornell opened this issue Oct 2, 2024 · 6 comments · May be fixed by #1822
Assignees
Labels
type/docs Docs Squad label across all Grafana Labs repos

Comments

@clayton-cornell
Copy link
Contributor

clayton-cornell commented Oct 2, 2024

URL

https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.processor.tail_sampling/#otelcolprocessortail_sampling

Feedback

Slack discussion: https://raintank-corp.slack.com/archives/CSN5HV0CQ/p1727891950877629

According to the documentation, decision_cache is a block, and would be added to the alloy.config file as:

otelcol.processor.tail_sampling "LABEL" {
	decision_cache {
		sampled_cache_size = 100000
		}
...

This configuration generates an error similar to:

327 | decision_cache {
| _____^^^^^^^^^^^^^^^^
328 | | sampled_cache_size = 100000
329 | | }
| |_________^

The configuration works as expected if you add decision_cache formatted as an attribute like this:

	decision_cache = {
		sampled_cache_size = 100000,
		}

And confirmed here:

Image

If this is the correct behaviour, the documentation needs to be updated.

@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Oct 2, 2024
@clayton-cornell clayton-cornell self-assigned this Oct 2, 2024
@jdbaldry
Copy link
Member

jdbaldry commented Oct 2, 2024

I'm not sure about the "argument" terminology, I think the syntax reference calls these "attributes": https://grafana.com/docs/alloy/latest/get-started/configuration-syntax/syntax/#attributes

@alexwulf
Copy link

alexwulf commented Oct 3, 2024

Adding full error message received for future searchability:

Error: C:\Program Files\GrafanaLabs\Alloy\config.alloy:327:2: "decision_cache" must be an attribute, but is used as a block

327 | decision_cache {
| _____^^^^^^^^^^^^^^^^
328 | | sampled_cache_size = 100000
329 | | }
| |_________^

@jdbaldry is correct - I was saying argument in the slack thread by mistake, but was meaning to say attribute. I corrected this in the title/description.

@alexwulf alexwulf changed the title Docs feedback: decision_cache is documented as a block but behaves as an argument Docs feedback: decision_cache is documented as a block but behaves as an attribute Oct 3, 2024
@mattdurham
Copy link
Collaborator

This should have been a block, but its encoded in the config now and we cant change it without breaking backwards compat.

@clayton-cornell
Copy link
Contributor Author

@mattdurham I've opened a PR to update the docs to reflect how this was implemented in the code. Do we want to change the docs, keeping it as an attribute, or fix decision_cache in the code to promote it to a block.

@mattdurham
Copy link
Collaborator

IMO changing the code breaks the compatibility, which we could justify saying it’s a bug but I don’t feel good with that route.

@mattdurham
Copy link
Collaborator

Let’s change the docs and I will see if I can think of a new name that is correct and we mark the old one as deprecated ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants