Skip to content

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]


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] <[email protected]>
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 <[email protected]>

* changelog

Signed-off-by: Joe Elliott <[email protected]>

* test cleanup

Signed-off-by: Joe Elliott <[email protected]>

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

Signed-off-by: Joe Elliott <[email protected]>

---------

Signed-off-by: Joe Elliott <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Kim Nylander <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Kim Nylander <[email protected]>

* add release notes

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: A. Stoewer <[email protected]>
Co-authored-by: J Pham <[email protected]>
Co-authored-by: Joe Elliott <[email protected]>
Co-authored-by: Ruslan Mikhailov <[email protected]>
Co-authored-by: Mario <[email protected]>
Co-authored-by: Suraj Nath <[email protected]>
Co-authored-by: Kim Nylander <[email protected]>
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