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

Fix panic when Component ID contains / in otelcomponent.MustNewType(ID) #858

Merged
merged 1 commit into from
May 15, 2024
Merged

Conversation

qclaogui
Copy link
Contributor

@qclaogui qclaogui commented May 15, 2024

PR Description

Component ID may contains /. See:

parent, node := splitPath(globalID)

func splitPath(id string) (string, string) {
parent, id := path.Split(id)
parent, _ = strings.CutSuffix(parent, "/")
return "/" + parent, id
}

which cause panic in otelcomponent.MustNewType(ComponentID) https://github.com/open-telemetry/opentelemetry-collector/blob/c70b51f056fa39304989e6feb25658fd4c24e0d2/component/config.go#L153

Which issue(s) this PR fixes

Fix panic when component ID contains / in otelcomponent.MustNewType(ID). Fixed: #859

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

…e(ID)`

Signed-off-by: Weifeng Wang <qclaogui@gmail.com>
Copy link
Collaborator

@ptodev ptodev left a comment

Choose a reason for hiding this comment

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

Thank you!

@ptodev ptodev merged commit 7bae89c into grafana:main May 15, 2024
15 checks passed
erikbaranowski pushed a commit that referenced this pull request May 21, 2024
…e(ID)` (#858)

Signed-off-by: Weifeng Wang <qclaogui@gmail.com>
(cherry picked from commit 7bae89c)
rfratto pushed a commit to rfratto/alloy that referenced this pull request May 30, 2024
…e(ID)` (grafana#858)

Signed-off-by: Weifeng Wang <qclaogui@gmail.com>
(cherry picked from commit 7bae89c)
rfratto added a commit that referenced this pull request May 30, 2024
* Fix panic when component ID contains `/` in `otelcomponent.MustNewType(ID)` (#858)

Signed-off-by: Weifeng Wang <qclaogui@gmail.com>
(cherry picked from commit 7bae89c)

* No error when http fails (#841)

* Fail if we see the port is not available

* Update changelog

* cleanup message

* Update CHANGELOG.md

Co-authored-by: Erik Baranowski <39704712+erikbaranowski@users.noreply.github.com>

---------

Co-authored-by: Erik Baranowski <39704712+erikbaranowski@users.noreply.github.com>
(cherry picked from commit 4ca3f84)

* fix panic loki source docker (#875)

(cherry picked from commit 4fb1df9)

* clustering: fix ipv6 advertise addresses (#869)

Signed-off-by: Matthew Penner <me@matthewp.io>
(cherry picked from commit 3df2cd0)

* otelcol: decouple otel/alloy component IDs (#882)

Signed-off-by: Paschalis Tsilias <paschalist0@gmail.com>
(cherry picked from commit d018e6e)

* updates with latest snowflake prometheus exporter (fixes null issues) (#939)

* updates with latest snowflake prometheus exporter (fixes null issues)

* Update CHANGELOG.md

Co-authored-by: William Dumont <william.dumont@grafana.com>

---------

Co-authored-by: William Dumont <william.dumont@grafana.com>
(cherry picked from commit 551d407)

* feat(vcs): bubble up SSH key conversion error for better debugging experience (#943)

* feat(vcs): bubble up SSH key conversion error for better debugging experience

Signed-off-by: hainenber <dotronghai96@gmail.com>

* chore: refactor code to be more succinct

Signed-off-by: hainenber <dotronghai96@gmail.com>

---------

Signed-off-by: hainenber <dotronghai96@gmail.com>
(cherry picked from commit 037893f)

* prepare changelog for 1.1.1 (#958)

This includes all bugfixes found in main to date except for #703, which
is a more involved change that should probably wait for a minor release.

(cherry picked from commit 3bceb1a)

---------

Co-authored-by: Weifeng Wang <qclaogui@gmail.com>
Co-authored-by: mattdurham <mattdurham@ppog.org>
Co-authored-by: William Dumont <william.dumont@grafana.com>
Co-authored-by: Matthew Penner <me@matthewp.io>
Co-authored-by: Paschalis Tsilias <tpaschalis@users.noreply.github.com>
Co-authored-by: Stefan Kurek <stefan.kurek@observiq.com>
Co-authored-by: Đỗ Trọng Hải <41283691+hainenber@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic occurs after updating to Alloy 1.1.0
2 participants