Skip to content

Commit b8c9672

Browse files
Update loki's default port to 3100 (#6349)
* Update loki's default port to 3100 I was suprised this was not already the case. I think it would be a good change to make, but I am also contious of the breaking nature of this. * Add note to the changelong * Add upgrade note * Apply suggestions from code review Co-authored-by: Karen Miller <[email protected]> Co-authored-by: Karen Miller <[email protected]>
1 parent c69605f commit b8c9672

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
* [5777](https://github.com/grafana/loki/pull/5777) **tatchiuleung**: storage: make Azure blobID chunk delimiter configurable
106106
* [5650](https://github.com/grafana/loki/pull/5650) **cyriltovena**: Remove more chunkstore and schema version below v9
107107
* [5643](https://github.com/grafana/loki/pull/5643) **simonswine**: Introduce a ChunkRef type as part of logproto
108+
* [6349](https://github.com/grafana/loki/pull/6349) **simonswine**: Update the default HTTP listen port from 80 to 3100. Make sure to configure the port explicitly if you are using port 80.
108109
#### Promtail
109110

110111
##### Enhancements

docs/sources/upgrading/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ If you want the extracted values to be treated as [Counter](https://prometheus.i
4949

5050
This value now defaults to `loki`, it was previously set to `cortex`. If you are relying on this container name for your chunks or ruler storage, you will have to manually specify `-azure.container-name=cortex` or `-ruler.storage.azure.container-name=cortex` respectively.
5151

52+
#### Default value for `server.http-listen-port` changed
53+
54+
This value now defaults to 3100, so the Loki process doesn't require special privileges. Previously, it had been set to port 80, which is a privileged port. If you need Loki to listen on port 80, you can set it back to the previous default using `-server.http-listen-port=80`.
55+
5256
## 2.5.0
5357

5458
### Loki

pkg/loki/config_wrapper_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ func TestDefaultUnmarshal(t *testing.T) {
969969
require.NoError(t, err)
970970

971971
assert.True(t, config.AuthEnabled)
972-
assert.Equal(t, 80, config.Server.HTTPListenPort)
972+
assert.Equal(t, 3100, config.Server.HTTPListenPort)
973973
assert.Equal(t, 9095, config.Server.GRPCListenPort)
974974
})
975975
}

pkg/loki/loki.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ func (c *Config) registerServerFlagsWithChangedDefaultValues(fs *flag.FlagSet) {
139139

140140
case "server.grpc.keepalive.ping-without-stream-allowed":
141141
_ = f.Value.Set("true")
142+
143+
case "server.http-listen-port":
144+
_ = f.Value.Set("3100")
142145
}
143146

144147
fs.Var(f.Value, f.Name, f.Usage)

pkg/loki/loki_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ func TestFlagDefaults(t *testing.T) {
5757
require.Contains(t, gotFlags, flagToCheck)
5858
require.Equal(t, c.Server.GRPCServerPingWithoutStreamAllowed, true)
5959
require.Contains(t, gotFlags[flagToCheck], "(default true)")
60+
61+
flagToCheck = "-server.http-listen-port"
62+
require.Contains(t, gotFlags, flagToCheck)
63+
require.Equal(t, c.Server.HTTPListenPort, 3100)
64+
require.Contains(t, gotFlags[flagToCheck], "(default 3100)")
6065
}
6166

6267
func TestLoki_isModuleEnabled(t1 *testing.T) {

0 commit comments

Comments
 (0)