Sampling Logs
Sometimes, you might not want to upload all messages in a log. For instance, the log might be cluttered with noisy debug messages. Specify sampling rules in the agent configuration to either subsample certain messages (uploading only a random sample), or exclude them entirely.
You can read more about log sampling here.
Annotation
log.config.scalyr.com/sampling_rules.0.match_expression: INFO
log.config.scalyr.com/sampling_rules.0.sampling_rate: 0.1
log.config.scalyr.com/sampling_rules.1.match_expression: FINE
log.config.scalyr.com/sampling_rules.1.sampling_rate: 0
CLI
kubectl annotate pod <pod name> --overwrite log.config.scalyr.com/sampling_rules.0.match_expression=INFO
kubectl annotate pod <pod name> --overwrite log.config.scalyr.com/sampling_rules.0.sampling_rate=0.1
kubectl annotate pod <pod name> --overwrite log.config.scalyr.com/sampling_rules.1.match_expression=FINE
kubectl annotate pod <pod name> --overwrite log.config.scalyr.com/sampling_rules.1.sampling_rate=0
YAML
metadata: annotations: "log.config.scalyr.com/sampling_rules.0.match_expression": "INFO", "log.config.scalyr.com/sampling_rules.0.sampling_rate": "0.1", "log.config.scalyr.com/sampling_rules.1.match_expression": "FINE", "log.config.scalyr.com/sampling_rules.1.sampling_rate": "0"
Comments
0 comments
Please sign in to leave a comment.