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

Add COS integration and metric logs #13

Merged
merged 105 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
ac4959f
Initial commit
yhaliaw Oct 7, 2024
b50fb26
Debug integration test
yhaliaw Oct 7, 2024
132942a
Try newer version of pydantic to avoid rust compiler error during cha…
yhaliaw Oct 7, 2024
455c9f0
Add build deps
yhaliaw Oct 7, 2024
7021b9c
Add copyright header
yhaliaw Oct 7, 2024
6948b41
Fix integration tests
yhaliaw Oct 7, 2024
5045a7f
Add copyright to charmcraft.yaml
yhaliaw Oct 7, 2024
b613263
Update the changelog
yhaliaw Oct 8, 2024
9053bd2
Debug integraiton test
yhaliaw Oct 8, 2024
226dbf2
Remove debug
yhaliaw Oct 8, 2024
3161413
Not use self-hosted runner for integration test due to squid issues
yhaliaw Oct 8, 2024
1717a0b
Update metadata.yaml
yhaliaw Oct 8, 2024
f652032
Initial refactor for mutli nginx config file support
yhaliaw Oct 9, 2024
b016d2f
Fix unit tests
yhaliaw Oct 9, 2024
843593c
Fix charmcraft.yaml
yhaliaw Oct 9, 2024
6ae5294
Fix integration tests
yhaliaw Oct 11, 2024
388133e
Add integration test
yhaliaw Oct 11, 2024
75ca4ad
Fix lints
yhaliaw Oct 11, 2024
d90aa92
Remove unneeded type ignore
yhaliaw Oct 11, 2024
ef1e6a4
Add missing license header
yhaliaw Oct 11, 2024
26df104
Fix missing newline at end of file
yhaliaw Oct 11, 2024
2c2a77b
Fix the hostname used for upstream
yhaliaw Oct 14, 2024
68ad72d
Add code comments and refactor a function
yhaliaw Oct 14, 2024
746b3ea
Fix the integration test juju version
yhaliaw Oct 14, 2024
7e6e6d1
Fix metadata.yaml lint
yhaliaw Oct 14, 2024
14158b2
Shorten the summary again due to lints
yhaliaw Oct 14, 2024
47b6953
Add support for config in integration data
yhaliaw Oct 15, 2024
e5fca79
Implement the nginx configuration for the basic configurations
yhaliaw Oct 15, 2024
c1e7727
Merge branch 'track/1' into feat/basic-config
yhaliaw Oct 17, 2024
0e458b0
Fix the mocking of test
yhaliaw Oct 17, 2024
b2aec75
Add .mypy_cache to .gitignore
yhaliaw Oct 17, 2024
f5d251e
Add support for basic config
yhaliaw Oct 17, 2024
012d5b3
Update changelog formatting
yhaliaw Oct 17, 2024
8df23e6
Remove health-check-path config
yhaliaw Oct 17, 2024
5c93be8
Changed the health-check-interval to fail-timeout
yhaliaw Oct 17, 2024
39d6563
Add integration test for backends path
yhaliaw Oct 17, 2024
af1a010
Update the formatting
yhaliaw Oct 17, 2024
292151e
Fix packing of charm
yhaliaw Oct 18, 2024
f1382ee
Fix overwrite of blocked status messages
yhaliaw Oct 22, 2024
98ad5fc
Fix the fix for overwrite of blocked status messages
yhaliaw Oct 22, 2024
79a616f
Add integration tests
yhaliaw Nov 15, 2024
a044e54
Update the docs links
yhaliaw Nov 15, 2024
20f1ee6
Fix docstring description
yhaliaw Nov 19, 2024
19f20e8
Update docs
yhaliaw Nov 19, 2024
d8346b8
Add proxy_cache_path default configuration
yhaliaw Nov 19, 2024
aed3dcf
Update the state error messages
yhaliaw Nov 19, 2024
43d3958
Fix lint
yhaliaw Nov 20, 2024
05ddefa
Change a method to private
yhaliaw Nov 20, 2024
188ef1c
Update the docstrings of validation functions
yhaliaw Nov 20, 2024
aac629e
Use reconcile function for start and update-status events
yhaliaw Nov 20, 2024
8beb9d4
Add unit tests
yhaliaw Nov 21, 2024
67db30f
Reformat
yhaliaw Nov 21, 2024
232718d
Remove insecure requests args
yhaliaw Nov 21, 2024
ff0ab54
Add v4 integration library for tls-certificate
yhaliaw Nov 19, 2024
faf5dc7
Initial TLS certificate implementation
yhaliaw Nov 27, 2024
7d57702
Add unit and integration tests
yhaliaw Nov 27, 2024
fb2d9d1
Fix lints
yhaliaw Nov 28, 2024
36a1a15
Add test for HTTP request with TLS cert
yhaliaw Nov 28, 2024
d6b8080
Update docs
yhaliaw Nov 28, 2024
4a11384
Fix merge conflict
yhaliaw Nov 28, 2024
625039e
Fix missing license
yhaliaw Nov 28, 2024
a929c05
Update quick start docs due to lints
yhaliaw Dec 2, 2024
1a8613e
Add get_hostnames method
yhaliaw Dec 2, 2024
4e9ca90
Refactor certficates.py
yhaliaw Dec 2, 2024
4385e5f
Fix docs lints
yhaliaw Dec 2, 2024
ff517b5
Refactor to extract integration data once
yhaliaw Dec 2, 2024
8a64864
Apply suggestions from code review
yhaliaw Dec 3, 2024
1737f42
Fix according to comments
yhaliaw Dec 3, 2024
85cdf89
Update docstring
yhaliaw Dec 4, 2024
5cce5a2
Update according to comments
yhaliaw Dec 4, 2024
429020b
Add cos-agent integration for log ingestion
yhaliaw Dec 2, 2024
0aa3acc
Merge branch 'track/1' into feat/cos
yhaliaw Dec 4, 2024
ee02ada
Update changelog format
yhaliaw Dec 4, 2024
ed110b9
Use parallel build
yhaliaw Dec 4, 2024
a709bab
Build local content-cache-backends-config charm
yhaliaw Dec 4, 2024
f9db80a
Fix config charm deployment
yhaliaw Dec 4, 2024
2b18442
Fix config charm deployment again
yhaliaw Dec 5, 2024
72dbdfc
Merge branch 'refactor/integration-test' into feat/cos
yhaliaw Dec 5, 2024
56993df
Add nginx log format
yhaliaw Dec 5, 2024
6ee3db6
Fix nginx cache log format
yhaliaw Dec 5, 2024
57f23ab
Fix certificate logging
yhaliaw Dec 5, 2024
a39cd53
Increase the timeout args as self-hosted runner are more inconsisent …
yhaliaw Dec 5, 2024
de80cbf
Fix nginx log format
yhaliaw Dec 5, 2024
eb820ad
Refactor tls-certificates integration test to its own file
yhaliaw Dec 5, 2024
e80a4c5
Remove duplicate code due to merges
yhaliaw Dec 5, 2024
a59b6a4
Refactor state.py for content-cache-backends-config
yhaliaw Dec 6, 2024
f040700
Update changelog format
yhaliaw Dec 6, 2024
b05dc43
Fix flake8 test ignore lints
yhaliaw Dec 6, 2024
259d031
Merge branch 'refactor/integration-test' into feat/cos
yhaliaw Dec 6, 2024
fee813a
Add integration tests
yhaliaw Dec 6, 2024
c8a7f16
Fix log format
yhaliaw Dec 6, 2024
3a2546c
Fix lints
yhaliaw Dec 6, 2024
7b6488a
Fix workflow errors
yhaliaw Dec 6, 2024
bc49b00
Delete lib at wrong path
yhaliaw Dec 6, 2024
d407ee7
Revert workflow directory setting
yhaliaw Dec 6, 2024
479c9f4
Merge branch 'track/1' into feat/cos
yhaliaw Dec 6, 2024
f7eb355
Add documentation
yhaliaw Dec 6, 2024
0493e4a
Apply suggestions from code review
yhaliaw Dec 6, 2024
df625f5
Fix test charm base
yhaliaw Dec 9, 2024
0e27577
Add channel for grafana-agent charm
yhaliaw Dec 9, 2024
dab6da0
Force pinning of revision due to model.deploy issue
yhaliaw Dec 9, 2024
deeef7e
Fix formatting
yhaliaw Dec 9, 2024
732c7f9
Merge branch 'main' into feat/cos
yhaliaw Dec 9, 2024
60606a8
Replace whitespace with dash in json key of cache metric log
yhaliaw Dec 9, 2024
6361378
Fix naming of integration tests
yhaliaw Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
with:
juju-channel: 3.6/stable
provider: lxd
modules: '["test_charm", "test_tls_cert"]'
modules: '["test_charm", "test_tls_cert", "test_metric"]'
working-directory: ./content-cache
self-hosted-runner: true
self-hosted-runner-label: "edge"
2 changes: 2 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ header:
- 'trivy.yaml'
- 'pyproject.toml'
- 'zap_rules.tsv'
# Ignore charm libraries.
- "**/lib/charms/**"
comment: on-failure
6 changes: 6 additions & 0 deletions content-cache/docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2024-12-05

### **Added**

- Support for COS integration. Integrating with charms that provides cos-agent will cause the charm to forward logs to COS.

## 2024-11-28

### **Added**
Expand Down
17 changes: 17 additions & 0 deletions content-cache/docs/how-to/enable-cos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# How to enable COS integration

The charm utilize nginx as a static web content cache.
yhaliaw marked this conversation as resolved.
Show resolved Hide resolved
Various metrics on the requests to the cache are logged.
The logs can be ingested into [COS](https://charmhub.io/topics/canonical-observability-stack) by integrating the charm with a charm that provides `cos-agent` integration.

The [Grafana Agent charm](https://charmhub.io/grafana-agent) provides `cos-agent` integration to machine charms.
If you are new to COS or the Grafana Agent charm it is recommended to first follow [this guide](https://charmhub.io/grafana-agent/docs/using) to understand the concepts of COS and how the charms work together.

With a working content-cache charm deployment name `cache`, the following will add COS support to it:
yhaliaw marked this conversation as resolved.
Show resolved Hide resolved

```bash
juju deploy grafana-agent cos-agent
juju integrate cos-agent cache
```

Then the Grafana Agent charm should be integrated with your COS instance.
Loading
Loading