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

SNMP exporter: Label targets block as deprecated #2274

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ptodev
Copy link
Contributor

@ptodev ptodev commented Dec 12, 2024

Since the target block is deprecated, it'd be nice to mention this in the docs #979.

In general, it's not ideal how there are so many ways to do the same thing in this components:

  • target block and targets argument
  • config_file argument and configargument

I wish we didn't have the config_file argument at all. I really don't see the benefit in it.

Using the `target` block is deprecated because it is less flexible than the `targets` argument:
* The name of the `target` block cannot contain certain characters,
because it has to comply with Alloy syntax restrictions for [block labels][syntax-blocks].
* With the `targets` argument you can also pass in additional labels.
Copy link
Contributor

Choose a reason for hiding this comment

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

most importantly, it's more flexible because you can plug it to other components and this way you don't need to update the config everytime you want to add/remove a target

@@ -334,6 +255,102 @@ The YAML file in this example looks like this:
auth: public_v2
```

## Example using the target block (deprecated)
Copy link
Contributor

Choose a reason for hiding this comment

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

did you build the docs and checked that it's correctly rendered? The github linting is showing weird colors but it's probably a lint bug because it seems ok to me

@@ -127,102 +137,9 @@ debug information.
`prometheus.exporter.snmp` does not expose any component-specific
debug metrics.

## Example
## Examples using the targets argument (recommended)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Examples using the targets argument (recommended)
## Examples using the targets argument
The following examples show you how to use `prometheus.exporter.snmp`.

I'd suggest we remove recommended here. There's no alternative deprecated example provided...

We should try to add at least a sentence of text between headings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is indeed a deprecated example:

## Example using the target block (deprecated)

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh.. ooops. missed that. The comment about collapsed section similar to the linked example still stands though. I'd like to see the examples only show the current config (vs saying "recommended") and we keep the deprecated stuff documented during the period it's still in Alloy... but tuck it away under a collapsed section.

Comment on lines +20 to +21
### Recommended usage

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to remove this and keep it just Usage to keep it consistent with the other topic layouts.

}
```

or
### Deprecated usage
Copy link
Contributor

@clayton-cornell clayton-cornell Dec 12, 2024

Choose a reason for hiding this comment

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

We could use this example: https://grafana.com/docs/writers-toolkit/write/shortcodes/#deprecation-example to document the deprecated target block.

And I'd suggest we move this information down to the actual target block section (line 93) since that's where users will encounter it. And... don't provide a deprecated Usage section... Explicitly showing how to use a deprecated bit encourages people to keep using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants