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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Changes from 6 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
189 changes: 155 additions & 34 deletions docs/sources/tempo/configuration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ The Tempo configuration options include:
- [Local storage recommendations](#local-storage-recommendations)
- [Storage block configuration example](#storage-block-configuration-example)
- [Memberlist](#memberlist)
- [Configuration Blocks](#configuration-blocks)
- [Filter Policies](#filter-policies)
- [WAL Config](#wal-config)
- [Overrides](#overrides)
- [Ingestion limits](#ingestion-limits)
- [Standard overrides](#standard-overrides)
Expand Down Expand Up @@ -321,6 +324,12 @@ metrics_generator:
# per additional dimension instead of one.
[enable_client_server_prefix: <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 @@ -330,7 +339,7 @@ metrics_generator:
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.02, 2.05, 4.10, 8.20, 16,40]
Copy link
Author

Choose a reason for hiding this comment

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

Is this correct?

cfg.HistogramBuckets = prometheus.ExponentialBuckets(0.002, 2, 14)

Should be 14 entries correct?


# Configure intrinsic dimensions to add to the metrics. Intrinsic dimensions are taken
# directly from the respective resource and span properties.
Expand All @@ -352,19 +361,41 @@ metrics_generator:
# 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 metric 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
WesselAtWork marked this conversation as resolved.
Show resolved Hide resolved
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 ]


# List of policies that will be applied to spans for inclusion or exlusion.
[filter_policies: <list of Filter Policies> | 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 @@ -385,14 +416,23 @@ metrics_generator:
# 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 = ""]

Copy link
Author

Choose a reason for hiding this comment

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

I didn't find a default value for the path is set in the code, around the metrics-generator
But If I look at the wal code, it should except if you do not set it, which feels like an oversight?
It feels like it should set a default value?

tempo/tempodb/wal/wal.go

Lines 52 to 54 in 251bf5a

if c.Filepath == "" {
return nil, fmt.Errorf("please provide a path for the WAL")
}

# 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>

# How long to wait when flushing samples on shutdown
[remote_write_flush_deadline: <duration> | default = 1m]
Expand All @@ -409,6 +449,12 @@ metrics_generator:
# 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 @@ -1054,29 +1100,11 @@ storage:
[queue_depth: <int>]

# 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
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 @@ -1204,6 +1232,99 @@ memberlist:

```

## Configuration Blocks
WesselAtWork marked this conversation as resolved.
Show resolved Hide resolved

Defines re-used configuration blocks
WesselAtWork marked this conversation as resolved.
Show resolved Hide resolved

### Filter Policies

Span Filter 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>]
```

#### Example
```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 apeended 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 apeended to.
# Will always join the `path` with "blocks" to generate the effective path
# Example: "/var/tempo/wal/blocks" (ignored)
[blocksfilepath: <ignored> | = join(.path, "/blocks")]
WesselAtWork marked this conversation as resolved.
Show resolved Hide resolved

# 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