Skip to content
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

[loki-canary] Support passing loki address as environment variable #8024

Merged
merged 2 commits into from
Jan 4, 2023

Conversation

jijotj
Copy link
Contributor

@jijotj jijotj commented Jan 2, 2023

What this PR does / why we need it:

  • Replace flag with kingpin which has more capabilities to override defaults
  • Override default for addr, user and pass from environment the variables LOKI_ADDRESS, LOKI_USERNAME and LOKI_PASSWORD respectively.

Which issue(s) this PR fixes:
Fixes #8021

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/upgrading/_index.md

@jijotj jijotj requested a review from a team as a code owner January 2, 2023 07:44
@CLAassistant
Copy link

CLAassistant commented Jan 2, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Jan 2, 2023
@jijotj jijotj changed the title Replace flag with kingpin which has more capabilities to override defaults [loki-canary] Support passing loki address as environment variable Jan 2, 2023
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

…aults

- Override default for `addr`, `user` and `pass` from environment the variables `LOKI_ADDRESS`, `LOKI_USERNAME` and `LOKI_PASSWORD` respectively.
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

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

Looks great, thanks and congrats on your first PR!

@owen-d owen-d merged commit f9ed9cb into grafana:main Jan 4, 2023
dannykopping pushed a commit that referenced this pull request Jan 6, 2023
**What this PR does / why we need it**:
#8024 added an enhancement to loki-canary to pickup config from env
variables. However the change was wrongly added under loki instead of
loki-canary in the changelog. This PR fixes the changelog.

**Which issue(s) this PR fixes**:
NA

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the `CONTRIBUTING.md` guide
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
JordanRushing added a commit to JordanRushing/loki that referenced this pull request Jan 17, 2023
owen-d pushed a commit that referenced this pull request Jan 17, 2023
…iable (#8024)" (#8183)

**What this PR does / why we need it**:
This PR reverts commit f9ed9cb which
introduced breaking config changes for the Loki canary. The relevant
change introduced support for configuring a new `LOKI_ADDRESS` canary
environment variable by adopting a new library for flags.

This is the easiest path forward to avoid forcing breaking config
changes on canary operators; such a change is likely better suited to
join other configuration changes in a future major Loki release.

**Which issue(s) this PR fixes**:
N/A

**Special notes for your reviewer**:
Related PR:
- #8024

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
JordanRushing added a commit to JordanRushing/loki that referenced this pull request Jan 17, 2023
…iable (grafana#8024)" (grafana#8183)

**What this PR does / why we need it**:
This PR reverts commit f9ed9cb which
introduced breaking config changes for the Loki canary. The relevant
change introduced support for configuring a new `LOKI_ADDRESS` canary
environment variable by adopting a new library for flags.

This is the easiest path forward to avoid forcing breaking config
changes on canary operators; such a change is likely better suited to
join other configuration changes in a future major Loki release.

**Which issue(s) this PR fixes**:
N/A

**Special notes for your reviewer**:
Related PR:
- grafana#8024

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
jeschkies pushed a commit to jeschkies/loki that referenced this pull request Jan 18, 2023
…iable (grafana#8024)" (grafana#8183)

**What this PR does / why we need it**:
This PR reverts commit f9ed9cb which
introduced breaking config changes for the Loki canary. The relevant
change introduced support for configuring a new `LOKI_ADDRESS` canary
environment variable by adopting a new library for flags.

This is the easiest path forward to avoid forcing breaking config
changes on canary operators; such a change is likely better suited to
join other configuration changes in a future major Loki release.

**Which issue(s) this PR fixes**:
N/A

**Special notes for your reviewer**:
Related PR:
- grafana#8024

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
JordanRushing added a commit that referenced this pull request Jan 18, 2023
…iable (#8024)" (#8183) (#8184)

This PR cherry-picks d8a0c6f onto k133.
Original description below:

**What this PR does / why we need it**:
This PR reverts commit f9ed9cb which
introduced breaking config changes for the Loki canary. The relevant
change introduced support for configuring a new `LOKI_ADDRESS` canary
environment variable by adopting a new library for flags.

This is the easiest path forward to avoid forcing breaking config
changes on canary operators; such a change is likely better suited to
join other configuration changes in a future major Loki release.

**Which issue(s) this PR fixes**:
N/A

**Special notes for your reviewer**:
Related PR:
- #8024

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`

**What this PR does / why we need it**:

**Which issue(s) this PR fixes**:
Fixes #<issue number>

**Special notes for your reviewer**:

**Checklist**
- [ ] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[loki-canary] Support passing loki address as environment variable
4 participants