-
Notifications
You must be signed in to change notification settings - Fork 208
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
Implement an initial version of the support bundle in Alloy #2009
Conversation
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Over to @grafana/grafana-alloy-maintainers for a code review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks for adding this, the code and docs are very clear and easy to follow :) Did you get the chance to test it on windows and with fleet management?
…feat/support-bundle
I did not have a chance to test in windows/FM. Will connect with you tomorrow to discuss options, I don't have a windows environment set up (or know how to access a shared one yet) |
Tested on Windows, it works well :) fyi if there are no logs during the recording time the log file won't be generated (which is ok imo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's looking really good, can't wait to have this in user's hands!
In addition, you can inspect the [supportbundle implementation](https://github.com/grafana/alloy/tree/internal/service/http/supportbundle.go) | ||
to verify the code used to generate these bundles. | ||
|
||
A support bundle contains the following data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will do to support questions what 🚒 does to 🔥
🎉
internal/service/http/http.go
Outdated
tracer trace.TracerProvider | ||
gatherer prometheus.Gatherer | ||
opts Options | ||
log *logging.Logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can rename this somehow? globalLogger
?
A comment that it's only used to set temporary writer etc would be nice to make it easier to figure out.
internal/service/http/http.go
Outdated
s.log.SetTemporaryWriter(syncBuff) | ||
defer func() { | ||
s.log.RemoveTemporaryWriter() | ||
}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't multiple concurrent calls to this /-/support
race on these?
Do we need a mutex for the whole call?
Co-authored-by: Piotr <[email protected]>
weight: 300 | ||
--- | ||
|
||
# Generate Support Bundle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be released as Public preview?
If yes, then we probably should add the Public preview bits at the top of the doc topic.
<span class="badge docs-labels__stage docs-labels__item">Public preview</span>
# Generate Support Bundle
{{< docs/shared lookup="stability/public_preview.md" source="alloy" version="<ALLOY_VERSION>" >}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh good point. Lets switch to the generic one instead. We could use this in its place:
{{< docs/public-preview product="Generate support bundle" >
https://grafana.com/docs/writers-toolkit/write/shortcodes/#docspublic-preview (if it's behind a feature flag, there's a block for that too)
This will create a Note block that says:
Generate support bundle is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor tweaks to the docs. Otherwise looks good.
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
|
||
# Generate a support bundle | ||
|
||
{{< docs/shared lookup="stability/public_preview.md" source="alloy" version="<ALLOY_VERSION>" >}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< docs/shared lookup="stability/public_preview.md" source="alloy" version="<ALLOY_VERSION>" >}} | |
{{< docs/public-preview product="Generate support bundle" >}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one last question, but happy to change docs in a follow-up.
* Implement an initial version of the support bundle in Alloy * Add documentation for support bundle * Update changelog * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Initial PR feedback * Rewrite http service to use logging library internal to alloy * Revert accidental commit of e2e test changes * Fix comment on exported function * Clean up added host variable that is no longer used * Refactor usage of logger in http service * Update internal/service/http/http.go Co-authored-by: Piotr <[email protected]> * implement PR feedback * Hide support bundle behind public preview stability level * Update docs based on feedback * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * More PR feedback in docs * Fix race condition in logger * Add a note about backward-compatibility exception --------- Co-authored-by: Clayton Cornell <[email protected]> Co-authored-by: Piotr <[email protected]>
* update changelog version * Prototype targets.merge function (array.combine_maps) (#1826) * Prototype map.inner_join function * Rename to "targets.merge", remove unnecessary params * Add failure tests * Delete incorrect comment * rename targets.merge to array.combine_maps, mark it as experimental, make is more permissive and add tests * update changelog * Update CHANGELOG.md Co-authored-by: Piotr <[email protected]> * Update docs/sources/reference/stdlib/array.md Co-authored-by: Piotr <[email protected]> * Update docs/sources/reference/stdlib/array.md Co-authored-by: Piotr <[email protected]> * Update docs/sources/reference/stdlib/array.md Co-authored-by: Piotr <[email protected]> * rename mapCombine to combineMaps * document panic * add equal test * add more tests * Update syntax/internal/stdlib/stdlib.go Co-authored-by: Piotr <[email protected]> * Update syntax/internal/stdlib/stdlib.go Co-authored-by: Piotr <[email protected]> * add examples in doc * fix error propagation * remove value nul on len function * refactor code into a traversal function * update doc to avoid modifying the experimental shared doc --------- Co-authored-by: William Dumont <[email protected]> Co-authored-by: Piotr <[email protected]> * Implement an initial version of the support bundle in Alloy (#2009) * Implement an initial version of the support bundle in Alloy * Add documentation for support bundle * Update changelog * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Initial PR feedback * Rewrite http service to use logging library internal to alloy * Revert accidental commit of e2e test changes * Fix comment on exported function * Clean up added host variable that is no longer used * Refactor usage of logger in http service * Update internal/service/http/http.go Co-authored-by: Piotr <[email protected]> * implement PR feedback * Hide support bundle behind public preview stability level * Update docs based on feedback * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * Update docs/sources/troubleshoot/support_bundle.md Co-authored-by: Clayton Cornell <[email protected]> * More PR feedback in docs * Fix race condition in logger * Add a note about backward-compatibility exception --------- Co-authored-by: Clayton Cornell <[email protected]> Co-authored-by: Piotr <[email protected]> --------- Co-authored-by: Paulin Todev <[email protected]> Co-authored-by: William Dumont <[email protected]> Co-authored-by: Sam DeHaan <[email protected]> Co-authored-by: Clayton Cornell <[email protected]>
PR Description
Port the Support Bundle from the Agent repository & update it for Alloy.
Which issue(s) this PR fixes
Notes to the Reviewer
PR Checklist