2021-09-02 18:35:40 +00:00
|
|
|
name = "storage_cardinality_example"
|
|
|
|
|
2022-06-04 16:46:57 +00:00
|
|
|
# Values are automatically generated before the agents are initialized. They generate tag key/value pairs
|
2021-09-17 20:00:06 +00:00
|
|
|
# with the name of the value as the tag key and the evaluated template as the value. These pairs
|
|
|
|
# are Arc wrapped so they can be shared across tagsets and used in the agents as pre-generated data.
|
2021-09-02 18:35:40 +00:00
|
|
|
[[values]]
|
2021-09-17 20:00:06 +00:00
|
|
|
# the name must not have a . in it, which is used to access children later. Otherwise it's open.
|
2021-09-02 18:35:40 +00:00
|
|
|
name = "role"
|
2021-09-17 20:00:06 +00:00
|
|
|
# the template can use a number of helpers to get an id, a random string and the name, see below for examples
|
2021-09-13 21:45:01 +00:00
|
|
|
template = "storage"
|
2021-09-17 20:00:06 +00:00
|
|
|
# this number of tag pairs will be generated. If this is > 1, the id or a random character string should be
|
|
|
|
# used in the template to ensure that the tag key/value pairs are unique.
|
2021-09-02 18:35:40 +00:00
|
|
|
cardinality = 1
|
|
|
|
|
|
|
|
[[values]]
|
|
|
|
name = "url"
|
2021-09-13 21:45:01 +00:00
|
|
|
template = "http://127.0.0.1:6060/metrics/usage"
|
2021-09-02 18:35:40 +00:00
|
|
|
cardinality = 1
|
|
|
|
|
|
|
|
[[values]]
|
2021-09-09 22:55:04 +00:00
|
|
|
name = "org_id"
|
2021-09-02 18:35:40 +00:00
|
|
|
# Fill in the value with the cardinality counter and 15 random alphanumeric characters
|
2021-09-13 21:45:01 +00:00
|
|
|
template = "{{id}}_{{random 15}}"
|
2021-10-26 19:34:35 +00:00
|
|
|
cardinality = 100
|
2021-09-02 18:35:40 +00:00
|
|
|
has_one = ["env"]
|
|
|
|
|
|
|
|
[[values]]
|
|
|
|
name = "env"
|
2021-09-13 21:45:01 +00:00
|
|
|
template = "whatever-environment-{{id}}"
|
2021-10-26 19:34:35 +00:00
|
|
|
cardinality = 2
|
2021-09-02 18:35:40 +00:00
|
|
|
|
|
|
|
[[values]]
|
2021-09-09 22:55:04 +00:00
|
|
|
name = "bucket_id"
|
2021-09-17 20:00:06 +00:00
|
|
|
# a bucket belongs to an org. With this, you would be able to access the org.id or org.value in the template
|
2021-09-09 22:55:04 +00:00
|
|
|
belongs_to = "org_id"
|
2021-09-17 20:00:06 +00:00
|
|
|
# each bucket will have a unique id, which is used here to guarantee uniqueness even across orgs. We also
|
|
|
|
# have a random 15 character alphanumeric sequence to pad out the value length.
|
2021-09-13 21:45:01 +00:00
|
|
|
template = "{{id}}_{{random 15}}"
|
2021-09-02 18:35:40 +00:00
|
|
|
# For each org, 3 buckets will be generated
|
|
|
|
cardinality = 3
|
|
|
|
|
|
|
|
[[values]]
|
|
|
|
name = "partition_id"
|
2021-09-13 21:45:01 +00:00
|
|
|
template = "{{id}}"
|
2021-09-02 18:35:40 +00:00
|
|
|
cardinality = 10
|
|
|
|
|
2021-09-17 20:00:06 +00:00
|
|
|
# makes a tagset so every bucket appears in every partition. The other tags are descriptive and don't
|
2022-06-04 16:46:57 +00:00
|
|
|
# increase the cardinality beyond count(bucket) * count(partition). Later this example will use the
|
2021-09-17 20:00:06 +00:00
|
|
|
# agent and measurement generation to take this base tagset and increase cardinality on a per-agent basis.
|
2021-09-02 18:35:40 +00:00
|
|
|
[[tag_sets]]
|
|
|
|
name = "bucket_set"
|
|
|
|
for_each = [
|
2021-09-09 22:55:04 +00:00
|
|
|
"role",
|
|
|
|
"url",
|
|
|
|
"org_id",
|
|
|
|
"org_id.env",
|
|
|
|
"org_id.bucket_id",
|
|
|
|
"partition_id",
|
2021-09-02 18:35:40 +00:00
|
|
|
]
|
|
|
|
|
2021-12-09 18:39:18 +00:00
|
|
|
[[database_writers]]
|
|
|
|
database_ratio = 1.0
|
2021-12-07 21:54:40 +00:00
|
|
|
agents = [{name = "sender", sampling_interval = "10s"}]
|
|
|
|
|
2021-09-02 18:35:40 +00:00
|
|
|
[[agents]]
|
2021-12-05 16:21:04 +00:00
|
|
|
name = "sender"
|
2021-09-02 18:35:40 +00:00
|
|
|
|
|
|
|
[[agents.measurements]]
|
|
|
|
name = "storage_usage_bucket_cardinality"
|
2021-09-17 20:00:06 +00:00
|
|
|
# each sampling will have all the tag sets from this collection in addition to the tags and tag_pairs specified
|
|
|
|
tag_set = "bucket_set"
|
|
|
|
# for each agent, this specific measurement will be decorated with these additional tags.
|
|
|
|
tag_pairs = [
|
|
|
|
{key = "node_id", template = "{{agent.id}}"},
|
|
|
|
{key = "hostname", template = "{{agent.id}}"},
|
|
|
|
{key = "host", template = "storage-{{agent.id}}"},
|
|
|
|
]
|
2021-09-02 18:35:40 +00:00
|
|
|
|
|
|
|
[[agents.measurements.fields]]
|
|
|
|
name = "gauge"
|
|
|
|
i64_range = [1, 8147240]
|