Skip to content

Commit

Permalink
Change default port from 9341 to 10016
Browse files Browse the repository at this point in the history
  • Loading branch information
umatare5 committed May 22, 2024
1 parent e8c2637 commit 0e860ce
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ FROM alpine
WORKDIR /app
COPY --from=builder /tmp/build/twelvedata-exporter .

EXPOSE 9341
EXPOSE 10016
USER ${UID}
ENTRYPOINT [ "./twelvedata-exporter" ]
2 changes: 1 addition & 1 deletion Dockerfile.goreleaser
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ FROM alpine
WORKDIR /app
COPY twelvedata-exporter /bin/

EXPOSE 9341
EXPOSE 10016
USER ${UID}
ENTRYPOINT [ "/bin/twelvedata-exporter" ]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ This exporter allows a prometheus instance to monitor prices of stocks, ETFs, an
## Installation

```bash
docker run -p 9341:9341 -e TWELVEDATA_API_KEY ghcr.io/umatare5/twelvedata-exporter
docker run -p 10016:10016 -e TWELVEDATA_API_KEY ghcr.io/umatare5/twelvedata-exporter
```

- `-p`: Publish a container's port `9341/tcp`, to the host `9341/tcp`.
- `-p`: Publish a container's port `10016/tcp`, to the host `10016/tcp`.
- `-e`: Forward environment variable `TWELVEDATA_API_KEY` into a container.

> [!Tip]
Expand All @@ -48,7 +48,7 @@ COMMANDS:

GLOBAL OPTIONS:
--web.listen-address value, -I value Set IP address (default: "0.0.0.0")
--web.listen-port value, -P value Set port number (default: 9341)
--web.listen-port value, -P value Set port number (default: 10016)
--web.scrape-path value, -p value Set the path to expose metrics (default: "/price")
--twelvedata.api-key value, -a value Set key to use twelvedata API [$TWELVEDATA_API_KEY]
--help, -h show help
Expand Down Expand Up @@ -111,20 +111,20 @@ twelvedata_volume{currency="USD",exchange="NASDAQ",name="Alphabet Inc",symbol="G

### Exporter

To refer to the usage, please access http://localhost:9341/ after starting the exporter.
To refer to the usage, please access http://localhost:10016/ after starting the exporter.

```bash
$ TWELVEDATA_API_KEY="foobarbaz"
$ docker run -p 9341:9341 -e TWELVEDATA_API_KEY ghcr.io/umatare5/twelvedata-exporter
INFO[0000] Listening on port 0.0.0.0:9341
$ docker run -p 10016:10016 -e TWELVEDATA_API_KEY ghcr.io/umatare5/twelvedata-exporter
INFO[0000] Listening on port 0.0.0.0:10016
```

or using a binary:

```bash
$ TWELVEDATA_API_KEY="foobarbaz"
$ ./twelvedata-exporter
INFO[0000] Listening on port 0.0.0.0:9341
INFO[0000] Listening on port 0.0.0.0:10016
```

### Prometheus
Expand All @@ -143,7 +143,7 @@ The repository includes a ready to use `Dockerfile`. Run the following command t
make image
```

The new image is named as `$USER/twelvedata-exporter` and exports `9341/tcp` to your host.
The new image is named as `$USER/twelvedata-exporter` and exports `10016/tcp` to your host.

### Release

Expand Down
2 changes: 1 addition & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func registerWebListenPortFlag() []cli.Flag {
Name: config.WebListenPortFlagName,
Usage: "Set port number",
Aliases: []string{"P"},
Value: 9341,
Value: 10016,
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion prometheus.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ scrape_configs:
- META # Facebook
- VIX # CBOE Volatility Index
static_configs:
- targets: [host.docker.internal:9341]
- targets: [host.docker.internal:10016]

# If you send metrics to Grafana Cloud, use the following configuration:
#
Expand Down

0 comments on commit 0e860ce

Please sign in to comment.