Skip to content

feat: Adds 'config' to 'debug/vars' http endpoint#26624

Merged
devanbenz merged 5 commits intomaster-1.xfrom
db/647/compact-throughput-track
Aug 20, 2025
Merged

feat: Adds 'config' to 'debug/vars' http endpoint#26624
devanbenz merged 5 commits intomaster-1.xfrom
db/647/compact-throughput-track

Conversation

@devanbenz
Copy link

  • Adds new field to debug/vars which includes various configuration information about a data node\ Example output:
    "config": {
        "aggressive-points-per-block": 10000,
        "cache-max-memory-size": 1073741824,
        "cache-snapshot-memory-size": 26214400,
        "cache-snapshot-write-cold-duration": "10m0s",
        "compact-full-write-cold-duration": "4h0m0s",
        "compact-throughput": 50331648,
        "compact-throughput-burst": 50331648,
        "dir": "/home/foo/.influxdb/data",
        "max-concurrent-compactions": 0,
        "max-index-log-file-size": 1048576,
        "max-series-per-database": 1000000,
        "max-values-per-tag": 100000,
        "series-file-max-concurrent-compactions": 0,
        "series-id-set-cache-size": 100,
        "strict-error-handling": false,
        "wal-dir": "/home/foo/.influxdb/wal",
        "wal-fsync-delay": "0s"
    },

* Adds new field to debug/vars which includes various configuration information about a data node\
Example output:
```
    "config": {
        "aggressive-points-per-block": 10000,
        "cache-max-memory-size": 1073741824,
        "cache-snapshot-memory-size": 26214400,
        "cache-snapshot-write-cold-duration": "10m0s",
        "compact-full-write-cold-duration": "4h0m0s",
        "compact-throughput": 50331648,
        "compact-throughput-burst": 50331648,
        "dir": "/home/foo/.influxdb/data",
        "max-concurrent-compactions": 0,
        "max-index-log-file-size": 1048576,
        "max-series-per-database": 1000000,
        "max-values-per-tag": 100000,
        "series-file-max-concurrent-compactions": 0,
        "series-id-set-cache-size": 100,
        "strict-error-handling": false,
        "wal-dir": "/home/foo/.influxdb/wal",
        "wal-fsync-delay": "0s"
    },
```
Copy link
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

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

Probably should handle all the possible errors from the fmt. package functions, both in the new code and existing code

}

if !first {
fmt.Fprintln(w, ",")
Copy link
Contributor

Choose a reason for hiding this comment

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

Fprintln can return an error.

fmt.Fprintln(w, ",")
}
first = false
fmt.Fprintf(w, "\"config\": %s", data)
Copy link
Contributor

Choose a reason for hiding this comment

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

Fprintf can return an error

@davidby-influx
Copy link
Contributor

Or, if we believe that an http.ResponseWriter's implementation of the Writer interface cannot error, let's note that in a comment explaining why we are not checking return codes. That's not as good, because the implementation can change in future Go versions, of course.

@devanbenz
Copy link
Author

Or, if we believe that an http.ResponseWriter's implementation of the Writer interface cannot error, let's note that in a comment explaining why we are not checking return codes. That's not as good, because the implementation can change in future Go versions, of course.

It should be able to error as we catch other errors throughout the method. I've added error handling for the code I changed, do you think I should go through and add error handling to the other writers?

@devanbenz devanbenz requested a review from davidby-influx July 25, 2025 17:30
@philjb philjb added the 1.x label Aug 19, 2025
@devanbenz devanbenz changed the title feat: Adds 'config' to 'debug/vars' http endpoint\ feat: Adds 'config' to 'debug/vars' http endpoint Aug 20, 2025
Copy link
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

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

One non-blocking question

case toml.Duration:
m[col] = time.Duration(v).String()
default:
m[col] = v
Copy link
Contributor

Choose a reason for hiding this comment

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

There are no other interesting types that need conversion?

Copy link
Author

Choose a reason for hiding this comment

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

The only other two that I saw were toml.FileMode and toml.Group which were just a uint64 each. I didn't see them used in the configuration options that I'm exposing either.

@devanbenz devanbenz merged commit c28b917 into master-1.x Aug 20, 2025
10 checks passed
@devanbenz devanbenz deleted the db/647/compact-throughput-track branch August 20, 2025 19:56
@davidby-influx
Copy link
Contributor

@devanbenz - Is there a placeholder for backporting this to 1.12?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants