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

State logs: index label fields #13160

Merged
merged 1 commit into from
Jul 13, 2021
Merged

Conversation

SimonRichardson
Copy link
Member

This follows on from #13149.

When using debug-logs it helps if we index the log fields correctly. The
following change ensures that we index the labels field (in this
instance it's the "c" field). As the field is optional, we now need to
create a sparse index for mongo.

See: https://docs.mongodb.com/manual/core/index-sparse/

QA steps

It's best to use a multi-terminal session for this (tmux)

$ juju bootstrap lxd test
$ juju model-config -m controller "logging-config='#http=TRACE'"
$ juju debug-log -m controller
$ juju find windows

To see that the trace doesn't come through when using exclude-label

$ juju debug-log -m controller --exclude-label=http

When using debug-logs it helps if we index the log fields correctly. The
following change ensures that we index the labels field (in this
instance it's the "c" field). As the field is optional, we now need to
create a sparse index for mongo.

See: https://docs.mongodb.com/manual/core/index-sparse/
Copy link
Contributor

@achilleasa achilleasa left a comment

Choose a reason for hiding this comment

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

LGTM

@SimonRichardson
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit 15330f7 into juju:2.9 Jul 13, 2021
@SimonRichardson SimonRichardson deleted the index-label-logs branch July 13, 2021 10:42
@wallyworld wallyworld mentioned this pull request Jul 16, 2021
jujubot added a commit that referenced this pull request Jul 16, 2021
#13173

Merge 2.9

#13172 Fix azure instance queries to account for old completed deployments
#13166 Add support for bespoke service principals in Azure credentials
#13169 SpaceAddress conversion from single candidates instead of a slice
#13162 enhance test-network-health
#13168 Fix/lp 1936253
#13164 Fixes unit logging appearing on machine log
#13160 State logs: index label fields
#13163 CLI Deploy: Fix panic

The conflicts were mainly due to removing legacy storage from Azure in develop and changing an api version.

```
Conflicts:
worker/uniter/runner/jujuc/mocks/context_mock.go
version/version.go
tests/suites/network/network_health.sh
snap/snapcraft.yaml
scripts/win-installer/setup.iss
provider/azure/environ_test.go
provider/azure/environ.go
provider/azure/config_test.go
```

## QA steps

See PRs
jujubot added a commit that referenced this pull request Jul 22, 2021
#13187

Merge from 2.9 to bring forward:
- #13184 from manadart/2.9-net-info-iaas-addr-results
- #13176 from SimonRichardson/juju-inspect
- #13185 from SimonRichardson/logging-unmarshalling-fix
- #13181 from SimonRichardson/debug-log-space-labels
- #13182 from achilleasa/2.9-fix-error-in-equinix-credential-detection
- #13179 from SimonRichardson/update-charm-error-messages
- #13178 from manadart/2.9-k9s-no-bootstrap-series
- #13175 from manadart/2.9-net-info-ingress-sort
- #13174 from SimonRichardson/export-bundle-local-charms
- #13170 from manadart/2.9-address-sorting
- #13171 from SimonRichardson/deploy-v1-kubernetes
- #13172 from wallyworld/azure-instance-lookup
- #13167 from jujubot/increment-to-2.9.10
- #13169 from manadart/2.9-space-address-conversion
- #13162 from hmlanigan/fix-test-network
- #13166 from wallyworld/azure-bespoke-serviceprincipal
- #13168 from ycliuhw/fix/lp-1936253
- #13164 from tlm/lp1933548-unit-logging
- #13163 from SimonRichardson/deploy-panic-fix
- #13160 from SimonRichardson/index-label-logs

Conflicts resolved in:
- apiserver/facades/agent/uniter/networkinfoiaas.go
- core/charm/format.go
- core/charm/format_test.go
- go.mod
- go.sum
- provider/azure/config_test.go
- provider/azure/environ.go
- provider/azure/environ_test.go
- provider/azure/environprovider.go
- scripts/win-installer/setup.iss
- snap/snapcraft.yaml
- tests/suites/network/network_health.sh
- version/version.go
- worker/uniter/runner/jujuc/mocks/context_mock.go
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