Skip to content

Add nil check to partitionAssignmentVar #5198

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

Merged
merged 2 commits into from
Jun 3, 2025

Conversation

mapno
Copy link
Contributor

@mapno mapno commented Jun 2, 2025

What this PR does:

Adds nil check for partitionAssignmentVar.String().

It used to panic when Tempo was run with --help and the config wasn't set.

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@@ -106,5 +106,8 @@ func (p *partitionAssignmentVar) Set(s string) error {
}

func (p *partitionAssignmentVar) String() string {
if p.p == nil {
return "map[]"
Copy link
Contributor

Choose a reason for hiding this comment

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

would "{}" be clearer?

Copy link
Contributor Author

@mapno mapno Jun 2, 2025

Choose a reason for hiding this comment

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

The string representation of an empty map in Go is map[] (https://go.dev/play/p/RNM_DdmfxbS), IMO that's clearest.

@mapno mapno enabled auto-merge (squash) June 3, 2025 07:32
@mapno mapno merged commit fb0ee95 into grafana:main Jun 3, 2025
20 checks passed
@mapno mapno deleted the parititon-assignment-nil-check branch June 3, 2025 07:46
knylander-grafana pushed a commit to knylander-grafana/tempo-doc-work that referenced this pull request Jun 3, 2025
* Nil check partitionAssignmentVar

* Changelog
mattdurham pushed a commit to mattdurham/tempo that referenced this pull request Aug 6, 2025
* Nil check partitionAssignmentVar

* Changelog
# Conflicts:
#	CHANGELOG.md
mattdurham added a commit that referenced this pull request Aug 6, 2025
* Bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.3.0 (#5333)

Bumps [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](go-viper/mapstructure@v2.2.1...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.3.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update go tools to 1.24.4 (#5322)

* cherry pick

* Update changelog

* cherry pick

* Bugfix: Correctly assign backend shard numbers depending on ingester shards (#5438)

* Correctly assign backend shard numbers depending on ingester shards

Signed-off-by: Joe Elliott <number101010@gmail.com>

* changelog

Signed-off-by: Joe Elliott <number101010@gmail.com>

* test cleanup

Signed-off-by: Joe Elliott <number101010@gmail.com>

* a single space raised up as an offering to the lint gods

Signed-off-by: Joe Elliott <number101010@gmail.com>

---------

Signed-off-by: Joe Elliott <number101010@gmail.com>

* cherry picking

* Propagate tracing context in distributor for HTTP requests (#5312)

* Propagate OTel context in distributor

* Changelog

* chlog v2

* Only propagate sampled traces

* Refactor
# Conflicts:
#	CHANGELOG.md

* [bugfix] Correct instant query calculation  (#5252)

* [bugfix] TraceQL Metrics: correct interval number calculation

* [bugfix] Force to return one interval for instant queries

* linter fix: apply De Morgan's law

* e2e: refactoring

* e2e: refactoring

* e2e: function to call instant query

* e2e: instant query

* e2e: remove redundant param

* e2e: add traces with high cardinality attributes

* e2e: test instant bottomk/topk

* Add tests for topk and bottomk Instant queries

* Changelog

* test refactoring

* Basic test to check corner cases for instant query

* [bugfix] Correct instant query calculation
when query both generator and backend

---------

Co-authored-by: Suraj Nath <9503187+electron0zero@users.noreply.github.com>

* Add nil check to `partitionAssignmentVar` (#5198)

* Nil check partitionAssignmentVar

* Changelog
# Conflicts:
#	CHANGELOG.md

* True up changelog

* True up linter

* Apply suggestions from code review

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>

* Update CHANGELOG.md

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>

* add release notes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: A. Stoewer <adrian@stoewer.me>
Co-authored-by: J Pham <94262131+ie-pham@users.noreply.github.com>
Co-authored-by: Joe Elliott <number101010@gmail.com>
Co-authored-by: Ruslan Mikhailov <195758209+ruslan-mikhailov@users.noreply.github.com>
Co-authored-by: Mario <mariorvinas@gmail.com>
Co-authored-by: Suraj Nath <9503187+electron0zero@users.noreply.github.com>
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
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