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

[DOC] Adding missing metric-generator keys #3643

Merged
merged 19 commits into from
Jul 23, 2024
Merged
Changes from 10 commits
Commits
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
197 changes: 156 additions & 41 deletions docs/sources/tempo/configuration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
- [Local storage recommendations](#local-storage-recommendations)
- [Storage block configuration example](#storage-block-configuration-example)
- [Memberlist](#memberlist)
- [Configuration blocks](#configuration-blocks)
- [Filter policy config](#filter-policy config)

Check failure on line 34 in docs/sources/tempo/configuration/_index.md

View workflow job for this annotation

GitHub Actions / doc-validator

[doc-validator] reported by reviewdog 🐶 The anchor 'filter-policy config' doesn't exist in the file 'docs/sources/tempo/configuration/_index.md'. Replace the anchor with one of the available anchors. Available anchors are: "configure-tempo, use-environment-variables-in-the-configuration, server, distributor, ingester, metrics-generator, query-frontend, querier, compactor, storage, local-storage-recommendations, storage-block-configuration-example, memberlist, configuration-blocks, filter-policy-config, filter-policy, policy-match, examples, wal-config, overrides, ingestion-limits, standard-overrides, tenant-specific-overrides, runtime-overrides, user-configurable-overrides, override-strategies, usage-report, cache" Raw Output: {"message":"The anchor 'filter-policy config' doesn't exist in the file 'docs/sources/tempo/configuration/_index.md'.\nReplace the anchor with one of the available anchors.\n\nAvailable anchors are: \"configure-tempo, use-environment-variables-in-the-configuration, server, distributor, ingester, metrics-generator, query-frontend, querier, compactor, storage, local-storage-recommendations, storage-block-configuration-example, memberlist, configuration-blocks, filter-policy-config, filter-policy, policy-match, examples, wal-config, overrides, ingestion-limits, standard-overrides, tenant-specific-overrides, runtime-overrides, user-configurable-overrides, override-strategies, usage-report, cache\"","location":{"path":"docs/sources/tempo/configuration/_index.md","range":{"start":{"line":34,"column":7},"end":{"line":34,"column":52}}},"severity":1,"source":{"name":"doc-validator"},"code":{"value":"anchor-does-not-exist"}}
WesselAtWork marked this conversation as resolved.
Show resolved Hide resolved
- [WAL config](#wal-config)
- [Overrides](#overrides)
- [Ingestion limits](#ingestion-limits)
- [Standard overrides](#standard-overrides)
Expand Down Expand Up @@ -326,6 +329,12 @@
# `wait` value for this processor.
[enable_messaging_system_latency_histogram: <bool> | default = false]

# Attributes that will be used to create a peer edge
# Attributes are searched in the order they are provided
# See: https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.18.0
# Example: ["peer.service", "db.name", "db.system", "host.name"]
[peer_attributes: <list of string> | default = ["peer.service", "db.name", "db.system"] ]

# Attribute Key to multiply span metrics
[span_multiplier_key: <string> | default = ""]

Expand All @@ -335,7 +344,7 @@
span_metrics:

# Buckets for the latency histogram in seconds.
[histogram_buckets: <list of float> | default = 0.002, 0.004, 0.008, 0.016, 0.032, 0.064, 0.128, 0.256, 0.512, 1.02, 2.05, 4.10]
[histogram_buckets: <list of float> | default = 0.002, 0.004, 0.008, 0.016, 0.032, 0.064, 0.128, 0.256, 0.512, 1.024, 2.048, 4.096, 8.192, 16.384]

# Configure intrinsic dimensions to add to the metrics. Intrinsic dimensions are taken
# directly from the respective resource and span properties.
Expand All @@ -357,19 +366,35 @@
# the metrics if present.
[dimensions: <list of string>]

# Custom labeling of dimensions is possible via a list of maps consisting of
# "name" <string>, "source_labels" <list of string>, "join" <string>
# "name" appears in the metrics, "source_labels" are the actual
# attributes that will make up the value of the label and "join" is the
# separator if multiple source_labels are provided
[dimension_mappings: <list of map>]
# Custom labeling mapping
dimension_mappings: <list of label mappings>
# The new label name
- [name: <string>]
# The actual attributes that will make the value of the new label
[source_labels: <list of strings>]
# The separator used to join multiple `source_labels`
[join: <string>]

# Enable traces_target_info metrics
[enable_target_info: <bool>]
# Drop specific labels from traces_target_info metrics
[target_info_excluded_dimensions: <list of string>]
[enable_target_info: <bool> | default = false]

# Attribute Key to multiply span metrics
[span_multiplier_key: <string> | default = ""]

# Subprocessor toggles for metrics categories that exist under the umbrella of span metrics
subprocessors:
# Toggle the `Latency` metric category
[ 0: <bool> | default = true ]
# Toggle the `Count` metric category
[ 1: <bool> | default = true ]
# Toggle the `Size` metric category
[ 2: <bool> | default = true ]
WesselAtWork marked this conversation as resolved.
Show resolved Hide resolved

# List of policies that will be applied to spans for inclusion or exclusion.
[filter_policies: <list of filter policies config> | default = []]

# Drop specific labels from `traces_target_info` metrics
[target_info_excluded_dimensions: <list of string>]
WesselAtWork marked this conversation as resolved.
Show resolved Hide resolved

# Registry configuration
registry:
Expand All @@ -390,14 +415,23 @@
# The maximum length of label values. Label values exceeding this limit will be truncated.
[max_label_value_length: <int> | default = 2048]

# Configuration block for the Write Ahead Log (WAL)
traces_storage: <WAL Config>

# Path to store the WAL files.
# Must be set.
# Example: "/var/tempo/generator/traces"
[path: <string> | default = ""]

# Storage and remote write configuration
storage:

# Path to store the WAL. Each tenant will be stored in its own subdirectory.
path: <string>

# Configuration for the Prometheus Agent WAL
wal:
# https://github.com/prometheus/prometheus/v2.51.2/tsdb/agent/db.go#L62-L84
WesselAtWork marked this conversation as resolved.
Show resolved Hide resolved
wal: <prometeus agent WAL config>
WesselAtWork marked this conversation as resolved.
Show resolved Hide resolved

# How long to wait when flushing samples on shutdown
[remote_write_flush_deadline: <duration> | default = 1m]
Expand All @@ -414,6 +448,12 @@
# considered in metrics generation.
# This is to filter out spans that are outdated.
[metrics_ingestion_time_range_slack: <duration> | default = 30s]

# Timeout for generator requests (???)
WesselAtWork marked this conversation as resolved.
Show resolved Hide resolved
[query_timeout: <duration> | default = 30s ]

# Overides the key used to register the metrics-generator in the ring.
[override_ring_key: <string> | default = "metrics-generator"]
```

## Query-frontend
Expand Down Expand Up @@ -1064,37 +1104,18 @@
# the worker pool is used primarily when finding traces by id, but is also used by other
pool:

# total number of workers pulling jobs from the queue (default: 400)
[max_workers: <int>]
# total number of workers pulling jobs from the queue
[max_workers: <int> | default = 30]

# length of job queue. imporatant for querier as it queues a job for every block it has to search
# (default: 20000)
[queue_depth: <int>]
[queue_depth: <int> | default = 10000 ]

# Configuration block for the Write Ahead Log (WAL)
wal:

# where to store the head blocks while they are being appended to
# Example: "wal: /var/tempo/wal"
[path: <string>]

# wal encoding/compression.
# options: none, gzip, lz4-64k, lz4-256k, lz4-1M, lz4, snappy, zstd, s2
[v2_encoding: <string> | default = snappy]

# Defines the search data encoding/compression protocol.
# Options: none, gzip, lz4-64k, lz4-256k, lz4-1M, lz4, snappy, zstd, s2
[search_encoding: <string> | default = none]

# When a span is written to the WAL it adjusts the start and end times of the block it is written to.
# This block start and end time range is then used when choosing blocks for search.
# This is also used for querying traces by ID when the start and end parameters are specified. To prevent spans too far
# in the past or future from impacting the block start and end times we use this configuration option.
# This option only allows spans that occur within the configured duration to adjust the block start and
# end times.
# This can result in trace not being found if the trace falls outside the slack configuration value as the
# start and end times of the block will not be updated in this case.
[ingestion_time_range_slack: <duration> | default = 2m]
wal: <WAL Config>
[path: <string> | default = "/var/tempo/wal"]
[v2_encoding: <string> | default = snappy]
[search_encoding: <string> | default = none]
[ingestion_time_range_slack: <duration> | default = 2m]
Copy link
Contributor Author

@WesselAtWork WesselAtWork May 2, 2024

Choose a reason for hiding this comment

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

Needed a way to show that this particular component is overriding values from the base component block. (WAL Config)

Wanted to keep it light for the future, so no comments where none would add additional value.
If there were comments we would need to keep both synchronized.

This way if you are making changes to the query-frontend you won't need to change the base block because it isn't dependant on the query-frontend
Same in reverse, if you made changes to the base WAL Config you wouldn't need to propagate them to every component that use it. (Unless you made changes to them too)

Feel free to dispute the omission of the newline breaks.

I felt a need to keep this visually distinct, but I am not married to the idea.
Might be better to keep the format consistent


# block configuration
block:
Expand Down Expand Up @@ -1207,9 +1228,9 @@
# Timeout for leaving memberlist cluster.
[leave_timeout: <duration> | default = 5s]

# IP address to listen on for gossip messages. Multiple addresses may be
# specified. Defaults to 0.0.0.0
[bind_addr: <list of string> | default = ]
# IP address to listen on for gossip messages.
# Multiple addresses may be specified.
[bind_addr: <list of string> | default = ["0.0.0.0"] ]

# Port to listen on for gossip messages.
[bind_port: <int> | default = 7946]
Expand All @@ -1222,6 +1243,100 @@

```

## Configuration blocks

Defines re-used configuration blocks.

### Filter policy config

Span filter config block

#### Filter policy
```yaml
# Exclude filters (postive matching)
[include: <policy match>]

# Exclude filters (negative matching)
[exclude: <policy match>]
```

#### Policy match
```yaml
# How to match the value of attributes
# Options: "strict", "regex"
[match_type: <string>]

# List of attributes to match
attributes: <list of policy atributes>

# Attribute key
- [key: <string>]

# Attribute value
[value: <any>]
```

#### Examples
WesselAtWork marked this conversation as resolved.
Show resolved Hide resolved

```yaml
exclude:
match_type: "regex"
attributes:
- key: "resource.service.name"
value: "unknown_service:myservice"
```

```yaml
include:
match_type: "strict"
attributes:
- key: "foo.bar"
value: "baz"
```

### WAL config

The storage WAL configuration block.

```yaml
# Where to store the wal files while they are being appended to.
# Must be set.
# Example: "/var/tempo/wal
[path: <string> | default = ""]

# Where to store the completed wal files
# If not set (""), will join the `path` with "completed" to generate the effective path
# Example: "/var/tempo/wal/completed"
[completedfilepath: <string> | default = join(.path, "/completed")]

# Where to store the intermediate blocks while they are being appended to.
# Will always join the `path` with "blocks" to generate the effective path
# Example: "/var/tempo/wal/blocks" (ignored)
[blocksfilepath: <ignored> | = join(.path, "/blocks")]
Comment on lines +1441 to +1444
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I found a bug?

I described what the code does here, but I don't think this is the intended behaviour...

Please verify :

tempo/tempodb/wal/wal.go

Lines 70 to 75 in 3a4f309

p := filepath.Join(c.Filepath, blocksDir)
err = os.MkdirAll(p, os.ModePerm)
if err != nil {
return nil, err
}
c.BlocksFilepath = p

I think it's supposed to look like this (but with c.BlocksFilepath == ""):

tempo/tempodb/wal/wal.go

Lines 56 to 67 in 3a4f309

// The /completed/ folder is now obsolete and no new data is written,
// but it needs to be cleared out one last time for any files left
// from a previous version.
if c.CompletedFilepath == "" {
completedFilepath := filepath.Join(c.Filepath, completedDir)
err = os.RemoveAll(completedFilepath)
if err != nil {
return nil, err
}
c.CompletedFilepath = completedFilepath
}

Copy link
Contributor

@javiermolinar javiermolinar Jul 23, 2024

Choose a reason for hiding this comment

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

You are right @WesselAtWork. It is overwriting the config always. Please feel free to create a PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

@WesselAtWork , I've created a bug issue here: #3902

Would you add additional details?


# WAL encoding/compression.
# options: none, gzip, lz4-64k, lz4-256k, lz4-1M, lz4, snappy, zstd, s2
[v2_encoding: <string> | default = "zstd" ]

# Defines the search data encoding/compression protocol.
# Options: none, gzip, lz4-64k, lz4-256k, lz4-1M, lz4, snappy, zstd, s2
[search_encoding: <string> | default = "snappy"]

# When a span is written to the WAL it adjusts the start and end times of the block it is written to.
# This block start and end time range is then used when choosing blocks for search.
# This is also used for querying traces by ID when the start and end parameters are specified. To prevent spans too far
# in the past or future from impacting the block start and end times we use this configuration option.
# This option only allows spans that occur within the configured duration to adjust the block start and
# end times.
# This can result in trace not being found if the trace falls outside the slack configuration value as the
# start and end times of the block will not be updated in this case.
[ingestion_time_range_slack: <duration> | default = unset]

# WAL file format version
# Options: v2, vParquet, vParquet2, vParquet3
[version: <string> | default = "vParquet3"]
```

## Overrides

Tempo provides an overrides module for users to set global or per-tenant override settings.
Expand Down
Loading