-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcharmcraft.yaml
233 lines (218 loc) · 7.88 KB
/
charmcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
name: grafana-agent
type: charm
subordinate: true
description: A subordinate charm for Grafana Agent and an essential part of the COS Lite bundle.
summary: |
This Charmed Operator handles deployment, scaling, configuration, and Day 2 operations specific to Grafana Agent.
links:
documentation: https://discourse.charmhub.io/t/grafana-agent-docs-index/13452
website: https://charmhub.io/grafana-agent
source: https://github.com/canonical/grafana-agent-operator
issues: https://github.com/canonical/grafana-agent-operator/issues
bases:
- build-on:
- name: "ubuntu"
channel: "22.04"
architectures: ["arm64"]
run-on:
- name: "ubuntu"
channel: "22.04"
architectures: ["arm64"]
- build-on:
- name: "ubuntu"
channel: "20.04"
architectures: ["arm64"]
run-on:
- name: "ubuntu"
channel: "20.04"
architectures: ["arm64"]
- build-on:
- name: "ubuntu"
channel: "22.04"
architectures: ["amd64"]
run-on:
- name: "ubuntu"
channel: "22.04"
architectures: ["amd64"]
- build-on:
- name: "ubuntu"
channel: "20.04"
architectures: ["amd64"]
run-on:
- name: "ubuntu"
channel: "20.04"
architectures: ["amd64"]
parts:
charm:
build-packages:
- git
# The following are needed for tls-certificates-interface
- build-essential
- python3-dev
- libffi-dev
- libssl-dev
- pkg-config
- rustc
- cargo
charm-binary-python-packages:
# Install PyYAML from binary and avoid building it from sources. This way, we can use PyYAML with C-optimized lib.
# With the C-optimized lib, serialization in ops is 20x faster.
- PyYAML
cos-tool:
plugin: dump
source: .
build-packages:
- curl
override-pull: |
curl -L -O https://github.com/canonical/cos-tool/releases/latest/download/cos-tool-${CRAFT_ARCH_BUILD_FOR}
chmod 775 cos-tool-*
requires:
certificates:
interface: tls-certificates
limit: 1
description: |
Certificate for the grafana agent server (API endpoint is served on :12345 by default)
to use to authenticate to clients, and the CA certificate of the signing CA.
We currently assume that the same CA signs all scrape targets (e.g. principal units).
juju-info:
description: |
`juju-info` provides basic compatibility with all charms.
If all you want is /var/log logs and node_exporter metrics,
this relation will be enough.
interface: juju-info
scope: container
cos-agent:
description: |
`cos-agent` is a dedicated relation for the grafana agent machine
charm. It will allow you to set up custom scrape jobs, fetch files
from arbitrary locations, send alert rules, dashboards, etc.
interface: cos_agent
scope: container
send-remote-write:
interface: prometheus_remote_write
logging-consumer:
interface: loki_push_api
grafana-cloud-config:
interface: grafana_cloud_config
limit: 1
receive-ca-cert:
interface: certificate_transfer
description: |
Obtain TLS information (certificate, ca, chain) from another charm.
tracing:
interface: tracing
limit: 1
provides:
grafana-dashboards-provider:
interface: grafana_dashboard
peers:
peers:
interface: grafana_agent_replica
config:
options:
classic_snap:
description: |
Choose whether to use the classic snap over the strictly confined
one. Defaults to "true".
type: boolean
default: true
tls_insecure_skip_verify:
description: |
Flag to skip the verification for insecure TLS.
If "true", self-signed certs can be seamlessly used; this setting
will be applied to all of the Agent configurations (Prometheus,
Loki).
type: boolean
default: false
global_scrape_timeout:
description: >
How long to wait before timing out a scrape from a target.
Supported units: y, w, d, h, m, s.
type: string
default: "10s"
global_scrape_interval:
description: >
How frequently should instances be scraped.
Supported units: y, w, d, h, m, s.
type: string
default: "1m"
always_enable_zipkin:
description: >
Force-enable the receiver for the 'zipkin' protocol in Grafana Agent,
even if there is no integration currently requesting it.
type: boolean
default: false
always_enable_otlp_grpc:
description: >
Force-enable the receiver for the 'otlp_grpc' protocol in Grafana Agent,
even if there is no integration currently requesting it.
type: boolean
default: false
always_enable_otlp_http:
description: >
Force-enable the receiver for the 'otlp_http' protocol in Grafana Agent,
even if there is no integration currently requesting it.
type: boolean
default: false
always_enable_jaeger_grpc:
description: >
Force-enable the receiver for the 'jaeger_grpc' protocol in Grafana Agent,
even if there is no integration currently requesting it.
type: boolean
default: false
always_enable_jaeger_thrift_http:
description: >
Force-enable the receiver for the 'jaeger_thrift_http' protocol in Grafana Agent,
even if there is no integration currently requesting it.
type: boolean
default: false
tracing_sample_rate_charm:
description: >
This property defines the percentage of charm traces that are sent to tracing backend.
Setting it to 100 would mean all charm traces are kept, setting to 0 means charm traces
aren't sent to tracing backend at all. Anything outside of 0-100 range will be normalised
to this range by Grafana Agent.
type: float
default: 100.0
tracing_sample_rate_workload:
description: >
This property defines the percentage of workload traces that are sent to tracing backend.
Setting it to 100 would mean all workload traces are kept, setting to 0 means workload traces
aren't sent to tracing backend at all. Anything outside of 0-100 range will be normalised
to this range by Grafana Agent.
type: float
default: 1.0
tracing_sample_rate_error:
description: >
This property defines the percentage of error traces (regardless of the type) that are sent to tracing backend.
Setting it to 100 would mean all error traces are kept, setting to 0 means error traces
aren't sent to tracing backend at all. Anything outside of 0-100 range will be normalised
to this range by Grafana Agent.
type: float
default: 100.0
reporting_enabled:
description: |
Toggle reporting of usage info to grafana, such as enabled feature flags.
Ref: https://grafana.com/docs/agent/latest/static/configuration/flags/#report-information-usage
type: boolean
default: true
log_level:
description: |
Grafana Agent server log level (only log messages with the given severity
or above). Must be one of: [debug, info, warn, error].
If not set, the Grafana Agent default (info) will be used.
type: string
default: info
path_exclude:
description: >
Glob for a set of log files present in `/var/log` that should be ignored by Grafana Agent.
For example, `/var/log/**/{app_one,app_two}.log` will result in the agent ignoring both
`/var/log/app_one.log` and `/var/log/app_two.log`.
Note that the value you provide here is not interpreted as a path, but rather as a glob matcher.
Specifically, if you want to exclude logs in the `/var/log/test` folder, you should set the
config to `/var/log/test/**`.
Ref (__path_exclude__): https://grafana.com/docs/loki/latest/send-data/promtail/scraping/
type: string
default: ""