Scalyr Agent collects Linux system metrics every minute by default. Even though it doesn't add much to the total log volume, in some cases you might not need to monitor those metrics frequently.
You can change the metrics sampling rate by disabling metrics first and then enable it explicitly by adding the metrics module to the monitor's section of the agent config.
Examples:
- Setting Linux system metrics sampling rate to 5 minutes
implicit_metric_monitor: false,
"monitors": [
{
"module": "scalyr_agent.builtin_monitors.linux_system_metrics",
"sample_interval": 300
}
]
- Setting Windows system metrics sampling rate to 10 minutes
{
api_key: "XXXXXX",
implicit_metric_monitor: false
server_attributes: {
serverHost: "localhost"
}
...
...
monitors: [
{
module: "scalyr_agent.builtin_monitors.windows_system_metrics",
sample_interval: 600
}
]
}
The same option is also available for the K8s agent. There are two ways to configure Docker/K8s metrics sampling interval.
- Setting annotations via configMap "scalyr-config"
apiVersion: v1
data:
SCALYR_GLOBAL_MONITOR_SAMPLE_INTERVAL: "600"
SCALYR_K8S_CLUSTER_NAME: my-cluster
kind: ConfigMap
...
- Overridden "sample_interval" monitor config option inside the configMap for docker.json file
docker.json: |+
{
"monitors":[
{
"module": "scalyr_agent.builtin_monitors.kubernetes_monitor",
"sample_interval": 600
}
]
}
Comments
0 comments
Please sign in to leave a comment.